spell triggering loops

alexho

New Member
Reaction score
0
my problem is, and i dont know why it is happening but here it is:

when i loop for example a thunderclap or some other sfx or doodad for say to circle around a unit from a specific radius and i dont want it instantly but gradually in time to encircled around the hero. but when i add wait 'small value' to the loop between effects it seems to screw it up and it doesnt show any effects.

same goes for moving units from spell being cast. when i do for loop for a unit to move (enemy) from the casting units facing angle constant by some small value and i add wait it screws up and doesnt move the enemy at all.

well here is wat it looks like simply i would like to make it move the unit backwards while having it look good special effect ground effect each time it moves back
Code:
punch
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Punch 
    Actions
        Set targettemp[2] = (Target unit of ability being cast)
        Set z = 0
        For each (Integer A) from 1 to (Strength of (Triggering unit) (Include bonuses)), do (Actions)
            Loop - Actions
                Special Effect - Create a special effect attached to the origin of targettemp[2] using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
                Wait 0.10 seconds
                Set z = (z + 33)
                Unit - Move targettemp[2] instantly to ((Position of (Triggering unit)) offset by (Real(z)) towards (Facing of (Triggering unit)) degrees)
        Unit - Cause (Triggering unit) to damage targettemp[2], dealing ((Real((Strength of (Casting unit) (Include bonuses)))) / 2.00) damage of attack type Spells and damage type Normal
        Set targettemp[2] = No unit
 

Exfyre

hmm...
Reaction score
60
waits do not work inside of loops in GUI
instead, make a seperate trigger (initially off) that executes evey .10 seconds that does ur sfx. turn it on when your spell triggers, use a wait for the amount of time the spell is being cast then turn off the trigger
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
waits do not work inside of loops in GUI
instead, make a seperate trigger (initially off) that executes evey .10 seconds that does ur sfx. turn it on when your spell triggers, use a wait for the amount of time the spell is being cast then turn off the trigger

Just for reference, waits do work inside of integer loops, but they get messed up when you run the trigger more than once while the first trigger is still running the waits.

Waits will also not last for lower than ~0.20 seconds, even when set lower.

Having a periodic event will allow the time intervals to be less than 0.20 seconds, but they will still get messed up if you run the trigger more than once while the first is still running.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top