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
Scripting advice: Filling a bucket by three consecutive Item Callbacks.
TheGreatCthulhu Offline
Member

Posts: 213
Threads: 10
Joined: Oct 2010
Reputation: 32
#3
RE: Scripting advice: Filling a bucket by three consecutive Item Callbacks.

Basically, use a global variable to set a value that indicates something of interest (if the player got the bucket, if the bucket is filled, etc.) - the values can be simple integers, or booleans, or strings, as long as you know what each value represents, you're good.

For example, if an object can have a number of different states, you can use SetGolobalVarInt(...) and represent those states as numbers 1, 2, 3, ...

If something can only be in one of two states, you can use a global bool variable (true/false), etc.

Then, in OnEnter() (not in OnStart()!) check these values to figure out what is the current state of things, and update stuff and/or add required callbacks accordingly.

Global variables basically allow you to carry information across levels, you just need to figure out how to encode it (represent it).
(This post was last modified: 10-12-2013, 07:31 PM by TheGreatCthulhu.)
10-12-2013, 07:29 PM
Find


Messages In This Thread
RE: Scripting advice: Filling a bucket by three consecutive Item Callbacks. - by TheGreatCthulhu - 10-12-2013, 07:29 PM



Users browsing this thread: 1 Guest(s)