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
Remove Timer Problem
RaideX Offline
Member

Posts: 212
Threads: 33
Joined: May 2013
Reputation: 7
#1
Remove Timer Problem

So basically i want to not go through certain parts of the script when the debug menu is turned on. My script looks like this:

PHP Code: (Select All)
void OnStart(){
    
    
AddTimer ("MainInit"0.1f"MainStart");
    
AddDebugMessage ("START"true);
    
    
//Script Debug Setup
    
if(ScriptDebugOn()){
        
GiveItemFromFile("lantern_pig""lantern_pig.ent");
        
RemoveTimer("MainStart");
        
AddDebugMessage ("Debug Activated!"true);
    }
    
    
//Collide Callbacks
    
AddEntityCollideCallback("Player""HatchOpen""HatchUnlock"true1);
}

void MainStart (string &in asTimer) {
        
FadeOut(0.1f);
        
AddTimer ("GameInit"10.0f"GameStart");
        
PlayGuiSound ("intro_pig_attack_temp.snt"1.0f);
    
}

void HatchUnlock (string &in asParentstring &in asChildint alState) {
        
SetSwingDoorClosed("attic_floor_ladderhatch_1"falsetrue);
        
AddDebugMessage("Hatch Unlocked!"true);
        
StartPlayerLookAt ("attic_floor_ladderhatch_1"10.0f50.0f"LookAtStop");
        
PlaySoundAtEntity ("HatchScare""react_scare.snt""Player"0.15ffalse);
        
StopSound ("Ambience01"0.0f);
}

void LookAtStop () {
        
StopPlayerLookAt();
}

void GameStart (string &in asTimer) {
        
PlaySoundAtEntity ("IntroScare""react_breath.snt""Player"0.1ffalse);
        
StartEffectFlash(0.1f1.0f0.2f);
        
FadeIn (0.1f);
        
AddTimer ("PianoInit"2.0f"PianoStart");
}

void PianoStart (string &in asTimer) {
        
PlaySoundAtEntity ("Ambience01""amb_mansion_gallery_piano_2D.snt""attic_floor_ladderhatch_1"1.0ftrue);


The important part is right at the start.
Maybe the game can't catch up (add and remove timers that fast) with that or i made a misstake that i can't find. Thanks in advance! :3

_________________

Welp i'm an idiot.

If you don't draw first, you don't get to draw at all... -The False Shepherd
(This post was last modified: 11-21-2013, 09:22 PM by RaideX.)
11-21-2013, 09:20 PM
Find


Messages In This Thread
Remove Timer Problem - by RaideX - 11-21-2013, 09:20 PM



Users browsing this thread: 1 Guest(s)