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
How i can reload script area when i die ? And how to create loopable sounds ?
rakakak11 Offline
Junior Member

Posts: 20
Threads: 3
Joined: Jul 2012
Reputation: 0
#10
RE: How i can reload script area when i die ? And how to create loopable sounds ?

(07-31-2012, 11:16 PM)andyrockin123 Wrote: PlaySoundAtEntity uses .snt files, not .ogg files (at least not directly). You're probably better off using random integers to generate a random time to play, as well as a random sound. Try using this instead:


void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "Zavalenie", true, 1);
}

void Zavalenie(string &in asParent, string &in asChild, int alState)
{
PlayGuiSound("explosion_rock_large.ogg", 0.8f);
StopMusic( 0, 50);
SetEntityActive("kamen1", true);
SetEntityActive("zombik", false);
StartScreenShake(0.5f, 1, 1, 0);

AddTimer("", RandInt(30, 60), "ambients");
AddTimer("", RandInt(30, 60), "ambients2");
}

void ambients(string &in asTimer)
{
PlaySoundAtEntity("", "scare_male_terrified"+RandInt(1, 3), "Player", 0.5f, false);
AddTimer("", RandInt(30, 60), "ambients");
}
void ambients2(string &in asTimer)
{
PlaySoundAtEntity("", "scare_wall_stomp", "Player", 0.5f, false);
AddTimer("", RandInt(30, 60), "ambients2");
}

This script will randomly choose a time between 30 and 60 seconds to play a random noise at.

Hope that helped!
This is what im looking for !!! Heart

Sound now work but the "scare_male_terrified" didnt work... i deleted this "scare_male_terrified"
+RandInt(1, 3) and now "scare_male_terrified" sound work ! Big Grin Im again really grateful for help.

But what is this thing that i deleted ? "+RandInt(1, 3)"
08-01-2012, 12:25 AM
Find


Messages In This Thread
RE: How i can reload script area when i die ? And how to create loopable sounds ? - by rakakak11 - 08-01-2012, 12:25 AM



Users browsing this thread: 2 Guest(s)