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
how do timers work?
Mackiiboy Offline
Member

Posts: 101
Threads: 7
Joined: Jan 2012
Reputation: 11
#2
RE: how do timers work?

If you want the torches to be lit at the beginning while entering, you could just press on the [] lit box on every entity in the Level Editor.

If you want the torches to be lit by scripting it, you will not need any timers. You will just have to use SetLampLit("NameOfATorch", true, true); in the void OnEnter(). If you want them to be unlit when you leave, ya'll just have to put SetLampLit("NameOfATorch", false, true); in the void OnLeave().

Of course it's possible to do this with timers if you want. Put AddTimer("", 1.0f, "TorchFunc"); in the void OnEnter(). 1.0f can be changed to any other float, it determines how many seconds it will take before the timer function will be called. In this case, TorchFunc will be called in 1 second.

TorchFunc(string &in asTimer)
{
SetLampLit("NameOfATorch", false, true);
}

----------------------------
I'm not sure if I understand what you mean with "the player enters", if it means that the player enters the map, do as above, if it means that the player enters a room, just use a script area that collides with the player and calls a function that have SetLampLit("NameOfATorch", false, true); or timers that calls SetLampLit in it.
.
(07-31-2012, 04:49 AM)Soverain Wrote: I want it so that torches begin to light up by themselves when the player enters and i assume timers are involved but i have no idea how to use them. Tips?
07-31-2012, 09:56 AM
Website Find


Messages In This Thread
how do timers work? - by Soverain - 07-31-2012, 04:49 AM
RE: how do timers work? - by Mackiiboy - 07-31-2012, 09:56 AM
RE: how do timers work? - by ApeCake - 07-31-2012, 10:45 AM
RE: how do timers work? - by Soverain - 07-31-2012, 08:49 PM
RE: how do timers work? - by Mackiiboy - 07-31-2012, 09:02 PM
RE: how do timers work? - by FlawlessHappiness - 07-31-2012, 08:58 PM
RE: how do timers work? - by Soverain - 07-31-2012, 09:51 PM



Users browsing this thread: 1 Guest(s)