Jump to content
Sign in to follow this  
adrian858

Infinite Fuel

Recommended Posts

Hi,

I've been trying to find an init command I can add to enemy IA helicopters to give them infinite fuel so they won't just land when they run out during a long mission.

Any ideas?

Thanks.

Share this post


Link to post
Share on other sites

Not sure if this would work, but you could set a trigger like this:

Act.: heli1 fuel <.1

On Act.: Setfuel heli1 1

And do this for every heli, spaced with a ;

Share this post


Link to post
Share on other sites

Put the following in the Vehicles you want to have unlimited fuel.

nul = [this] execVM "unlimitedFuel.sqf";

Now create a file in your mission folder:

unlimitedFuel.sqf

And put the following inside that file:

_unit = _this select 0;

while{alive _unit} do

{

if (fuel _unit <= 0.2) then

{

_unit setFuel 1;

};

sleep 10;

};

_neo_

Share this post


Link to post
Share on other sites

What about an eventhandler?

this addeventhandler ["fuel", {(_this select 0) setfuel 1}]

Share this post


Link to post
Share on other sites

Could someone please show me the correct syntax for an OPFOR-Present-Repeatedly refuel for all vehicles on the map trigger. I've tried:

this && side == EAST && fuel < .3; w/ ONACT of this setfuel 1;

But I keep getting an error trying to close the trigger, any help would be appreciated.

Share this post


Link to post
Share on other sites

Here's a simple one from Sickboy on Kaylanias site Kylania script examples

=================================================================

In air unit initialization field:

Code:

nul = this spawn { while {alive _this} do { _this setFuel 1; sleep 60 } };

Unless you require the handling to be actually checked for amount, then you could do something like this:

Code:

nul = this spawn { waitUntil { if !(alive _this) exitWith {}; if (fuel _this < 0.25) then { _this setFuel 1 }; false } };

Change 0.25 to the level you want it to refill to 100%.

You can add a sleep before ; false to make it less resource intensive (for as far as it could be :P

=================================================================

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  

×