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 Levers!
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#8
RE: Levers!

For starters, the callback syntax doesn't include bool abEffects. Secondly, try not to make a new callbacks for the same puzzle. You can handle it all in one function. Thirdly, if you want things to happen only under certain conditions, don't place things outside of conditional statements. You had SetLeverStuckState and SetWheelStuckState outside of if statements. Fourth, when defining a string parameter, the ampersand should have either in, out, or inout directly following it. In most cases, &in is what should be used.

Finally,
PHP Code: (Select All)
void OnStart()
{
    
SetEntityConnectionStateChangeCallback("lever1""Stuck");
    
SetEntityConnectionStateChangeCallback("lever2""Stuck");
    
SetEntityConnectionStateChangeCallback("crank1""Stuck");
}

void Stuck(string &in asNameint alState)
{
    if (
asName == "crank1")
    {
        if(
alState == 1){
            
SetWheelStuckState("crank1"1true);
            
PlaySoundAtEntity("""explosion_rock_large.snt""soundrock"0false);
        }
    }
    
    else if (
asName == "lever1")
    {
        if(
alState == 1){
            
SetLeverStuckState("lever1"1true);
            
SetLeverStuckState("lever2"0true);
        }
    }
    
    else if (
asName == "lever2")
    {
        if(
alState == 1){
            
SetLeverStuckState("lever2"1true);
            
SetWheelStuckState("crank1"0true);
        }
    }


For player body force, search here: http://wiki.frictionalgames.com/hpl2/amn...ons#player

Tutorials: From Noob to Pro
02-14-2012, 01:13 PM
Website Find


Messages In This Thread
Levers! - by Alento - 02-13-2012, 11:50 PM
RE: Levers! - by Your Computer - 02-14-2012, 12:00 AM
RE: Levers! - by Alento - 02-14-2012, 12:04 AM
RE: Levers! - by Your Computer - 02-14-2012, 12:16 AM
RE: Levers! - by Alento - 02-14-2012, 12:25 AM
RE: Levers! - by Your Computer - 02-14-2012, 12:28 AM
RE: Levers! - by Alento - 02-14-2012, 11:30 AM
RE: Levers! - by Your Computer - 02-14-2012, 01:13 PM
RE: Levers! - by Alento - 02-14-2012, 09:25 PM
RE: Levers! - by Your Computer - 02-14-2012, 09:33 PM
RE: Levers! - by Alento - 02-14-2012, 09:42 PM
RE: Levers! - by Your Computer - 02-14-2012, 09:44 PM
RE: Levers! - by Alento - 02-14-2012, 09:53 PM



Users browsing this thread: 1 Guest(s)