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
Sequencing Events and Timers
rybray Offline
Junior Member

Posts: 31
Threads: 9
Joined: Aug 2011
Reputation: 1
#1
Sequencing Events and Timers

Trying to teach myself how to use timers. The tutorial from the wiki helped me with the set up, but I am getting errors on lines [11], [14], [15], [17], and [23]. I tried explaining what the lines did in my own terms with the // but they may be incorrect. There were two other questions I had:

-I have seen partSpeed and fEventSpeed used in regard to how long a part of a sequence will be, which is correct?
-How do you determine what goes in OnStart, and OnEnter, they seem very much the same to me. Thank you for your help.

void OnStart()
{
SetLocalVarInt("iIntro", 0); // sets timer sequence value to zero
}

void OnEnter()
{
AddTimer("IntroTimer", 1, "Intro"); //creates timer that begins in __ seconds
}

[11] void Intro(string &in asTimer)
{
AddLocalVarInt("iIntro", 1); //changes timer value from 0 to 1
[14] float fEventSpeed = 1f; //sets default time for parts: 1 second
[15] switch (GetLocalVarInt("iIntro")); //looks for value of timer
{
[17] case 1: //what it does if the value for iIntro is 1
fEventSpeed = 2f;
FadeIn(5);
PlaySoundAtEntity("", "scare_male_terrified.snt", "player", 3, false);
break;

[23] case 2: //if iIntro value is 2
fEventSpeed = .1f;
CreateParticleSystemAtEntity("", "ps_rose_petals_swirl.ps", "player", false);
break;
}

if (GetLocalVarInt("iIntro") <2) //if iIntro value is less than two,
{
AddTimer("IntroTimer", fEventSpeed, "Intro");
}
}

void OnLeave()
{

}
08-12-2011, 05:47 AM
Find


Messages In This Thread
Sequencing Events and Timers - by rybray - 08-12-2011, 05:47 AM
RE: Sequencing Events and Timers - by Juby - 08-12-2011, 12:25 PM
RE: Sequencing Events and Timers - by Khyrpa - 08-12-2011, 01:30 PM
RE: Sequencing Events and Timers - by rybray - 08-12-2011, 04:46 PM
RE: Sequencing Events and Timers - by Khyrpa - 08-12-2011, 08:08 PM



Users browsing this thread: 1 Guest(s)