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
[Solved]Case Timer only works when opening the level by itself
Radical Batz Offline
Posting Freak

Posts: 953
Threads: 145
Joined: Dec 2013
Reputation: 25
#1
Shocked  [Solved]Case Timer only works when opening the level by itself

I have this casetimer that will start running by an addtimer from a function which looks something like this

PHP Code: (Select All)
void lockdoor(string &in asParentstring &in asChildint alState)
{
    
StartScreenShake(0.01f0.5f0.5f1.0f);
    
SetEntityActive("lockdoor"false);
    
PlayGuiSound("scare_slam_door.snt"0.7f);
    
AddPropForce("cellar_wood01_4"00, -50000"world");
    
AddTimer(""0.4"lockit");
}

void lockit(string &in asTimer)
{
    
float fEventSpeed=0;
    
AddLocalVarInt("TimerEvent"1);
    switch(
GetLocalVarInt("TimerEvent"))
    {
        
        case 
1:
                
SetSwingDoorLocked("cellar_wood01_4"truefalse);
                
PlayGuiSound("lock_door"1.6);
                
SetEntityActive("male_arm_1"false);
                
fEventSpeed 3.0f;
                break;
        
        case 
2:
                
PlayGuiSound("amb_hunt04.ogg"1.6);
                
PlayMusic("att_grunt"true151true);
                
SetPlayerRunSpeedMul(0.5f);
                
SetPlayerMoveSpeedMul(0.5f);
                
fEventSpeed 2.0f;
                break;
        
        case 
3:
                
StartScreenShake(0.1f0.5f0.1f,0.3f);
                
AddPropImpulse("cellar_wood01_4"00, -10"World");
            
PlaySoundAtEntity("""21_bang_door""cellar_wood01_4"0.25ffalse);
            
CreateParticleSystemAtEntity("bang1""ps_dust_impact_vert.ps""cellar_wood01_4"false);
                
fEventSpeed 3.0f;
                break;
        
        case 
4:
                
StartScreenShake(0.1f0.5f0.1f,0.3f);
                
AddPropImpulse("cellar_wood01_4"00, -10"World");
            
PlaySoundAtEntity("""21_bang_door""cellar_wood01_4"0.25ffalse);
            
CreateParticleSystemAtEntity("bang1""ps_dust_impact_vert.ps""cellar_wood01_4"false);
                
fEventSpeed 0.6f;
                break;
        
        case 
5:
                
AddEffectVoice("voices""Ch01L09.ogg""Voice""HolyGesus",
                
false"EventDoor"11);
                
SetEntityActive("corpse_male_arm_1"true);
                
StartPlayerLookAt("corpse_male_arm_1"104"");
                
fEventSpeed 1.0f;
                break;
        
        case 
6:
                
AddEffectVoice("voices""Ch01L08.ogg""Voice""HolyGesus",
                
false"EventDoor"11);
                
StopPlayerLookAt();
                
fEventSpeed 2.0f;
                break;
        
        case 
7:
                
PlayGuiSound("react_breath"0.7f);
                
fEventSpeed 2.0f;
                break;
            }
        
        if(
GetLocalVarInt("TimerEvent") <7AddTimer("TimerEvent",fEventSpeed"lockit");


The problem is as I said, the case timer doesnt work when entering this level from another level from a lever door.
it only starts working when loading this level from start or by the debug menu. Again, the lockdoor function works when colliding with an area but the case timer doesn't want to, doesnt function when entering this level from another level

Any ideas pls? I have no idea what the hell is causing this and never happened to me before Huh

Nevermind guys, it has been fixed by DnAlange!
It was such an easy fix lol yet so frustrating xD

(This post was last modified: 05-11-2015, 07:54 PM by Radical Batz.)
05-11-2015, 07:01 PM
Find


Messages In This Thread
[Solved]Case Timer only works when opening the level by itself - by Radical Batz - 05-11-2015, 07:01 PM



Users browsing this thread: 1 Guest(s)