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
Boolean??!! Syntax help?
Nuclearbones Offline
Junior Member

Posts: 45
Threads: 19
Joined: May 2012
Reputation: 0
#1
Boolean??!! Syntax help?

I'm in a major predicament because I can't load this map. I'm not sure what's wrong with the script and I don't see anything wrong with it. I'm not sure what it is, maybe it's a syntax error or something, but all the way down to the red text...

////////////////////////////
// Run first time starting map
void OnStart()
{
//Valves
SetEntityConnectionStateChangeCallback("valve_iron_1", "Unlock1");
SetEntityConnectionStateChangeCallback("valve_iron_2", "Unlock2");
SetEntityConnectionStateChangeCallback("valve_iron_3", "Unlock3");

//Levers
SetEntityConnectionStateChangeCallback("lever_simple01_22", "OpenSecurityGate");
ConnectEntities("", "castle_portcullis_1", "lever_simple01_23", false, 1, "CloseGate");

}

void Unlock1(string &in asEntity, int alstate)
{
if (alstate == 1)
{
PlaySoundAtEntity("", "15_body_impact.snt", "Player", 0.0f, false);
SetWheelStuckState(asEntity, 1, true);
AddLocalVarInt("var_1", 1);
GET();
}


}

void Unlock2(string &in asEntity, int alstate)
{
if (alstate == -1)
{
PlaySoundAtEntity("", "15_body_impact.snt", "Player", 0.0f, false);
SetWheelStuckState(asEntity, 1, true);
AddLocalVarInt("var_1", 1);
GET();
}
}

void Unlock3(string &in asEntity, int alstate)
{
if (alstate == -1)
{
PlaySoundAtEntity("", "15_body_impact.snt", "Player", 0.0f, false);
SetWheelStuckState(asEntity, 1, true);
AddLocalVarInt("var_1", 1);
GET();
}
}

void GET()
{
if (GetLocalVarInt("var_1")==3)
{
////OPENING THE GATE
PlaySoundAtEntity("", "24_bang.snt", "Player", 0.0f, false);
SetMoveObjectState("castle_portcullis_1", 1.0f);
}
}

////CLOSE THE GATE
void CloseGate(string &in asConnectionName, string &in asMainEntity, string &in asConnectEntity, int alState)
{
if (alstate == 1)
<--- "alstate not declared" and "Expression must be of Boolean type".
{
PlaySoundAtEntity("", "24_bang.snt", "Player", 0.0f, false);
SetMoveObjectState("castle_portcullis_1)", 0.00f);
}
}

////OPEN SECURITY GATE
void OpenSecurityGate(string &in asEntity, int level_state)
{
if (level_state == 1)
{
SetMoveObjectState("safety_normal_vert_1", 1.0f);
}
}

////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}

The alstate message is what threw me off the most. But the Boolean message??!! I'm dealing with levers, I need integers not Boolean values!

I would appreciate it if somebody helped look through the script and see if there is anything that would trigger these messages to appear. Thanks.
(This post was last modified: 11-11-2012, 04:31 AM by Nuclearbones.)
11-11-2012, 03:34 AM
Find


Messages In This Thread
Boolean??!! Syntax help? - by Nuclearbones - 11-11-2012, 03:34 AM
RE: Boolean??!! - by Obsidiaguy - 11-11-2012, 04:34 AM
RE: Boolean??!! Syntax help? - by Nuclearbones - 11-11-2012, 04:43 AM
RE: Boolean??!! Syntax help? - by palistov - 11-11-2012, 09:32 PM



Users browsing this thread: 1 Guest(s)