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
Variable not setting
Damascus Offline
Senior Member

Posts: 646
Threads: 118
Joined: Mar 2012
Reputation: 29
#1
Variable not setting

This stupid puzzle is still giving me a headache. I've set up a crank that raises a weight (as stated in an older thread), and when you wind it up, it is supposed to become stuck and set a variable. In the RaiseWeight function, everything works except for apparently the variable becoming one.

After I raise the weight, the light comes on and it becomes stuck, but when i go over to test the lever, it keeps playing the "notwound" message and does not become stuck.

PHP Code: (Select All)
void OnStart()
{
    
SetEntityConnectionStateChangeCallback("lever_simple01_2""Lever2");
    
SetEntityConnectionStateChangeCallback("crank_iron_1""RaiseWeight");
}

void RaiseWeight(string &in asEntityint alState)
{
    if (
alState == 1)
    {
        
SetWheelStuckState("crank_iron_1"1true);
        
PlaySoundAtEntity("""fizzle""light_electric_1"0.0ffalse);
        
SetLampLit("light_electric_1"truetrue);
        
SetGlobalVarInt("WeightRaised"1);
    }
}

void Lever2(string &in asEntityint alState)
{
    if (
alState == 1)
    {
        if (
GetLocalVarInt("WeightRaised") == 1)
        {
            
SetLocalVarInt("PistonLevers"1);
            
PlaySoundAtEntity("""lever_mech_min_max""lever_simple01_2"0.0ffalse);
            
SetLeverStuckState("lever_simple01_2"1true);
            
AddTimer("WatchDisappear"RandFloat(10.0f30.0f), "WatchDisappear"); 
        }
        else
        {
            
SetMessage("Ch03Misc""notwound"0);
        }
    }


(This post was last modified: 06-18-2012, 09:14 PM by Damascus.)
06-18-2012, 08:18 PM
Find


Messages In This Thread
Variable not setting - by Damascus - 06-18-2012, 08:18 PM
RE: Variable not setting - by palistov - 06-18-2012, 08:24 PM
RE: Variable not setting - by Damascus - 06-18-2012, 09:13 PM
RE: Variable not setting - by palistov - 06-18-2012, 10:37 PM



Users browsing this thread: 1 Guest(s)