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
Sound and Particles Looping
Wolpertenn Offline
Junior Member

Posts: 2
Threads: 1
Joined: Jul 2012
Reputation: 0
#1
Sound and Particles Looping

Hello,

So I was working on my custom story when I decided upon making a function. In the script I have a callback for when the player enters an area (ScriptArea_1) and the function is called to make the player look at an object (hatch_ceiling_1) and it then calls multiple timers. However, all the timers are malfunctioning in that they make the sounds and particle effects loop. Here's an example:




Here is the scripting:

void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "Look_splash", true, 1);
}
//Watermonster introduction
void Look_splash(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("hatch_ceiling_1", 5, 5, "SplashTimers");
}
void SplashTimers()
{
AddTimer("", 0.5, "Splash_1");
AddTimer("", 5, "Splash_2");
AddTimer("", 10, "Splash_3");
}
void Splash_1(string &in asTimer)
{
CreateParticleSystemAtEntity("", "ps_impact_water_low.ps", "ScriptArea_splash", false);
CreateParticleSystemAtEntity("", "ptest_dust_falling.ps", "ScriptArea_splash", false);
PlaySoundAtEntity("", "react_pant.snt", "ScriptArea_splash", 0.5, false);
PlaySoundAtEntity("", "impact_water_med.snt", "ScriptArea_splash", 0.5, false);
AddTimer("", 5, "Splash_2");
}
void Splash_2(string &in asTimer)
{
CreateParticleSystemAtEntity("", "ps_impact_water_low.ps", "ScriptArea_splash", false);
CreateParticleSystemAtEntity("", "ptest_dust_falling.ps", "ScriptArea_splash", false);
PlaySoundAtEntity("", "water_lurker_attack_rev.snt", "ScriptArea_splash", 0.5, false);
PlaySoundAtEntity("", "impact_water_high.snt", "ScriptArea_splash", 0.5, false);
AddTimer("", 5, "Splash_3");
}
void Splash_3(string &in asTimer)
{
PlaySoundAtEntity("", "water_lurker_eat_rev.snt", "ScriptArea_splash", 0.5, false);
PlaySoundAtEntity("", "water_lurker_idle_rev.snt", "ScriptArea_splash", 0.5, false);
StopPlayerLookAt();
}


I'd appreciate any advice or solutions anyone has to offer. Thanks.

PS: If anyone requires pictures of the areas in the Level Editor, I'd be happy to post them.
EDIT: Fixed script (didn't have full script).
(This post was last modified: 07-07-2012, 09:54 PM by Wolpertenn.)
07-07-2012, 09:09 PM
Find


Messages In This Thread
Sound and Particles Looping - by Wolpertenn - 07-07-2012, 09:09 PM
RE: Sound and Particles Looping - by Steve - 07-07-2012, 09:28 PM
RE: Sound and Particles Looping - by Adny - 07-07-2012, 09:34 PM
RE: Sound and Particles Looping - by Wolpertenn - 07-07-2012, 09:53 PM



Users browsing this thread: 1 Guest(s)