Jump to content

Sign in to follow this  
packtloss

Rearming AI vehicles.

Recommended Posts

Hey guys - I've not been able to find a solution for this issue, and im hoping someone can help.

Im working on an ambient environment for an airbase - aircraft landing and taking off, etc etc. I have a couple aircraft that are flying SAD way points after being pushed to the player's area of operations - they eventually return to the airbase, land, and cycle.

This would work nicely, and indefinitely - other than fueling and rearming the aircraft when they land. Can anyone recommend a way to script a trigger zone that would force the vehicles to rearm/repair/fuel upon entering it? Or possibly some sort of onAct at the way points?

Share this post


Link to post
Share on other sites

Fear not !

Not to hard to resolve.

You'll need a trigger to detect any air units around - even better if you have given them names like ,erm, cyril or adrian.

:icon_razz:

Now Evo uses commands for human players but we could make a trigger for any ai planes whenever they go near (maybe not have to land either..) they get the Farp treatmant.

 

_vec = -this select 0;
for [{_loop2=0}, {_loop2<1}, {_loop2=_loop2}] do
		 {
		    sleep 0.200;	    		    
		    if (getDammage _vec > 0) then {_vec setDammage ((getDammage _vec)-0.0125);};
		    if (Fuel _vec < 1) then {_vec setFuel ((Fuel _vec)+0.0125);};
		    if (getDammage _vec == 0 and Fuel _vec == 1) then {_loop2=1;};
		    if(_vec != vehicle player or speed _vec < -2 or speed _vec > 2 or position _vec select 2 > 2.0) then {_loop2=1;titleText 			    _dam = (getDammage _vec)*100;
		    _ful = (Fuel _vec)*100;
		  			};
		_vec setVehicleAmmo 1;		

Now this could be called,erm, lets say "rearm.sqf".

Make a funky trigger over your base and should do the trick.

Share this post


Link to post
Share on other sites

I will try as soon as im done at the office. Thanks so much!

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×