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 Ticking damage
i3670 Offline
Posting Freak

Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation: 36
#1
Ticking damage

I have this water/acid area and when the player enters it I want him/her to take ticking damage. Is this possible? The damage should also stop when he/she leaves the area.
12-20-2011, 04:21 PM
Find
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#2
RE: Ticking damage

Yeah....Here's how you'll want to work it out:
Add a collide callback with the slime area that tracks both entering and leaving states and is not removed automatically. Then just check which state the player is (1 for entering, -1 for leaving) and either start a looping timer which gives the player some damage or stops the timer using RemoveTimer().

12-20-2011, 05:21 PM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#3
RE: Ticking damage

(12-20-2011, 05:21 PM)palistov Wrote: Yeah....Here's how you'll want to work it out:
Add a collide callback with the slime area that tracks both entering and leaving states and is not removed automatically. Then just check which state the player is (1 for entering, -1 for leaving) and either start a looping timer which gives the player some damage or stops the timer using RemoveTimer().
If that doesn't work too well you can always change the script type to SlimeDamage. This isn't as reliable as what palistov said, but hey. It's another way to do it.

12-20-2011, 05:49 PM
Find




Users browsing this thread: 1 Guest(s)