Jump to content
stevenpc66

How to delay the time few seconds before execute siren command?

Recommended Posts

Hello everyone,

I'm trying to modify my mod about the siren, i read through the LASiren.script file, but i don't know how to delay the time before siren raise up. I means when move emergency vehicle to a point, the siren will raise up immediately, but i want the emergency vehicle will move but the siren will come after it moves for a few second. Can i get any intel from you? :D

Link to comment
Share on other sites

16 minutes ago, itchboy said:

Pretty much. The siren script works by creating a dummy object that follows the vehicle. That dummy object is what actually produces the siren sound ingame.

 You will have to rewrite that formula to make the sirens be delayed after pressing the button.

I added m.PushActionWait(ACTION_APPEND, 10.f) befor Game::ExecuteCommand(CMD_SIREN, &v, &v), but it did not delay time in begin, it delayed when vehicle stopped for 10s =D

Link to comment
Share on other sites

20 minutes ago, stevenpc66 said:

Great idea, but it's not a good way, because here is more than 10 different sirens in my mod and when the sound is looped, it will not real =D

Than make a loop manual put another copy of the siren to loop for like 1 minute, and boom - you got this.

Link to comment
Share on other sites

10 hours ago, stevenpc66 said:

I added m.PushActionWait(ACTION_APPEND, 10.f) befor Game::ExecuteCommand(CMD_SIREN, &v, &v), but it did not delay time in begin, it delayed when vehicle stopped for 10s =D

I'm afraid it doesnt work this way.

If I were to do this, I would take a look create a dummy that will wait for 10 seconds, then create a second dummy that will then trigger the siren itself. The first dummy will be called upon in the VcmdSiren script to wait for 10 seconds, then after that, it will execute a new command with the vehicle (the one you are commanding) as the target. In this new command, it will instruct the original dummy to create the actual siren dummy that plays the tone.

Both of them must be linked to the original vehicle using the userData lines, and the "waiting" dummy must be deleted to give way for the actual siren dummy.

Link to comment
Share on other sites

2 hours ago, itchboy said:

I'm afraid it doesnt work this way.

If I were to do this, I would take a look create a dummy that will wait for 10 seconds, then create a second dummy that will then trigger the siren itself. The first dummy will be called upon in the VcmdSiren script to wait for 10 seconds, then after that, it will execute a new command with the vehicle (the one you are commanding) as the target. In this new command, it will instruct the original dummy to create the actual siren dummy that plays the tone.

Both of them must be linked to the original vehicle using the userData lines, and the "waiting" dummy must be deleted to give way for the actual siren dummy.

So i still have to modify in move.script and keep using PushActionWait(), right?

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...