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 Error 4.0
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#11
RE: Script Error 4.0

Woops, you have to use
if(GetLocalVarInt("Lever1") == 1 && GetLocalVarInt("Lever2") == 1 && GetLocalVarInt("Lever3") == 1 && GetLocalVarInt("Lever4") == 1 && GetLocalVarInt("Lever5") == 1 && GetLocalVarInt("Lever6") == 1)
06-23-2012, 01:24 PM
Find
GoranGaming Offline
Member

Posts: 183
Threads: 30
Joined: Feb 2012
Reputation: 7
#12
RE: Script Error 4.0

Still doesn't work Sad

/////////////////////
//BEGIN LEVER SCRIPT
/////////////////////

void PullLever1(string &in asEntity, int alState)
{
if(alState == 1){

AddDebugMessage("Lever 1 is in the right position", false);
SetLocalVarInt("Lever1", 1);
PlaySoundAtEntity("", "lever_mech_min_max", asEntity, 0.0f, false);

}else if(alState == 0){


SetLocalVarInt("Lever1", 0);
AddDebugMessage("Lever 1 is in the wrong position", false);

}else if(alState == -1){
PlaySoundAtEntity("", "lever_mech_min_max", asEntity, 0.0f, false);
AddDebugMessage("Lever 1 is in the wrong position", false);
SetLocalVarInt("Lever1", 0);
}

if(GetLocalVarInt("Lever1") == 1 && GetLocalVarInt("Lever2") == 1 && GetLocalVarInt("Lever3") == 1 && GetLocalVarInt("Lever4") == 1 && GetLocalVarInt("Lever5") == 1 && GetLocalVarInt("Lever6") == 1){

}
}

void PullLever2(string &in asEntity, int alState)
{
if(alState == -1){
PlaySoundAtEntity("", "lever_mech_min_max", asEntity, 0.0f, false);
AddDebugMessage("Lever 2 is in the right position", false);
SetLocalVarInt("Lever2", 1);

}else if(alState == 0){

AddDebugMessage("Lever 2 is in the wrong position", false);
SetLocalVarInt("Lever2", 0);
}else if(alState == 1){
SetLocalVarInt("Lever2", 0);
PlaySoundAtEntity("", "lever_mech_min_max", asEntity, 0.0f, false);
}
if(GetLocalVarInt("Lever1") == 1 && GetLocalVarInt("Lever2") == 1 && GetLocalVarInt("Lever3") == 1 && GetLocalVarInt("Lever4") == 1 && GetLocalVarInt("Lever5") == 1 && GetLocalVarInt("Lever6") == 1){

}

}

void PullLever3(string &in asEntity, int alState)
{
if(alState == -1){
PlaySoundAtEntity("", "lever_mech_min_max", asEntity, 0.0f, false);
AddDebugMessage("Lever 3 is in the right position", false);
SetLocalVarInt("Lever3", 1);
}else if(alState == 0){

AddDebugMessage("Lever 3 is in the wrong position", false);
SetLocalVarInt("Lever3", 0);
}else if(alState == 1){
SetLocalVarInt("Lever3", 0);
PlaySoundAtEntity("", "lever_mech_min_max", asEntity, 0.0f, false);
}
if(GetLocalVarInt("Lever1") == 1 && GetLocalVarInt("Lever2") == 1 && GetLocalVarInt("Lever3") == 1 && GetLocalVarInt("Lever4") == 1 && GetLocalVarInt("Lever5") == 1 && GetLocalVarInt("Lever6") == 1){

}

}

void PullLever4(string &in asEntity, int alState)
{
if(alState == 1){
PlaySoundAtEntity("", "lever_mech_min_max", asEntity, 0.0f, false);
AddDebugMessage("Lever 4 is in the right position", false);
SetLocalVarInt("Lever4", 1);

}else if(alState == 0){

AddDebugMessage("Lever 4 is in the wrong position", false);
SetLocalVarInt("Lever4", 0);
}else if(alState == -1){
SetLocalVarInt("Lever4", 0);
PlaySoundAtEntity("", "lever_mech_min_max", asEntity, 0.0f, false);
}

if(GetLocalVarInt("Lever1") == 1 && GetLocalVarInt("Lever2") == 1 && GetLocalVarInt("Lever3") == 1 && GetLocalVarInt("Lever4") == 1 && GetLocalVarInt("Lever5") == 1 && GetLocalVarInt("Lever6") == 1){

}
}

