Nick007 Posted July 3, 2021 Report Share Posted July 3, 2021 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! Quote Link to comment Share on other sites More sharing options...
The Loot Posted July 3, 2021 Report Share Posted July 3, 2021 A quick and dirty way could involve a small edit to the EmptyCar script by adding these two lines: v.EnableSpecialLights(true); v.EnableBlueLights(false); 2 Quote Link to comment Share on other sites More sharing options...
Nick007 Posted July 3, 2021 Author Report Share Posted July 3, 2021 Sweet! Ill give it a try! thanks! Quote Link to comment Share on other sites More sharing options...
The Loot Posted July 3, 2021 Report Share Posted July 3, 2021 And you can add the opposite to the EnterCar script to reverse the effect. Quote Link to comment Share on other sites More sharing options...
Nick007 Posted July 3, 2021 Author Report Share Posted July 3, 2021 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 Thanks for the input! Quote Link to comment Share on other sites More sharing options...
Nick007 Posted July 3, 2021 Author Report Share Posted July 3, 2021 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! Quote Link to comment Share on other sites More sharing options...
The Loot Posted July 4, 2021 Report Share Posted July 4, 2021 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); Quote Link to comment Share on other sites More sharing options...
2Bells Gaming Posted July 4, 2021 Report Share Posted July 4, 2021 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? Quote Link to comment Share on other sites More sharing options...
The Loot Posted July 5, 2021 Report Share Posted July 5, 2021 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. Quote Link to comment Share on other sites More sharing options...
Nick007 Posted July 6, 2021 Author Report Share Posted July 6, 2021 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.. 1 Quote Link to comment Share on other sites More sharing options...
2Bells Gaming Posted July 6, 2021 Report Share Posted July 6, 2021 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! Quote Link to comment Share on other sites More sharing options...