The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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
Looping a sound til player exit level
Hauken Offline
Member

Posts: 62
Threads: 19
Joined: Jul 2012
Reputation: 1
#1
Looping a sound til player exit level

Hi, im trying to create some athmosphere regarding sound, this is what i want:

The player walks into an area trigger and activates the sound, it plays at once, then 10 seconds after it plays again and again til the player leaves the level.

From my perspective:

Onstart calls a function that tells void func sound that we're gonna loop this but the function says - not until the player walks in my area but when he do i will call the next function which plays a sound, the onstart code says we're gonna play the sound after 10 seconds again.

---

As it is now the game doesnt crash but it doesnt work either, I've followed the "For" Loop tutorial in the wiki.

What's wrong here?

Also I want to mention this is the first time I'm using loop commands.

PHP Code: (Select All)
void OnStart()
{
    
//Looping athmosperhic sound
    
{      
        for(
int i 0<4i++)
        
AddTimer("S1" i10 i"func_sound");   
    }
}

void func_sound (string &in asParentstring &in asChildint alState)

{
AddEntityCollideCallback("Player""sound_scare""func_sound"true1); 
}

void func_sound(string &in asTimer)

{
string x asTimer;
    if (
== "S1")
    {
        
PlayGuiSound("door_level_cistern_open.snt"0.5);
    } 

(This post was last modified: 07-19-2013, 08:01 PM by Hauken.)
07-19-2013, 07:59 PM
Find


Messages In This Thread
Looping a sound til player exit level - by Hauken - 07-19-2013, 07:59 PM



Users browsing this thread: 1 Guest(s)