Skip to content
View in the app

A better way to browse. Learn more.

Learn more

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

Featured Replies

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

I don't think its possible without reprogramming the entire siren script to run on a different method that allows you to delay the siren start, while also not interrupting the vehicle's movement.

  • Author
21 minutes ago, itchboy said:

I don't think its possible without reprogramming the entire siren script to run on a different method that allows you to delay the siren start, while also not interrupting the vehicle's movement.

So, your means is we have to re-build the script? 😮

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.

4 minutes ago, stevenpc66 said:

So, your means is we have to re-build the script? 😮

kek. Just insert few seconds of silence to siren sounds.

  • Author
13 minutes ago, EmC-Unit said:

kek. Just insert few seconds of silence to siren sounds.

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

  • Author
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

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.

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.

  • Author
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?

No, PushActionWait does not function in the way that you want it to.

Instead, you will have to create 2 dummy objects as I said. Simply adding the "wait" line is not going to achieve the results of what you want.

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.