Jump to content
Sign in to follow this  
Rav_Raven

action "Lighton" dont work

Recommended Posts

I need the AI will automatically switch the lights of vehicles approaching from the base, but the command:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">unit action [ "Lighton", targetVehicle]

Seems to have no effect.

Someone to find another alternative?

Share this post


Link to post
Share on other sites

I'm just taking a stab in the dark (pun definitely intended!wink_o.gif but have you tried capitalizing the "O" in "LightOn"?

Share this post


Link to post
Share on other sites

If I remember correctly, the AI will only turn the lights on if they're in safe or careless mode.

Share this post


Link to post
Share on other sites

Yea that sux...

Shuld be able to order that...

Same with the engine.

With ace you need to worry about fuel...Thus i need my AI

to turn of the engine...

Share this post


Link to post
Share on other sites

Anyway, it isn't :

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">unit action [ "Lighton", targetVehicle]

but :

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">unit action ["Light on", targetVehicle]

And targetvehicle is useless :

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">unit action ["Light on"]

is enough.

But it's true that it depends also on unit's behaviour. So you only need to switch unit's behaviour to "safe" or "careless" to have lights turned on.

Share this post


Link to post
Share on other sites

Thank you all.

indeed, the behavior of the AI and more precisely its combatmode is what controls the on / off of lights.

The actions:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">unit action [ "Light on", targetVehicle] or

unit action [ "Lighton", targetVehicle]

are useless in this case despite what the wiki says.

Share this post


Link to post
Share on other sites
Quote[/b] ]if the correct spelling is confirmed to be "light on" (with a space), then the wiki should be corrected to reflect this. Odd that every other action is without a space.

Sorry, didn't realize that actions syntax did change since Ofp. Sorry again.

Share this post


Link to post
Share on other sites

The correct syntax is "lighton" & "lightoff", but that action only works persistently with empty vehicles.

If the vehicle is AI controlled the command will cause the light to switch momentarily, but will be reset right away by the AI.

To control the lights of AI-controlled vehicles, set their behavior to "combat" or "stealth" to turn it off. Any other behavior modes will cause them to drive with the lights on.

Another situation is where the player is the driver of the vehicle.

If you have the "Light On/Off" option in your action menu, then you can either (obviously) control it via the action menu, or via the action command.

If you don't see the light action, then that means that some other (AI) unit is the commander of the vehicle (e.g. the gunner in an M2 HMMWV), who is then also charge of the driving/behavior mode, and therefore the light status.

In that case you'd have to set the commander/gunner of the player-driven vehicle to mode "combat" or "stealth" in order for the light to be turned off.

Share this post


Link to post
Share on other sites

if what I had put in the wiki was correct, AI will automatically turn on/off lights depending on daylight (if allowed by current behaviour mode). I'll do a quick test...

edit : still holds true

Share this post


Link to post
Share on other sites

I need a script that works for the setting of a base. The vehicles (planes and helicopters) to get closer to the base at night, turn-on the lights and turn-off to their missions.

The vehicles are dynamically created. Even so, the command Lighton, combined with beaviour and combatmode are not effective. huh.gif

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  

×