Jump to content
  • 4

Base protection for vehicles


Stanhope

Question

21 answers to this question

Recommended Posts

  • 1
6 hours ago, Chutnut said:

 I think we got a developer on our hands

I don't know how long it's been since you (or anyone here) has been to school, but do you remember looking at a worked out version of an exercise and think 'yea i understand that, i don't need to make any myself'.  And then on the test you haven't the slightest clue on how to begin at a similar exercise? 
Now that's what i (kind of) have.  I understand most of the scripts (not all) and can even find some ways to improve them.  But i can't come up with those types of scripts myself at this moment.  Maybe if i practice some more i might, one day, be able to.

Link to comment
Share on other sites

  • 0

Outstanding work my friend, great idea and even better doing some of the initial work!

 

By all means it is more than possible it may be included in the next I&A iteration, I'll get in contact with the powers that be and see if it's compatible.

 

Lone

AW Concept Liaison 

Link to comment
Share on other sites

  • 0
6 hours ago, Stanhope said:

I don't know how long it's been since you (or anyone here) has been to school, but do you remember looking at a worked out version of an exercise and think 'yea i understand that, i don't need to make any myself'.  And then on the test you haven't the slightest clue on how to begin at a similar exercise? 

Yup, I know. I know it all too well.....

 

It is called chemistry

Link to comment
Share on other sites

  • 0

I both like and hate this.... When the server is busy, this script would be fantastic. but late at night when there's no chance of an admin, using base vehicles is the only tool we have to clear up junk that's in the way at base, such as Heli's on the repair pad in such a way that their tail rotar instantly breaks on starting the engine

 

Likewise a greyhawk stuck against a tree at base, due to someone landing it, realising they already had a greyhawk on the repair pad, then the automation trying to drive the greyhawk through the woods when you disconnect from the greyhawk to move the other.

Link to comment
Share on other sites

  • 0
11 minutes ago, Nibbs said:

I both like and hate this.... When the server is busy, this script would be fantastic. but late at night when there's no chance of an admin, using base vehicles is the only tool we have to clear up junk that's in the way at base, such as Heli's on the repair pad in such a way that their tail rotar instantly breaks on starting the engine

 

Likewise a greyhawk stuck against a tree at base, due to someone landing it, realising they already had a greyhawk on the repair pad, then the automation trying to drive the greyhawk through the woods when you disconnect from the greyhawk to move the other.

There are still ways around this.  For instance switch to a repair spec slot, use a hunter to push back greyhawks, ...   And then there's always the option (that you should never use) of 'accidently' crashing into the thing that got stuck.

Link to comment
Share on other sites

  • 0
Just now, Cryo said:

It works pretty well, but be prepared for physics to kick into overdrive if you attempt it!

As long as you take it slow and don't go hitting it at 20km/h you shouldn't explode.  Just make sure to turn the autonomous function of the UAV off before doing it otherwise it might get itself stuck again in the same place, I speak from experience.

Link to comment
Share on other sites

  • 0

I don't know which idiot wrote that script in the first post but it is rubbish, it only works for vehicles you name and needs to be endlessly copy pasted in the init files. Who the heck even listened to that idiot?  :D

 

On a more serious note:  after @Chuck Norris messaged me in TS asking me if that script could take an array of vehicles i had to answer that it didn't. So i set out to fix that. After writing multiple scripts that either don't do anything or don't do what i want them to do, contained multiple nested ifs and where pretty long i came up with this solution (if anyone could tell me why i wrote those damn long scripts before coming up with this?):

/*description: 	script that allows vehicles that are in the GunsInBase array to shoot in a given radius around a given marker.  
				All other vehicles cannot fire in base.  Can be put in both init.sqf and initPlayer.sqf.
author: AW-community */
GunsInBase = ["B_MRAP_01_hmg_F"];

player addEventHandler ["Firedman", {
	params ["_unit", "_weapon", "", "", "", "", "_projectile","_veh"];
	if (!(typeOf _veh in GunsInBase) && (_unit distance (getMarkerPos "hunterSpawn")) < 300) then 
		{deleteVehicle _projectile;
		hintC "Don't fire inside the base!";};	
	}];

 

Features:

-works for any vehicle not in the 'GunsInBase' array this includes players

-works for all vehicle turrets

-works for firing from vehicles

-partially works for smokescreens (it displays the message but doesn't delete the smoke)

 

 

I'm still trying to:

-add a whitelist for vehicles that are of a type not in the gunsinbase array but do need to be able to fire
-add a whitelist for a given set of UIDs

-add an array of the markers around which shooting isn't allowed

(-get a girlfriend and/or more icecream @TheScar :D)


So some practical info:

-it is supposed to replace the current script

-it can be placed in the following files: init.sqf, initPlayerLocal.sqf, onPlayerRespawn.sqf (i advise to put it in the last for the fobs, chuck will know what i'm talking about)

-instead of an array that says which stuff can fire in base, an array can be made for which can't.  However keep in mind that you'd need to add ALL vehicles in this array.  I strongly advise to use the version in this post.

Link to comment
Share on other sites

  • 0

Nice work Stanhope! Using the class names in an array is a much better way of doing things then copying the script over and over. 

 

As ive already edited the mission file with your original suggestion i wont change it just yet as you are still working on it. There is no rush as we are working on a some updates and it might take some time. :) Good Job once again!

Link to comment
Share on other sites

  • 0
3 hours ago, Chuck Norris said:

Nice work Stanhope! Using the class names in an array is a much better way of doing things then copying the script over and over. 

 

As ive already edited the mission file with your original suggestion i wont change it just yet as you are still working on it. There is no rush as we are working on a some updates and it might take some time. 

Just so i'm not wasting my time, do you need all the things i'm trying to do?  And which one is in your eyes more important?  Because the semester started again so i might have a little less time than i want/need.

Link to comment
Share on other sites

  • 0

Sharing your thoughts and suggestions are the most important thing,  as we love to hear everyones feedback and criticism so we can adapt and improve the mission. 

 

With the site leader changes we can hopefully allocate more time to the development and write scripts internally more. Your help with the coding recently has been very helpful though. Keep the scripts and ideas coming but focus on school/uni/college,  ect more :)

 

 

Link to comment
Share on other sites

  • 0

I was actually talking about these points:

Quote

 

I'm still trying to:

-add a whitelist for vehicles that are of a type not in the gunsinbase array but do need to be able to fire
-add a whitelist for a given set of UIDs

-add an array of the markers around which shooting isn't allowed

 

But the general thing is good as well :D

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Forum Statistics

    11.1k
    Total Topics
    66.4k
    Total Posts
×
×
  • Create New...