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


Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scripting noob, help needed!
willochill Offline
Member

Posts: 73
Threads: 27
Joined: Apr 2011
Reputation: 0
#5
RE: Scripting noob, help needed!

Okay, so first of all, this was great, problem was the sound of the saw didn't stop, so this is how I changed the script:
void OnStart()
{
AddUseItemCallback("", "bone_saw_2", "wooden_boards_block_1", "SawGruntAlert", true);
}
void SawGruntAlert(string &in asItem, string &in asEntity)
{
SetEntityActive("wooden_boards_block_1", false);
SetEntityActive("wooden_boards_block_broken_1", true);
PlaySoundAtEntity("", "23_saw2.snt", "Player", 0, false);
AddTimer("", 1, "TimerFunc");
AddTimer("StopSoundTimer", 1, "TimerFunc2");
}
void TimerFunc(string &in asTimer)
{
SetEntityActive("servant_grunt_1", true);
}
void TimerFunc2(string &in asTimer)
{
StopSound("23_saw2.snt", 0);
}

But it didn't do anything.
Second, I wanted to start an ambience sound file playing from the beginning of the map so this is what I added:
void OnStart()
{
FadeInSound("amb_guardian.snt", 0, abPlayStart);
}
{
AddUseItemCallback("", "bone_saw_2", "wooden_boards_block_1", "SawGruntAlert", true);
}
void SawGruntAlert(string &in asItem, string &in asEntity)
{
SetEntityActive("wooden_boards_block_1", false);
SetEntityActive("wooden_boards_block_broken_1", true);
PlaySoundAtEntity("", "23_saw2.snt", "Player", 0, false);
AddTimer("", 1, "TimerFunc");
AddTimer("StopSoundTimer", 1, "TimerFunc2");
}
void TimerFunc(string &in asTimer)
{
SetEntityActive("servant_grunt_1", true);
}
void TimerFunc2(string &in asTimer)
{
StopSound("23_saw2.snt", 0);
}
Once i add the fade in sound the map crashes.

Third of all although I don't want to learn how to do it all could you post whatever script you would need to make the sawing animation with the sound? that would be a lot cooler than just what it is now. thx.

05-26-2011, 04:19 AM
Find


Messages In This Thread
Scripting noob, help needed! - by willochill - 05-22-2011, 04:45 AM
RE: Scripting noob, help needed! - by Kyle - 05-22-2011, 12:15 PM
RE: Scripting noob, help needed! - by Karai16 - 05-22-2011, 02:16 PM
RE: Scripting noob, help needed! - by Kyle - 05-22-2011, 02:26 PM
RE: Scripting noob, help needed! - by willochill - 05-26-2011, 04:19 AM



Users browsing this thread: 1 Guest(s)