Jump to content
Sign in to follow this  
HateDread

Starting Empty Searchlights On

Recommended Posts

Hey guys,

As the title suggests, how do I script a searchlight to start on, without having to be manned? Something in the initialization field?

Cheers.

Share this post


Link to post
Share on other sites

Actually, this applies for any vehicle; I want to start them with their lights on. What do I put in the initialization field?

Share this post


Link to post
Share on other sites

Searchlights will work without a man in them:

Condition field

(daytime > 19.75 || daytime < 4.25)

19.75 is the time on 4.25 is the time off.

On Activation Field

player action ["lightOn", nameofyourlight]

On Deactivation

player action ["lightOff", nameofyourlight]

Set the trigger to repeatedly.

Share this post


Link to post
Share on other sites

Thankyou.

If I set this for vehicles, it'll over-ride the driver's light toggle, won't it? Problem is I'd still like the driver to be able to turn them off to go stealth. They only need to be on at the start.

Is it possible to do this, but only at first, and when they respawn? It's just so people at the base can see the vehicles, at night, get in, then choose whether they want the lights on or off.

Thanks so far.

EDIT: Ok, so they work, mostly. They can be switched off by the driver, and they stay off, untill turned on again. Only thing I need to fix is the lights not being on when the vehicle respawns using the PVP Script Pack. How would I do this? Something to add to the initialization field?

Edited by HateDread

Share this post


Link to post
Share on other sites

Thanks for that list.

But how would I go about applying such an action to a vehicle that respawns? It doesn't work (lighton, etc), when they respawn.

Share this post


Link to post
Share on other sites

No ( :P ), but as I said, I am applying the same commands to vehicles (LAV's, BMP's, etc), so that the players can easily find them to get in, and use, as the mission starts at night.

But when the vehicles are destroyed, and they respawn, the 'lighton trigger' no longer works. Any help?

Share this post


Link to post
Share on other sites

If you put the command in their init, Tophe's nice respawn script will respawn then with their init and it'll run again.

Share this post


Link to post
Share on other sites

Try what kylania said with the respawn script, otherwise you can try something along these lines:

condition field

Alive unit

On activation

player action ["lightOn", nameofyourlight]

Share this post


Link to post
Share on other sites

I'll try that out, thanks.

How do I set a trigger for multiple units? Like, how do I have multiple "nameofyourlight"s, such as Light1, Light2, Light3, etc, in the one code?

Share this post


Link to post
Share on other sites

This is how I do it, there might be a way to consolidate but I dont know how to do it.

player action ["lightOn", light1]; player action ["lightOn", light2]; player action ["lightOn", light3]

Share this post


Link to post
Share on other sites
for "_i" from 1 to 4 do {  // change 4 to how many lights you have.
_light = "light" + str(_i);
player action["lighton",call compile format["%1",_light]];
};

Share this post


Link to post
Share on other sites

Sorry, but how do I use what you just wrote? In a trigger's "on Activation"? It seems different to that sorta stuff.

Share this post


Link to post
Share on other sites

@hatedread

Condition:

(daytime > 19.00 || daytime < 5)

On Act:

for "_i" from 1 to 3 do {_light = "light" + str(_i); player action["lighton",call compile format["%1",_light]];};

On DeAct:

for "_i" from 1 to 3 do {_light = "light" + str(_i); player action["lightoff",call compile format["%1",_light]];};

@Kylania

Thanks for that info.

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  

×