• 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] Knockback/Pushaway after aoe

Status
Not open for further replies.
Level 22
Joined
Feb 4, 2005
Messages
3,971
Hi, could someone pls do the following spell as I am about to have a missile for it:

Based On Cluster Rockets:

After the rocket (1 missile) reaches units within say 400 of the target point of ability being cast to be pushed away some distance in line, continuing the line of the missiles.

It can start like that, but how should the push away look to it:

  • Cluster Rockets
    • Events
      • Unit - A unit Starts The Effect Of An Ability
    • Conditions
      • Ability Being Cast Equal to Cluster Rockets
    • Actions
      • Unit Group - Pick every unit in (Units in (units within 400 of Target Point Of Ability Being Cast) and do (Actions)
        • Loop - Actions
          • Trigger - What Next and What Other Triggers?
Ability info: Cluster Rockets, 1 or few other missiles (custom model), with little damage, 0 seconds or 0.01 stun - I will take care of teh Ability itself. Casting Range:1500, AOE: 400 (or more), so Units may be also within XXX the value will be equal to the Ability AOE value

Reps and Credits, I already added some ppl to credits, so this is guaranteed.
 
Level 19
Joined
May 1, 2008
Messages
1,130
i tried to do a similar trigger, u need to use 2 triggers 1 is the main trigger and the second is a periodic trigger (the actual slide) well i know how to do that in GUI but only for 1 target. If u want it to work for multiple units u need to use a JASS based trigger that i have little knowledge of :angry:
 
Level 22
Joined
Feb 4, 2005
Messages
3,971
Thanks for the link but it didn't help me with what I was looking for. Look, I see the simplest way that might work is to set a variable for the units within a range of the ability, turning a 2nd trigger On, and in the 2nd trigger with every 0.1 seconds of game time, all I need are 2 things to be told:

- the correct trigger (maybe unit group action) to make the units within that range/ i,e variable be pushed away some distance in the same line.

----->missile------> same direction pushed away; all units within the range of target point of ability being cast (variable used instead) to be pushed away in the same direction.

It should be something like move unit in unit group or so to position point with offest .. that's the trigger for sliding I'm asking for to be added in the Every 0.01 seconds of game time.

- To turn off the 2nd trigger, so that they don't constantly move every 0.01 second.

If I know the correct values and trigger for moving and for turning off the 2nd trigger, I may be able to make it myself.
 
Level 19
Joined
May 1, 2008
Messages
1,130
u need unit variables for the caster and the target and 2 point variables 1 is the actual position of the target(point1) and the other is the position of the target offset by x twords x angle(point 2). every 0.1 sec move target instantly to point 2. that is for an individual target but if u want to use multiple targets its more complex because u need to find a way to apply the trigger to every unit in the unit group in 400 range of caster for example. thats the tricky part that im scratching my head to figure it out. :bored:
i think it something to do with "for each integerA from 1 to x"
 
Level 19
Joined
May 1, 2008
Messages
1,130
moving all the units in a direction u just use the actual facing of the caster because the caster unit will always face the targets (and the missiles go the same way the caster is facing) when he uses an ability (set point 2 = position of target offset by lets say 8 twards facing of caster unit) but az i remember cluster rockets is a area of effect spell (the missiles dont hit the target units they hit the ground) so u should make units "spread" rather than push all of them in 1 direction by creating a dummy unit on the point of the spell being cast and using set point 2 = position of target offset by 8,9,10000 twards math-angle formed from dummy unit to target unit
 
Level 22
Joined
Feb 4, 2005
Messages
3,971
OK let's Start it all clean, just need one thing fixed:

  • Sonic Waves
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Sonic Wave Test
    • Actions
      • Trigger - Turn on Sonic Waves Deselect Source <gen>
      • Wait 0.50 seconds
      • Set SonicWavesSource = (Casting unit)
      • Set SonicWavesAreaTargets = (Units within 400.00 of (Target point of ability being cast))
      • Trigger - Turn on Sonic Waves Knockback <gen>
      • Wait 2.00 seconds
      • Trigger - Turn off Sonic Waves Knockback <gen>
      • Trigger - Turn off Sonic Waves Deselect Source <gen>
  • Sonic Waves Knockback (initially off)
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in SonicWavesAreaTargets and do (If ((Picked unit) Not equal to SonicWavesSource) then do (Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by 5.00 towards 0.00 degrees)) else do (Do nothing))
  • Sonic Waves Deselect Source (initially off)
    • Events
      • Time - Every 0.00 seconds of game time
    • Conditions
    • Actions
      • Selection - Clear selection for (Owner of SonicWavesSource)
what happens: the units move away, always on the right/east and till the end of the map, then upward. All I want is them to move away in the direction of the missiles - straight line as in straight line - caster -------->missile--->units---->units pushed same direction for the duration I selected to be sliding. I can adjust the speed of sliding myself. Just need the
  • Unit Group - Pick every unit in SonicWavesAreaTargets and do (If ((Picked unit) Not equal to SonicWavesSource) then do (Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by 5.00 towards 0.00 degrees)) else do (Do nothing))
fixed. I don't remember where the angle from P a to point B is, anyway, for more direct, here is the map, hope someone fixes that finally. + reps

I specially made the unit to be unselectable while pushing the units and while casting the 50 missiles, so that they all fly without interruption (the weapon is powerful but cannot be interrupted, afterall all good things may have a disadvantage, decided to make it so ). Then he can be selected at the same time the missiles and the pushing stops.
 
Last edited:
Level 22
Joined
Feb 4, 2005
Messages
3,971
Simply use Angle Between Point A and Point b to knock in a realistic angle (between the caster and the units).

As to your triggers, they are not even MPI.
Just make a Jass function (or ask someone to make for you) and call it when the spell is casted D;

Used it and it is ok now. I can manipulate myself the rest things I want to make. Thanks.
reputation_2pos.gif
 
Status
Not open for further replies.
Top