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?
Dobbydoo Offline
Member

Posts: 50
Threads: 6
Joined: Aug 2011
Reputation: 0
#7
RE: Why won't this script work?

(12-17-2011, 06:16 PM)Your Computer Wrote: There's no point to check for the lever name from the entity variable if the local map variable carries the same name.

PHP Code: (Select All)
void StoreCheckLeverState(string &in entityint state)
{
SetLocalVarInt(entitystate);
CheckLeverStates(); 


(12-17-2011, 05:29 PM)Dobbydoo Wrote: It would be much easier to have only one variable for all levers. Then every time you pull a lever you add one to the variable and when it reaches 6 the puzzle is completed.

That would be error prone. Even if we set a stuck state for each lever when it gets pulled correctly, you'd still be adding 1 for when it gets pulled in the opposite, undesired direction.
Not if he only added to the variable when it was in the right state, and maybe made it stuck when in that state.
Like this:
PHP Code: (Select All)
if(alState == 1)
 {
 
SetLeverStuckState(stringasNameint alStatebool abEffects);
 
AddLocalVarInt(stringasNameint alVal);
 } 

EDIT: And of course when not being in the right state one would be removed from the variable.
(This post was last modified: 12-17-2011, 09:21 PM by Dobbydoo.)
12-17-2011, 07:50 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: 1 Guest(s)