Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / Audio synced actions. Timed entity spawns? Min:Sec:MSec?

Author
Message
Tobias_Ripper
11
Years of Service
User Offline
Joined: 24th Mar 2013
Location: REPCONN inc.
Posted: 17th May 2013 06:39 Edited at: 17th May 2013 07:14
Working on a sound effects clip which is supposed to play a mix of sound effects for spawning entities. I have 3 impact sounds one at 1min:20sec:00msec one at 1min:26sec:12msec and one at 1min:35sec:9msec

How do I time my entity spawns according to those time values? Is there a sort of "StartTimer" function which would start a virtual timer and then through IF statements I could spawn entities in the level?

PS: The sounds use a lot of post-processing effects thus having each individual entity with its own sound effect is out of the question.

Isenstadt Studio: http://isenstadtstudio.com/
Composers Page: http://milothatch.isenstadtstudio.com
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 17th May 2013 07:21 Edited at: 17th May 2013 07:24
Quote: "Is there a sort of "StartTimer" function which would start a virtual timer and then through IF statements I could spawn entities in the level"


There is the "etimerstart" (action) and "etimergreater=x" (condition). The "etimer" value is in milliseconds. For example, you could have something like this:



Using "etimer", 1000ms equals 1 second. The first time of 1m:20s:0ms = (60000+20000)ms; the second time of 1m:26s:12ms = (60000+26000+12)ms; the third time of 1m:35:9ms = (60000+35000+9) ms.

Your three entity names much match the name used in the "settargetname=x" field, and set "Spawn at Start" to no. *NOTE* the above script will start once you enter the game.

If you want the script to run when the player hits a trigger, then you would do something like this:



That should get you into the right direction.


There's no problem that can't be solved without applying a little scripting.
Tobias_Ripper
11
Years of Service
User Offline
Joined: 24th Mar 2013
Location: REPCONN inc.
Posted: 17th May 2013 07:55 Edited at: 17th May 2013 07:55
That looks exactly what I needed. Thank you kindly.

Now if I am working with one single file that countains a couple of sounds then I can just use one single timer, right? If I start the etimer in stage=1 then it will continue going limitless throughout all stages, right? I don't have to re-declare it.

Isenstadt Studio: http://isenstadtstudio.com/
Composers Page: http://milothatch.isenstadtstudio.com
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 17th May 2013 17:46 Edited at: 17th May 2013 17:47
Quote: "Now if I am working with one single file that countains a couple of sounds then I can just use one single timer, right? If I start the etimer in stage=1 then it will continue going limitless throughout all stages, right? I don't have to re-declare it."


Correct. If one sound played at 1m:20sec and the other was at 1m:50sec then you could do something like the following.



You will notice I called the "etimerstart" once in the first state line; the rest only use the "etimergreater=x". There are times where you may need to "adjust" the "etimergreater=x" values as they may not quite be in sync with where you want them. We have had to do the same on a few scripts using sound, etc, but you get the idea.


There's no problem that can't be solved without applying a little scripting.
Tobias_Ripper
11
Years of Service
User Offline
Joined: 24th Mar 2013
Location: REPCONN inc.
Posted: 21st May 2013 21:13
Ah ok, Now lastlry is it possible to run more than one etimer? One for synching sound effects and one for other global events?

Like etimer1 etimer2 and use etimer1greater=x etimer2greater=x

Thanks

Isenstadt Studio: http://isenstadtstudio.com/
Composers Page: http://milothatch.isenstadtstudio.com
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 21st May 2013 21:38
Quote: "Ah ok, Now lastlry is it possible to run more than one etimer? One for synching sound effects and one for other global events?

Like etimer1 etimer2 and use etimer1greater=x etimer2greater=x"


No, it does not work that way. The command is "etimerstart/etimergreater=x"; there is no "etimer1/etimer1greater=x". With "etimer" you can have multiple "etimers" running whereas in the old days we just had "timer" and only one instance could run.

In your case you can have two scripts- one for syncing your audio and one for running other global events.


There's no problem that can't be solved without applying a little scripting.
Tobias_Ripper
11
Years of Service
User Offline
Joined: 24th Mar 2013
Location: REPCONN inc.
Posted: 21st May 2013 22:13
Oh, so for very new script, I can have a separate etimer then. That is great to know, thanks.

Then I can just use one triggerzone to run several scripts their own timers using runfpi=X

Thanks man, helps a lot!

Isenstadt Studio: http://isenstadtstudio.com/
Composers Page: http://milothatch.isenstadtstudio.com

Login to post a reply

Server time is: 2024-11-23 14:09:39
Your offset time is: 2024-11-23 14:09:39