Game Development Community

Time meter that dolls out points...

by Max Thomas · in Torque Game Engine · 11/25/2004 (8:20 pm) · 4 replies

Hello all one again,

Kinda new question this time... I want to use a meter of sorts to dole out points holding an object... In this case it's a flag. I kinda want to have when the player picks up the flag that he or she has their score increase be 1 every 30 seconds or so. I'm not very used to things of this sort so could someone please help me?

Thanks, Max

#1
11/26/2004 (6:47 am)
Use a schedule() function to check and see if the player is holding the flag(checking every 30 seconds). If true, then that player would get the point, and the function would call itself to check again in 30 seconds. If the flag isn't being held, then it waits until it is picked up again, which will start the timer. Hope that helps.
#2
11/26/2004 (8:20 pm)
I'm kinda daft when it comes to subjects like this could you give me an example please?

Thanks, Max
#3
11/26/2004 (8:24 pm)
%sched = schedule(30000, 0, doleOutPoints);

   function doleOutPoints() {
      // Do stuff in here

   }

That's what it would look like, then you'd just need to get the client holding the flag and in doleOutPoints() you'd give him points.

- Brett
#4
11/27/2004 (8:09 am)
Thanks, I actually just figgured that out by myself with the corpse removal timers. The main problem I was actually having was the giving the points. I don't know what went wrong but I put a simple point giver outer in the onPickup funcion generaly the same type of point giver outer for killing an other player. Any help would be greatly appreciated.

Thanks, Max