Results 1 to 9 of 9

Thread: Better Timer Functions

  
  1. #1
    Demon Spawn Kromeh's Avatar
    Join Date
    Oct 2009
    Location
    In the DK2 Map Editor
    Posts
    164

    Default Better Timer Functions

    EDIT: This whole post is about map making.

    Timers, in DK2, are a one shot kind of thing, you can't stop, pause, or reset them (for my knowledge).

    I'm forced to use several triggers to achieve the same effect of a repeating trigger (one that fires every 60 seconds by adding 1 to a flag every tick, which there are 4 in a second, and then another trigger which checks for when that flag hits 240 (60 seconds of ticks))

    In other words, please implement means to manipulate the timers effectively.

    (If I was wrong in this post about not being able to reset timers, please say so :/ )

  2. #2
    Awakening Game Master Metal Gear Rex's Avatar
    Join Date
    Sep 2009
    Posts
    5,654

    Default Re: Better Timer Functions

    All you have to do is do Set Timer but pick the same timer. It will be reset. Though, freezing timers is beyond my knoledge.
    Dungeon Keeper 2 Patch: With More Balance and Pie [Hiatus]
    Forever Hiatus. Probably. Latest Version: 3.5 w/Levels 1-11 Revised.

    The Awakening: GM Powers Activate!
    Tesonu is napping!

  3. #3
    Demon Spawn Kromeh's Avatar
    Join Date
    Oct 2009
    Location
    In the DK2 Map Editor
    Posts
    164

    Default Re: Better Timer Functions

    Do you mean Initialize Timer?

  4. #4
    Awakening Game Master Metal Gear Rex's Avatar
    Join Date
    Sep 2009
    Posts
    5,654

    Default Re: Better Timer Functions

    Oh right, Set Timer is DK1 script. But, yeah, just repeating the command resets the timer for DK1 and DK2.
    Dungeon Keeper 2 Patch: With More Balance and Pie [Hiatus]
    Forever Hiatus. Probably. Latest Version: 3.5 w/Levels 1-11 Revised.

    The Awakening: GM Powers Activate!
    Tesonu is napping!

  5. #5
    Keeper of Keepers dotted's Avatar
    Join Date
    Jun 2009
    Location
    Denmark
    Posts
    1,150
    Gamer IDs

    Steam ID: dotted

    Default Re: Better Timer Functions

    WFTO uses Lua for maps scripting, so this sort of thing should be doable.

  6. #6

    Default Re: Better Timer Functions

    Quote Originally Posted by dotted View Post
    WFTO uses Lua for maps scripting, so this sort of thing should be doable.
    Lua lacks timers, so you'd have to implement it into the source of the engine.

  7. #7
    Awakening Game Master Metal Gear Rex's Avatar
    Join Date
    Sep 2009
    Posts
    5,654

    Default Re: Better Timer Functions

    We should add more features to it though. I'd like to see a Timer pause or going to a certain setting.
    Dungeon Keeper 2 Patch: With More Balance and Pie [Hiatus]
    Forever Hiatus. Probably. Latest Version: 3.5 w/Levels 1-11 Revised.

    The Awakening: GM Powers Activate!
    Tesonu is napping!

  8. #8

    Default Re: Better Timer Functions

    Yeah, something like this:

    HTML Code:
    Timer.newTimer(1) - Creates a new timer value (could be stored in an array) default value is 0
    Timer.setTimer(1, 0) - Sets the time of timer X to value Y
    Timer.startTimer(1) - Starts tracking milliseconds past since the start (from the last stored value for the timer)
    Timer.stopTimer(1) - Stops tracking milliseconds past
    Timer.getTimer(1) - Returns the value of the timer
    To reset you could just do Timer.setTimer(1, 0)

    I think this is a good system for managing timers since you can create as many as you need (or at least a high amount of timers).

  9. #9
    Mistress kyle's Avatar
    Join Date
    Sep 2009
    Location
    Scotland
    Posts
    936
    Gamer IDs

    Gamertag: FOG I Kyle PSN ID: CreamedCustard Steam ID: kylemotherwell

    Default Re: Better Timer Functions

    This thread was more about asking to improve things than a new suggestion. So it has been closed.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •