Jump to content
Sign in to follow this  
CarlGustaffa

unitName action ["ENGINEON", vehicleName]

Recommended Posts

Hi

Anyone know how to have a unit turn off its engine when it comes to a waypoint, and wait there until a trigger condition is met? I've tried various means of switch triggers and waypoint conditions, but it seems to only work if the action is used on the last waypoint.

I don't want to have them get out. In the army days, we were spending a lot of time in vehicles waiting for something to happen, new orders to get in etc. I want my arma squads to behave the same way.

A turned off engine is a lot more stealthy.

Any ideas? Do I need to use scripts for such a trivial task?

Share this post


Link to post
Share on other sites

Wow, does this mean it is not possible? Sounded so simple crazy_o.gif

Ehhm, is it then possible to setDammage to a specific part of a vehicle? Similar to disableAI "MOVE" and such. I mean, ArmA obviously already registers where damage is inflicted (ref. some other thread).

This is then due to the light problem; if I as leader exits a Stryker M2 with squad members still in it, the Stryker turns on the light. Aarrrggh -- stealth to hell...

Share this post


Link to post
Share on other sites

I suspect the issue is a waypoint's OnAct script is not executed until the waypoint is complete. So, when you synchronize a waypoint with a trigger, the truck will wait at that waypoint, but any on Activation script will not be executed until the trigger is activated (ie, the truck turns the engine off at the exact same time as driving away, net result is engine stays on).

You can get an AI to turn off the engine by putting two waypoints extremely close together (a couple of meters in direction of travel is fine). Synchronize the trigger with the second waypoint. In the first waypoint, execute a script such as this :

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">~5

driver testTruck action ["engineOff", testTruck]

The truck gets to the first waypoint, starts the script, then arrives at the second waypoint and halts before the script's sleep time runs out. When it does, the driver turns the engine off, and waits for the trigger to activate.

Share this post


Link to post
Share on other sites

So basically, I do need to use script to control this... Hmm, I was hoping otherwise.

I really wish there was a way to set AI 'smartness' on a per group, unit, or vehicle basis, making it possible to override the typical autobehaviour stuff going on.

(edit: spelling)

Share this post


Link to post
Share on other sites

I´m not sure if that is fixed already (crew bailed out if no fuel is in vehicle). If it´s fixed already you can use

nameofvehicle setfuel 0 in activation trigger or wp Onactivation line

and

nameofvehicle setfuel 1

when you want them to turn on the engine again.

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  

×