Prometheus
Everything is mutable; nothing is sacred
- Reaction score
- 590
This mini-system basically puts a life span on a repeating timer.*
Quite useful in my opinion.
Only downside is it requires HSAS.
Requires
HSAS
New Gen
How To Call
Code
Implementation Instructions
Credits
PurgeandFire - Teaching Me How To Use Structs
Rising_Dusk - Minor Coding
emjlr3 - Ideas, Minor Coding
Uberplayer - He must of done something
*Test map is a half-assed spell that uses this function.
Quite useful in my opinion.
Only downside is it requires HSAS.
Requires
HSAS
New Gen
How To Call
Code
JASS:
library Timed requires HSAS
//! runtextmacro HSAS_Static("Time","24570","")
private struct Time
timer T
timer D
endstruct
private function DestTime takes nothing returns nothing
local timer t = GetExpiredTimer()
local Time T = GetAttachedStructTime(t)
call DestroyTimer(t)
call PauseTimer(T.D)
call DestroyTimer(T.D)
endfunction
public function Timer takes timer t, real r returns nothing
local Time T = Time.create()
set T.T = CreateTimer()
set T.D = t
call TimerStart(T.T, r, false, function DestTime)
call AttachStructTime(T.T, T)
endfunction
endlibrary
Implementation Instructions
Code:
1. If you don't know wtf you're doing, download and open the test map.
2. Copy the two triggers there. You can copy them individually or copy the trigger folder.
3. Place into your map.
4. Now, any time you are using a timer you call my function (how to call it is stated above) and it gives that timer a life span.
Credits
PurgeandFire - Teaching Me How To Use Structs
Rising_Dusk - Minor Coding
emjlr3 - Ideas, Minor Coding
Uberplayer - He must of done something
*Test map is a half-assed spell that uses this function.