void PullLever5(string &in asEntity, int alState)
{
if(alState == 1){
PlaySoundAtEntity("", "lever_mech_min_max", asEntity, 0.0f, false);
AddDebugMessage("Lever 5 is in the right position", false);
SetLocalVarInt("Lever5", 1);

}else if(alState == 0){


AddDebugMessage("Lever 5 is in the wrong position", false);
SetLocalVarInt("Lever5", 0);
}else if(alState == -1){
SetLocalVarInt("Lever5", 0);
PlaySoundAtEntity("", "lever_mech_min_max", asEntity, 0.0f, false);
}
if(GetLocalVarInt("Lever1") == 1 && GetLocalVarInt("Lever2") == 1 && GetLocalVarInt("Lever3") == 1 && GetLocalVarInt("Lever4") == 1 && GetLocalVarInt("Lever5") == 1 && GetLocalVarInt("Lever6") == 1){

}

}

void PullLever6(string &in asEntity, int alState)
{
if(alState == -1){
PlaySoundAtEntity("", "lever_mech_min_max", asEntity, 0.0f, false);
AddDebugMessage("Lever 6 is in the right position", false);
SetLocalVarInt("Lever6", 1);


}else if(alState == 0){

AddDebugMessage("Lever 6 is in the wrong position", false);
SetLocalVarInt("Lever6", 0);
}else if(alState == 1){
SetLocalVarInt("Lever6", 0);
PlaySoundAtEntity("", "lever_mech_min_max", asEntity, 0.0f, false);
}

if(GetLocalVarInt("Lever1") == 1 && GetLocalVarInt("Lever2") == 1 && GetLocalVarInt("Lever3") == 1 && GetLocalVarInt("Lever4") == 1 && GetLocalVarInt("Lever5") == 1 && GetLocalVarInt("Lever6") == 1){

}
}
/////////////////////
//END LEVER SCRIPT
/////////////////////


void OnStart()
{
PlaySoundAtEntity("", "13_amb.ogg", "Player", 1.0f, false);

SetEntityConnectionStateChangeCallback("lever_machine_lever01", "PullLever1");
SetEntityConnectionStateChangeCallback("lever_machine_lever02", "PullLever2");
SetEntityConnectionStateChangeCallback("lever_machine_lever03", "PullLever3");
SetEntityConnectionStateChangeCallback("lever_machine_lever04", "PullLever4");
SetEntityConnectionStateChangeCallback("lever_machine_lever05", "PullLever5");
SetEntityConnectionStateChangeCallback("lever_machine_lever06", "PullLever6");

SetLocalVarInt("Lever1", 0);
SetLocalVarInt("Lever2", 0);
SetLocalVarInt("Lever3", 0);
SetLocalVarInt("Lever4", 0);
SetLocalVarInt("Lever5", 0);
SetLocalVarInt("Lever6", 0);
}

Current projects:

The Dark Prison 85 % (Stopped working on this one)

Unnamed Project 7 %
06-23-2012, 01:33 PM
Website Find
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#13
RE: Script Error 4.0

Idk then, maybe someone else knows it here.
06-23-2012, 02:02 PM
Find
GoranGaming Offline
Member

Posts: 183
Threads: 30
Joined: Feb 2012
Reputation: 7
#14
RE: Script Error 4.0

Wait, am I stupid, there is nothing inside the function that checks if all levers are correct xD

Yes, that was the problem xD

Current projects:

The Dark Prison 85 % (Stopped working on this one)

Unnamed Project 7 %
(This post was last modified: 06-23-2012, 02:12 PM by GoranGaming.)
06-23-2012, 02:11 PM
Website Find
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#15
RE: Script Error 4.0

Good to know it worked, for future puzzles Big Grin
06-23-2012, 02:24 PM
Find




Users browsing this thread: 2 Guest(s)