• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

JASS Countdown Timer (for faster and more realistic effects)

Status
Not open for further replies.
Level 2
Joined
Sep 2, 2008
Messages
13
I've been looking for a way to move units using a countdown timer, like moving a unit to "caster_loc" every .1 seconds of gametime. Using TriggerSleepAction is too slow because the .27 second thing, so I was trying to see how to use countdown timers so the effect is faster and more realistic. Can I get any help?
 
You should use "Timer - periodic event" if you want to run the trigger every 0.1 sec, starting timer needs more memory.
Just add the units you want to move to a unit group ( when the spell is cast), put the caster location to a variable and turn on the moving trigger.
  • Move trigger
    • Events
      • Time - Elapsed game time is 0.05 seconds
    • Conditions
    • Actions
      • Unit Group - Pick every unit in unitGroup and do (Actions)
        • Loop - Actions
          • Set point = (Position of (Picked unit))
          • Set point2 = (point offset by 20.00 towards (Angle from point to Caster_loc) degrees)
          • Unit - Move (Picked unit) instantly to point2
          • Custom script: call RemoveLocation( point )
          • Custom script: call RemoveLocation( point2 )
 
That's exactly what I want, but in JASS. Some triggers that I convert to JASS, there's a condition, then there are multiple actions, and the trigger does something like
"call If................, then call function MoveUnitTrig_829371" or something for example. Is there a way to not have those multiple actions and just have it all in one action and not calling different actions?
 
you want to create trigger, start a periodic timer, and have the event of the trigger be "when timer expires"

this is all possible in 1 "trigger" with multiple jass functions.

JASS:
function Trig_timer takes nothing returns nothing
    local timer time = CreateTimer()
    call TimerStart(time,.03,true,function actions)
endfunction

and above it:

JASS:
function actions takes nothing returns nothing
     actions
endfunction
 
Status
Not open for further replies.
Back
Top