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 Help Why won't this script work?
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#2
RE: Why won't this script work?

Your syntax is all correct but your semantics is all out of whack. Semantics is basically programming "grammar", while syntax is programming "spelling". Your code is syntactically correct, but if you take a look at your function StoreCheckLeverState, you'll notice that no matter what lever is pulled, the variables are all set to the correct state. Hence, the player can pull any one lever and solve the puzzle. To solve this, use this function instead

PHP Code: (Select All)
void StoreCheckLeverState(string &in entityint state)
{
if(
entity == "lever_1"SetLocalVarInt("lever_1"state);
if(
entity == "lever_2"SetLocalVarInt("lever_2"state); 
if(
entity == "lever_3"SetLocalVarInt("lever_3"state); 
if(
entity == "lever_4"SetLocalVarInt("lever_4"state); 
if(
entity == "lever_5"SetLocalVarInt("lever_5"state); 
if(
entity == "lever_6"SetLocalVarInt("lever_6"state);
CheckLeverStates(); 


Good luck Smile

(This post was last modified: 12-17-2011, 05:18 PM by palistov.)
12-17-2011, 05:18 PM
Find


Messages In This Thread
Why won't this script work? - by ferryadams10 - 12-17-2011, 04:29 PM
RE: Why won't this script work? - by palistov - 12-17-2011, 05:18 PM
RE: Why won't this script work? - by Dobbydoo - 12-17-2011, 05:29 PM
RE: Why won't this script work? - by Dobbydoo - 12-17-2011, 07:50 PM
RE: Why won't this script work? - by ferryadams10 - 12-17-2011, 06:52 PM
RE: Why won't this script work? - by palistov - 12-17-2011, 07:10 PM
RE: Why won't this script work? - by ferryadams10 - 12-21-2011, 08:29 PM



Users browsing this thread: 2 Guest(s)