• 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.

[Trigger] Help!

Status
Not open for further replies.
Level 23
Joined
Oct 20, 2012
Messages
3,075
  • Random Blink
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to BlinkAbility
    • Actions
      • =========================================
      • ============Use either of these two============
      • Set temppoint = (Position of (Target unit of ability being cast))
      • Set temppoint = (Target point of ability being cast)
      • =========================================
      • Set temppoint2 = (temppoint offset by (Random real number between 50.00 and 150.00) towards (Random angle) degrees)
      • Set unitXreal = (X of temppoint2)
      • Set unitYreal = (Y of temppoint2)
      • Custom script: call SetUnitY(GetTriggerUnit(), udg_unitYreal)
      • Custom script: call SetUnitX(GetTriggerUnit(), udg_unitXreal)
      • Custom script: call RemoveLocation(udg_temppoint)
      • Custom script: call RemoveLocation(udg_temppoint2)
Something like this?
 
Level 7
Joined
Mar 6, 2014
Messages
203
  • Random Blink
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to BlinkAbility
    • Actions
      • =========================================
      • ============Use either of these two============
      • Set temppoint = (Position of (Target unit of ability being cast))
      • Set temppoint = (Target point of ability being cast)
      • =========================================
      • Set temppoint2 = (temppoint offset by (Random real number between 50.00 and 150.00) towards (Random angle) degrees)
      • Set unitXreal = (X of temppoint2)
      • Set unitYreal = (Y of temppoint2)
      • Custom script: call SetUnitY(GetTriggerUnit(), udg_unitYreal)
      • Custom script: call SetUnitX(GetTriggerUnit(), udg_unitXreal)
      • Custom script: call RemoveLocation(udg_temppoint)
      • Custom script: call RemoveLocation(udg_temppoint2)
Something like this?
how about when the caster cast the ability and every 0.03 seconds he moves random point of target
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,255
how about when the caster cast the ability and every 0.03 seconds he moves random point of target
This would look very strange as the unit would appear to move every 2-3 frames in a discontinuous way.

You need 2 triggers for this. 1 For picking up the casts and the other to perform the periodic movement. Trigger 1 feeds the cast into an array list and trigger 2 then processes this array list moving the unit. The array list includes fields for "ticks" which represent the amount of time passed or remaining before the cast is ejected from the list (ability ends).
 
Level 13
Joined
Jul 16, 2012
Messages
679
how about when the caster cast the ability and every 0.03 seconds he moves random point of target

If you want many point
I have Example For You

  • Untitled Trigger 001
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Avatar
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Y Equal to 0
        • Then - Actions
          • Trigger - Turn on Untitled Trigger 002 <gen>
        • Else - Actions
      • Set Y = (Y + 1)
      • Set Unit[Y] = (Triggering unit)
      • Set BlinkCount[Y] = 4
      • Set Duration[X] = 0.30
  • Untitled Trigger 002
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer X) from 1 to Y, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • BlinkCount[Y] Less than or equal to 0
            • Then - Actions
              • Set Unit[X] = No unit
              • Set X = (X - 1)
              • Set Y = (Y - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Y Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                  • Skip remaining actions
                • Else - Actions
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Duration[X] Less than or equal to 0.00
                • Then - Actions
                  • Set BlinkCount[X] = (BlinkCount[X] - 1)
                  • Set Duration[X] = 1.00
                  • Set Region[X] = (Region centered at (Position of Unit[X]) with size (400.00, 400.00))
                  • Set TempPoint = (Random point in Region[X])
                  • Special Effect - Create a special effect at TempPoint using Abilities\Spells\Human\MassTeleport\MassTeleportTarget.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • Unit - Move Unit[X] instantly to TempPoint
                  • Custom script: call RemoveLocation( udg_TempPoint)
                • Else - Actions
                  • Set Duration[X] = (Duration[X] - 0.30)
 

Attachments

  • asadsadad.w3x
    17.6 KB · Views: 45
Status
Not open for further replies.
Top