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
Machine Lever Problem...
GreyFox Offline
Member

Posts: 162
Threads: 23
Joined: Jul 2011
Reputation: 2
#3
RE: Machine Lever Problem...

Not sure if I set up correctly, but I didn't change anything just tryed to sort it out.

Hopefully you can help him now falmez3

void OnStart()
{

}

void Levers(string &in asEntity, int alState)
{  
    /*Set values depending on up/down postion or 0 for middle     */    if(alState == -1)    
    if(asEntity == "L1") SetLocalVarInt("up_"+asEntity, 3);        
     else if(asEntity == "L2") SetLocalVarInt("up_"+asEntity, 3);  
     else if(asEntity == "L3") SetLocalVarInt("up_"+asEntity, 5);        
     else if(asEntity == "L4") SetLocalVarInt("up_"+asEntity, 1);        
     else if(asEntity == "L5") SetLocalVarInt("up_"+asEntity, 2);        
     else if(asEntity == "L6") SetLocalVarInt("up_"+asEntity, 4);                
     CheckValue(asEntity);            
}    

else if(alState == 1)
{    
    if(asEntity == "L1") SetLocalVarInt("down_"+asEntity, 1);        
    else if(asEntity == "L2") SetLocalVarInt("down_"+asEntity, 5);        
     else if(asEntity == "L3") SetLocalVarInt("down_"+asEntity, 6);        
     else if(asEntity == "L4") SetLocalVarInt("down_"+asEntity, 5);        
     else if(asEntity == "L5") SetLocalVarInt("down_"+asEntity, 2);        
     else if(asEntity == "L6") SetLocalVarInt("down_"+asEntity, 2);                
     CheckValue(asEntity);    
}            

else if(alState == 0)
{    
    SetLocalVarInt("up_"+asEntity, 0);        
    SetLocalVarInt("down_"+asEntity, 0);        
}            
if(GetLocalVarInt("up_value") == 11 && GetLocalVarInt("down_value") == 8)
{    
    SetEntityActive("ShardDoor", false);        
    GiveSanityBoost();        
    PlayMusic("02_puzzle.ogg", false, 0.7f, 0, 10, false);        
    PlaySoundAtEntity("door_safety_open", "door_safety_open.snt", "Player", 0.0f, false);        
}
void CheckValue(string sEntity)
{    
    PlaySoundAtEntity("s"+sEntity, "lever_mech_min_max", sEntity, 0.0f, false);
    SetLocalVarInt("up_value", 0);    
    SetLocalVarInt("down_value", 0);            
    for(int i=1;i<=6;i++)
{        
    AddLocalVarInt("up_value", GetLocalVarInt("up_L"+i));        
    AddLocalVarInt("down_value", GetLocalVarInt("down_L"+i));    }
}

void OnEnter()
{    
    PlayMusic("18_amb.ogg", true, 1, 2.0f, 0, false);    
}
void OnLeave()
{    
    StopMusic(2,0);
}


Current Project
Forgotten
11-30-2011, 03:55 AM
Find


Messages In This Thread
Machine Lever Problem... - by sasukeroxxx - 11-29-2011, 11:57 PM
RE: Machine Lever Problem... - by flamez3 - 11-30-2011, 01:56 AM
RE: Machine Lever Problem... - by GreyFox - 11-30-2011, 03:55 AM
RE: Machine Lever Problem... - by flamez3 - 11-30-2011, 04:44 AM
RE: Machine Lever Problem... - by sasukeroxxx - 12-05-2011, 08:48 PM
RE: Machine Lever Problem... - by flamez3 - 12-06-2011, 03:49 AM
RE: Machine Lever Problem... - by Your Computer - 12-06-2011, 04:29 AM
RE: Machine Lever Problem... - by sasukeroxxx - 12-07-2011, 04:42 AM



Users browsing this thread: 1 Guest(s)