Jump to content
Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Sign in to follow this  
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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
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? 😮

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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.

Sign in to follow this  

×
×
  • Create New...