Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Delay sound from playing
LDOriginal Offline
Junior Member

Posts: 35
Threads: 7
Joined: Oct 2014
Reputation: 0
#5
RE: Delay sound from playing

(02-03-2015, 06:20 PM)Mudbill Wrote: Not quite there. Let's take a look:

PHP Code: (Select All)
void TimerFunction("PlaySound")
{
     
RunScript("PlaySoundAtEntity(string &in asTimer""insanity_imageflash01.snt""Player"1false);



Notice that in my example, I left the constructor (which is the line that starts with void) with the part you usually see on the engine scripts page. That's because that's how they must be. Don't edit that. If you see on the script page, it says callback syntax beneath AddTimer. Basically copy/paste that into your script (as long as the name matches).

I just did RunScript(); as an example. RunScript(); doesn't do anything, neither does it exist at the moment. This is where you want to put your own. Replace RunScript(); with whatever you want to run.

It should look more like this:

PHP Code: (Select All)
void TimerFunction(string &in asTimer)
{
     
PlaySoundAtEntity("""insanity_imageflash01.snt""Player"1false);


If you look closely at the wakeUp() script you have, it features a timer called beginStory().

Yes i noticed that. It works now. At first it played two times. Once at the beginning like before and at the timers que, but i removed it from void OnStart() and now it plays as it should. Thanks for you help. It's not that i want the more experienced to just hand the codes to paste in the script. I want to learn this, but it's really, really hard for me to grasp the logic of it. But i enjoy it at the same time. I guess i'll be back later for another problem, lol.
02-03-2015, 07:14 PM
Find


Messages In This Thread
Delay sound from playing - by LDOriginal - 02-03-2015, 03:55 PM
RE: Delay sound from playing - by Mudbill - 02-03-2015, 04:06 PM
RE: Delay sound from playing - by LDOriginal - 02-03-2015, 04:46 PM
RE: Delay sound from playing - by Mudbill - 02-03-2015, 06:20 PM
RE: Delay sound from playing - by LDOriginal - 02-03-2015, 07:14 PM
RE: Delay sound from playing - by LDOriginal - 02-04-2015, 11:50 PM



Users browsing this thread: 1 Guest(s)