Ghost Graphic Designs Posted June 2, 2015 Report Share Posted June 2, 2015 Hi. I would like to know if it's possible (I'm almost sure they all are):Force a squad vehicle to disable the headlights when inside a VO (and enabling when it's outside that VO). Force a VO to change from "Freely Accessible" to "Barricade" with a trigger (by squad vehicle). Play a looped sound while the pump switch (from the Limited Water Supply mod) is active.I also request some guidelines on how to do this. Just tell me what to edit and I'll do it, I'm kind of experienced with script editing. Thank you for reading. Quote Link to comment Share on other sites More sharing options...
Pottyscotty Posted June 2, 2015 Report Share Posted June 2, 2015 I am not used to the Scripting language used for EM4 but I have been trying figuring out the pump loop as well. I have not tested this but after quickly searching through some code I have found that the thing that could make it loop is the addition of "soundID =" Number one is a sample from the Water Switch script for the limited supply and number two is for the Communication vehicles in Brooklyn mod (Which the Audio loops for). Apart from the endings (CarPos and Get Pos) which I believe are just the positions so shouldn't make a difference to looping, the only difference is the "soundID =" part. Number three is the edit I would try, I could be wrong but who knows 1) Audio::PlaySample3D("mod:Audio/FX/misc/pump_on.wav", v.GetPosition()); 2) soundID = Audio::PlaySample3D("mod:Audio/Ambient/FirehouseRadio.wav", CarPos, true); 3) soundID = Audio::PlaySample3D("mod:Audio/FX/misc/pump_on.wav", v.GetPosition()); Quote Link to comment Share on other sites More sharing options...
itchboy Posted June 3, 2015 Report Share Posted June 3, 2015 Unfortunately, what your doing requires a constantly checking script that would eat a considerable amount of FPS. Instead I propse this:Hi. I would like to know if it's possible (I'm almost sure they all are):Force a squad vehicle to disable the headlights when inside a VO (and enabling when it's outside that VO). Force a VO to change from "Freely Accessible" to "Barricade" with a trigger (by squad vehicle). Play a looped sound while the pump switch (from the Limited Water Supply mod) is active.I also request some guidelines on how to do this. Just tell me what to edit and I'll do it, I'm kind of experienced with script editing. Thank you for reading. In your ToStation script, when the vehicle is in the station at the start of the game, disable its headlights. Then when you send them out through a script, enable their headlights. Then when you send them back into station, disable their headlights. These are all manually done and not automatically when the vehicle leaves the VO. Use this code:void EnableHeadLights(bool enable_);For the trigger thing, it isnt possible in normal freeplay. The game does not recognize triggers in freeplay, only mission scripts. So you'd have to just set it manually instead of relying on a trigger.bool SetVirtualObjectTerrain(const char* terrain_); Quote Link to comment Share on other sites More sharing options...
Corsair Posted June 3, 2015 Report Share Posted June 3, 2015 This is cool because you can kind of control the headlights and it would make it more realistic when the headlights turn off when you return to station Quote Link to comment Share on other sites More sharing options...
The Loot Posted June 3, 2015 Report Share Posted June 3, 2015 Well, I use this for playing and stopping a 3D sound for my Automatic Fire Alarm script, playing then stopping the sound.int x;x = Audio::PlaySample3D(Sound3D, obj->GetPosition(), true);obj->SetUserData(x);int ref = Target->GetUserData();Audio::StopSample(ref);The SetUserData might conflict with the functioning of whatever script you're adding it to. Quote Link to comment Share on other sites More sharing options...
Ghost Graphic Designs Posted June 3, 2015 Author Report Share Posted June 3, 2015 Unfortunately, what your doing requires a constantly checking script that would eat a considerable amount of FPS. Instead I propse this:In your ToStation script, when the vehicle is in the station at the start of the game, disable its headlights. Then when you send them out through a script, enable their headlights. Then when you send them back into station, disable their headlights. These are all manually done and not automatically when the vehicle leaves the VO. Use this code:void EnableHeadLights(bool enable_);For the trigger thing, it isnt possible in normal freeplay. The game does not recognize triggers in freeplay, only mission scripts. So you'd have to just set it manually instead of relying on a trigger.bool SetVirtualObjectTerrain(const char* terrain_); Yeah, I exactly that with my alarm and ToStation scripts (headlights on/off and engine sounds aswell). About the VO, I had an idea and I'm going to try something out with LA Mod's ToStation script... Well, I use this for playing and stopping a 3D sound for my Automatic Fire Alarm script, playing then stopping the sound.int x;x = Audio::PlaySample3D(Sound3D, obj->GetPosition(), true);obj->SetUserData(x);int ref = Target->GetUserData();Audio::StopSample(ref);The SetUserData might conflict with the functioning of whatever script you're adding it to.Alright, thanks. I am not used to the Scripting language used for EM4 but I have been trying figuring out the pump loop as well. I have not tested this but after quickly searching through some code I have found that the thing that could make it loop is the addition of "soundID =" Number one is a sample from the Water Switch script for the limited supply and number two is for the Communication vehicles in Brooklyn mod (Which the Audio loops for). Apart from the endings (CarPos and Get Pos) which I believe are just the positions so shouldn't make a difference to looping, the only difference is the "soundID =" part. Number three is the edit I would try, I could be wrong but who knows 1) Audio::PlaySample3D("mod:Audio/FX/misc/pump_on.wav", v.GetPosition()); 2) soundID = Audio::PlaySample3D("mod:Audio/Ambient/FirehouseRadio.wav", CarPos, true); 3) soundID = Audio::PlaySample3D("mod:Audio/FX/misc/pump_on.wav", v.GetPosition());OK, thank you! I'm gonna take a deeper look into that, I'll keep you posted. Quote Link to comment Share on other sites More sharing options...
Dyson Posted June 18, 2015 Report Share Posted June 18, 2015 As far as I'm aware with regards to looping audio of a static source (not moving) you use the code above but change the "true" to "false" as that specifies whether the audio should loop. That's the logic I went off anyway Quote Link to comment Share on other sites More sharing options...
Steven Dang Posted January 21, 2016 Report Share Posted January 21, 2016 Hello everyone, Can you introduce me how to make the animated gate can auto open and close when the vehicle is coming nearly and go far away, i tried to create Trigger but it;s nothing changed Quote Link to comment Share on other sites More sharing options...
bma Posted January 21, 2016 Report Share Posted January 21, 2016 Hello everyone,Can you introduce me how to make the animated gate can auto open and close when the vehicle is coming nearly and go far away, i tried to create Trigger but it;s nothing changed Name the trigger and the gate the same thing and make sure the gate has the animations open and closeTutorial: http://forum.emergency-planet.com/tutorials/article/45-creating-an-automatic-gate/ Quote Link to comment Share on other sites More sharing options...
Steven Dang Posted January 21, 2016 Report Share Posted January 21, 2016 Name the trigger and the gate the same thing and make sure the gate has the animations open and closeTutorial: http://forum.emergency-planet.com/tutorials/article/45-creating-an-automatic-gate/Thanks so much Quote Link to comment Share on other sites More sharing options...