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
Script Help What is causing this? [BUG]
Radical Batz Offline
Posting Freak

Posts: 953
Threads: 145
Joined: Dec 2013
Reputation: 25
#1
What is causing this? [BUG]

So I have this crank on the wall which you can use a hammer to make it get fixed.

After that the player turns the crank and the ladder goes down, now there's this bug that is happening to me. 1st when I touch the stuck crank the ladder goes down already without doing anything 2. is that when the hammer hits it, the ladder quickly goes down, I want the player to be able to turn the crank before the ladder goes down not just hit the crank with the hammer and the ladder goes down quickly!

I'm not sure if I missed anything or if it's a bug but yeah here is the script that I'm using

PHP Code: (Select All)
InteractConnectPropWithMoveObject("ladderwithcrank""Crank""LadderPuzzle"truefalse0); 

PHP Code: (Select All)
void InteractCrank(string &in asEntity)
{
    
AddQuest("TouchCrank""TouchCrank");
}

void Test1(string &in asItemstring &in asEntity)
{
    
SetPlayerActive(false);
    
SetEntityActive("stone_hammer_move_1"true);
    
    
SetMoveObjectState("stone_hammer_move_1"0.25f);
    
SetEntityInteractionDisabled("Crank"true);
    
    
AddTimer("1"0.2f"TimerHammer");
    
AddTimer("2"0.6f"TimerHammer");
    
AddTimer("3"0.8f"TimerHammer");
    
AddTimer("4"1.2f"TimerHammer");
    
AddTimer("5"1.4f"TimerHammer");
}

void TimerHammer(string &in asTimer)
{
    if(
asTimer == "1"){
        
PlaySoundAtEntity("bang""impact_wood_med""Player"0false);
        
CreateParticleSystemAtEntity("""ps_hit_wood.ps""Crank"false);
        
SetMoveObjectState("stone_hammer_move_1"0.0f);
    }
    if(
asTimer == "2"){
        
SetMoveObjectState("stone_hammer_move_1"0.25f);
    }
    if(
asTimer == "3"){
        
SetMoveObjectState("stone_hammer_move_1"0.0f);
        
CreateParticleSystemAtEntity("""ps_hit_wood.ps""Crank"false);
        
PlaySoundAtEntity("bang""impact_wood_med""Player"0false);
    }
    if(
asTimer == "4"){
        
SetMoveObjectState("stone_hammer_move_1"0.25f);
    }
    if(
asTimer == "5"){
        
SetEntityActive("stone_hammer_move_1"false);
        
PlaySoundAtEntity("bang""impact_rock_high""Player"0false);
        
CreateParticleSystemAtEntity("""ps_hit_wood.ps""Crank"false);
        
CompleteQuest("TouchCrank""TouchCrank");
        
        
GiveSanityBoostSmall();
        
SetWheelStuckState("Crank"0true);
        
SetEntityInteractionDisabled("Crank"false);
        
SetPlayerActive(true);
        
PlayMusic("23_puzzle.ogg"false0.7f0.5f9false);
        
SetInventoryDisabled(true); //This is so the music doesnt drag on by having this up
        
AddTimer("music"4.0f"TimerMusic");
        
AddTimer("inventory"6.0f"TimerMusic");
    }
}

void TimerMusic(string &in asTimer)
{
    if(
asTimer == "music"){
        
StopMusic(4.0f9);
        return;
    }
    
    
SetInventoryDisabled(false);
}

//If ladder if in this area, turn off ladder area. Else, allow player to climb it
void CollideCheckLadder(string &in asParentstring &in asChildint alState)
{
 if(
alState == -1){
  
SetEntityActive("LadderArea_1"true);
 }
 
 if(
alState == 1){
  
SetEntityActive("LadderArea_1"false);
 }
}

void CollideAreaLook(string &in asParentstring &in asChildint alState)
{
    
StartPlayerLookAt("LadderPuzzle"1.01.0"Function");
    
AddTimer("LaderPuzzle"4"Function");
}

void Function(string &in asTimer)
{
    
StopPlayerLookAt();
    
}

void TimerAreaStep(string &in asTimer)
{
    
int iRand RandInt(12);

    
PlaySoundAtEntity(asTimer+iRand"scare_wood_creak_scuf.snt"asTimer+iRand1false);

    
SetRadialBlurStartDist(0.8f);
    
FadeRadialBlurTo(0.1f0.03f);

    
AddTimer("EndRadial"4.0f"TimerEndRadial");
    
AddTimer(asTimerRandFloat(15.0f30.0f), "TimerAreaStep");


Do you think there is something that is causing this problem? :/

(This post was last modified: 03-16-2014, 01:12 AM by Radical Batz.)
03-16-2014, 01:09 AM
Find




Users browsing this thread: 1 Guest(s)