what is a good timer system for noob jasser

jig7c

Stop reading me...-statement
Reaction score
123
I don't want to use PolledWait, nor TriggerSleepAction..

whats a good timer system i can use for my spells...
 

PurgeandFire

zxcvmkgdfg
Reaction score
509
Probably T32 since you don't really need to do much. Example:
JASS:
scope Example initializer Init
struct Hehe
    unit cast
    private method periodic takes nothing returns nothing
        call SetUnitState(.cast,UNIT_STATE_LIFE,GetWidgetLife(.cast)-3)
        if T32_Tick > 30 then
            call this.stopPeriodic()
        endif
    endmethod
    implement T32x
    static method create takes unit u returns Hehe 
        local thistype this = thistype.allocate()
        set .cast = u
        return this
    endmethod
endstruct
private function Check takes nothing returns boolean
    if GetSpellAbilityId() == 'A000' then
        call Hehe.create(GetTriggerUnit()).startPeriodic()
    endif
    return false
endfunction
private function Init takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(t,Condition(function Check))
endfunction
endscope


Just an example, it will take of 2 health from the caster every 0.03125 seconds until 30 ticks have been made. Just name a method "periodic" and put "implement T32x" below it. All you use is structname.startPeriodic() and structname.stopPeriodic()
 

Romek

Super Moderator
Reaction score
963
I'd recommend KT2 if you're a beginner, as it supports both low and high frequency timers, and is very, very easy to use.
 

SineCosine

I'm still looking for my Tangent
Reaction score
77
How is T32 for intermediate? o.0
It's the only timer-system I've ever used ._.

And..
Erm..
What about it is advanced? xD
 

jig7c

Stop reading me...-statement
Reaction score
123
hmm, i should have started a poll on this!
which is the most lag-free and MUI, meaning i can run multiple timers on different spells and it won't give me errors in chinese!
 

Romek

Super Moderator
Reaction score
963
T32 requires a very specific usage in structs, and can be confusing for beginners. As well as that, it only supports a single timer period. It is, however, very efficient.

TimerUtils is the best out there for low-frequency timers, and is easy to use. Though it does require you to start/stop and create/release timers manually.

KT2 is very easy to use, and doesn't require manual handling of timer handles. It supports and works well with all timer frequencies, and is also efficient.
 

jig7c

Stop reading me...-statement
Reaction score
123
i believe i'll start off with KT2, and move my way towards T32...
are there any examples on KT2, or T32 in spells on this forum... when i say spells, i mean very very simple spells..

not that it matters, you guys have so much high rep! but;
+rep to all :)
edit: sorry purgeandfire, it won't let me do +rep to you!
 

GetTriggerUnit-

DogEntrepreneur
Reaction score
129
How is T32 for intermediate? o.0
It's the only timer-system I've ever used ._.

And..
Erm..
What about it is advanced? xD

When you don't know what's a module, how to implement it, etc... TUtils or KT are way easier systems. Also T32 requires to be used in a struct.
 

jig7c

Stop reading me...-statement
Reaction score
123
yea i don't know how to use structs or modules or libraries, i only began using jass few months ago, and still learning all the functions..

still waiting on Romek's Jass Tutorial on Structs and such..
i'll go with KT2 for now, and see how that goes...
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top