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
void OnStart() void OnEnter()
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#4
RE: void OnStart() void OnEnter()

You can use global variables with the "OnEnter" function to control when an event happens (i.e. perhaps the player gets another item from another map, or it's triggered just by how many times the player enters altogeter).

Here's a loop that adds a variable, and after the variable reaches x amount, it will trigger whatever script:

Spoiler below!

void OnEnter()
{
AddGlobalVarInt("var", 1);


if(GetGlobalVarInt("var") = 3)
{
///do stuff here
}
}


On the third time the player enters the map, it will activate the "do stuff here" part; this can be pretty much anything you'd want - setting up a callback, playing a sound, triggering a spooky event - anything.

Hope that helped!

I rate it 3 memes.
10-14-2012, 12:38 AM
Find


Messages In This Thread
void OnStart() void OnEnter() - by 4WalledKid - 10-13-2012, 11:48 PM
RE: void OnStart() void OnEnter() - by Adny - 10-13-2012, 11:51 PM
RE: void OnStart() void OnEnter() - by 4WalledKid - 10-14-2012, 12:27 AM
RE: void OnStart() void OnEnter() - by Adny - 10-14-2012, 12:38 AM
RE: void OnStart() void OnEnter() - by 4WalledKid - 10-14-2012, 01:50 AM
RE: void OnStart() void OnEnter() - by The chaser - 10-14-2012, 09:31 AM
RE: void OnStart() void OnEnter() - by 4WalledKid - 10-14-2012, 02:14 PM
RE: void OnStart() void OnEnter() - by 4WalledKid - 10-14-2012, 05:56 PM
RE: void OnStart() void OnEnter() - by 4WalledKid - 10-14-2012, 06:09 PM
RE: void OnStart() void OnEnter() - by The chaser - 10-14-2012, 02:54 PM
RE: void OnStart() void OnEnter() - by The chaser - 10-14-2012, 06:03 PM
RE: void OnStart() void OnEnter() - by 4WalledKid - 10-14-2012, 06:17 PM
RE: void OnStart() void OnEnter() - by Wapez - 10-14-2012, 07:46 PM



Users browsing this thread: 8 Guest(s)