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.)
|