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
Script Error 4.0
GoranGaming Offline
Member

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

Can anyone tell my why this script doesn't work, when I have all the levers in the right position, nothing happens!



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

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

AddDebugMessage("Lever 1 is in the right position", false);
AddLocalVarInt("Levers", 1);

}else{

AddDebugMessage("Lever 1 is in the wrong position", false);
}


}

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

AddDebugMessage("Lever 2 is in the right position", false);
AddLocalVarInt("Levers", 1);
}else{

AddDebugMessage("Lever 2 is in the wrong position", false);

}
}

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

AddDebugMessage("Lever 3 is in the right position", false);
AddLocalVarInt("Levers", 1);
}else{

AddDebugMessage("Lever 3 is in the wrong position", false);

}
}

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

AddDebugMessage("Lever 4 is in the right position", false);
AddLocalVarInt("Levers", 1);

}else{

AddDebugMessage("Lever 4 is in the wrong position", false);

}
}

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

AddDebugMessage("Lever 5 is in the right position", false);
AddLocalVarInt("Levers", 1);

}else{

AddDebugMessage("Lever 5 is in the wrong position", false);

}
}

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

AddDebugMessage("Lever 6 is in the right position", false);
AddLocalVarInt("Levers", 1);


}else{

AddDebugMessage("Lever 6 is in the wrong position", false);

}
}

/*void StartMachine(string &in asEntity)
{
if(GetLocalVarInt("Levers") == 6){

AddDebugMessage("SUCCES", false);

}else{

}


}*/

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");

if(GetLocalVarInt("Levers") == 6){

AddDebugMessage("SUCCES", false);

}else{

AddDebugMessage("The levers aren't in the right positions", false);

}


if(ScriptDebugOn())
{
GiveItemFromFile("lantern", "lantern.ent");
for(int i=0;i<10;i++){
GiveItemFromFile("tinderbox_"+i, "tinderbox.ent");
}
}

}

void OnEnter()
{

}

void OnLeave()
{

}

A made a video showing the script in action: http://www.youtube.com/watch?v=-6FFj-w3t...e=youtu.be

Current projects:

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

Unnamed Project 7 %
(This post was last modified: 06-23-2012, 04:35 PM by GoranGaming.)
06-20-2012, 09:59 PM
Website Find


Messages In This Thread
Script Error 4.0 - by GoranGaming - 06-20-2012, 09:59 PM
RE: Script Error 4.0 - by Cruzore - 06-20-2012, 10:07 PM
RE: Script Error 4.0 - by GoranGaming - 06-20-2012, 10:14 PM
RE: Script Error 4.0 - by Cruzore - 06-20-2012, 10:16 PM
RE: Script Error 4.0 - by GoranGaming - 06-20-2012, 10:20 PM
RE: Script Error 4.0 - by Cruzore - 06-20-2012, 10:20 PM
RE: Script Error 4.0 - by GoranGaming - 06-20-2012, 10:22 PM
RE: Script Error 4.0 - by GoranGaming - 06-23-2012, 12:11 PM
RE: Script Error 4.0 - by Cruzore - 06-23-2012, 12:44 PM
RE: Script Error 4.0 - by GoranGaming - 06-23-2012, 01:18 PM
RE: Script Error 4.0 - by Cruzore - 06-23-2012, 01:24 PM
RE: Script Error 4.0 - by GoranGaming - 06-23-2012, 01:33 PM
RE: Script Error 4.0 - by Cruzore - 06-23-2012, 02:02 PM
RE: Script Error 4.0 - by GoranGaming - 06-23-2012, 02:11 PM
RE: Script Error 4.0 - by Cruzore - 06-23-2012, 02:24 PM



Users browsing this thread: 1 Guest(s)