Jump to content
Nick007

Looking for a SpecialLight script..

Recommended Posts

Hey! 
 

I’ve been digging around a bit trying to find a script that turns off emergency lights as the personnel exits the vehicle, and then turns on special lights (scene lights) once they are out. 

Is this even possible? (I mean theoretically, anything is possible, but im talking game mechanic-wise😂)

I wouldn’t mind trying to create my own, thing is i’ve got no experience in scripting (although I like to tinker around with existing scripts).. any leads?

Thanks!

Link to comment
Share on other sites

yeah I was thinking about that..it was mostly to set it up so that when personnel gets out, it kinda does the same thing as when emergency services put their vehicles in "park". White lights stops flashing, flash pattern slows down, I already have all of that setup, I just needed a script to bring it all together cuz i found it a little bit annoying having to turn off blue lights, then activating special lights... a little script could be helpful :P 

 

Thanks for the input!

 

Link to comment
Share on other sites

So good news,

 

I got it working, but now the only thing is it doesnt activate it in the bottom portion of the "vehicle commands"..I have to click the flood lights to turn it on, and then click them again to turn them off.. since they are not activated in the vehicle control buttons, if for example I send them back to station, the lights stay on, because the return to station script thinks the lights are off. (Because they appear so in the vehicle controls)

Any fix to make the EmptyCar script activate it in the vehicle control menu? Because otherwise the script works, it's just I need to find a way to make them activate the same way as if I pressed the button in the panel

 

Thanks!

 

Link to comment
Share on other sites

Yeah, as I said, that method was quick and dirty. The better option is done with a PushAction to activate the flood light command during EmptyCar, like so:

Caller->PushActionWait(ACTION_NEWLIST, 0.05f);
Caller->PushActionExecuteCommand(ACTION_APPEND, "ActivateFloodLightsCommandName", Caller, 0, false);

 

Link to comment
Share on other sites

12 hours ago, 2Bells Gaming said:

I could be wrong, but to verify I'm learning things properly and to assist anyone in their learning, would this need to be defined in the beginning of the script, where the other variables would be defined?

Wherever you find a PushAction used.

You can likely find a ACTION_NEWLIST PushAction somewhere in the script, and then you can add the PushActionExecuteCommand line as an ACTION_APPEND like the example.

Link to comment
Share on other sites

So I got it working, with a slightly different method though...I couldnt get PushAction to work, so what I did instead, is when the command is initiated, it removes the TurnFloodLightOn command and replaces it with TurnFloodLightOff instead. (Since v.EnableSpecialLights(true); already makes them turn on). And that took care of it! Thanks for the help peeps! Was kinda fun even though now I can kinda feel what devs are going through when making new scripts and testing them..I understand the hair pulling now..😂

 

  • Like 1
Link to comment
Share on other sites

19 hours ago, Nick007 said:

So I got it working, with a slightly different method though...I couldnt get PushAction to work, so what I did instead, is when the command is initiated, it removes the TurnFloodLightOn command and replaces it with TurnFloodLightOff instead. (Since v.EnableSpecialLights(true); already makes them turn on). And that took care of it! Thanks for the help peeps! Was kinda fun even though now I can kinda feel what devs are going through when making new scripts and testing them..I understand the hair pulling now..😂

 

Thanks for sharing your solution, eh?  It's the only way we're gonna learn and grow as a community.  Excellent work! 🤙

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...