So.. another problem again concerning Unit Groups.. -_-

soulmaka

New Member
Reaction score
2
ok.. i have this two trigger codes,
everytime i casts the ability, only ONE UNIT moves, not all the units near the triggering unit.. O_O

even though there's no variable, it still wont work.. :banghead:

Here's the first code:

Code:
Force Push
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Force Push 
    Actions
        Set Force_Push_POTU = (Position of (Triggering unit))
        Unit Group - Pick every unit in (Units within 1000.00 of Force_Push_POTU) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked unit) is A structure) Equal to False
                        (Unit-type of (Picked unit)) Not equal to Saturn Caster |cffff00ff[Witch]
                    Then - Actions
                        Set Force_Push_UGN = (Number of units in (Units within 1000.00 of (Position of (Triggering unit))))
                        Set Force_Push_PU[Force_Push_UGN] = (Picked unit)
                        Trigger - Turn on Force Push Moving <gen>
                        Wait 2.00 seconds
                        Trigger - Turn off Force Push Moving <gen>
                    Else - Actions

and the 2nd one:

Code:
Force Push Moving
    Events
        Time - Every 0.05 seconds of game time
    Conditions
    Actions
        Unit - Move Force_Push_PU[Force_Push_UGN] instantly to ((Position of Force_Push_PU[Force_Push_UGN]) offset by 30.00 towards (180.00 - (Facing of Force_Push_PU[Force_Push_UGN])) degrees)
        Special Effect - Create a special effect at (Position of Force_Push_PUWOA) using Objects\Spawnmodels\Human\HumanBlood\BloodElfSpellThiefBlood.mdl

tnx in advance,. +rep if solved..
 

Jedi

New Member
Reaction score
63
Unit Group - pick every unit bla bla bla... actions loop through all units, so only last picked unit will move.You must save units in a group variable and move them with your periodic trigger.
 

cleeezzz

The Undead Ranger.
Reaction score
268
Trigger:
  • Actions
    • Set Force_Push_POTU = (Position of (Triggering unit))
    • Set Force_Push_Group = (Units within 1000.00 of Force_Push_POTU matching ((Matching unit) is A structure) Equal to False and (Unit-type of (Matching unit)) Not equal to Saturn Caster |cffff00ff[Witch])
    • Trigger - Turn on Force Push Moving &lt;gen&gt;
    • Wait 2.00 seconds
    • Trigger - Turn off Force Push Moving &lt;gen&gt;
    • Custom script : call RemoveLocation(udg_Force_Push_POTU)
    • Custom script : call DestroyGroup(udg_Force_Push_Group)

Trigger:
  • Force Push Moving
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick all units in (Force_Push_Group) and do Actions
        • Loop - Actions
          • Set Temp_Point = Position of (Picked Unit)
          • Unit - Move Picked Unit instantly to (Temp_Point) offset by 30.00 towards (180.00 - (Facing of Picked Unit)) degrees)
          • Special Effect - Create a special effect at (Temp_Point) using Objects\Spawnmodels\Human\HumanBlood\BloodElfSpellThiefBlood.mdl
          • Custom Script : call RemoveLocation(udg_Temp_Point)
 

soulmaka

New Member
Reaction score
2
@cleeezzz, you rock dude, thank you so much.. =),. you're not that lazy to do some code for us.. xD
by the way.. can you check at this code? my problem is that, the units will be permanently paused.. xD


Trigger:
  • Time Hatcher
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Time Hatcher
    • Actions
      • Set Time_Hatcher_TPOABC = (Target point of ability being cast)
      • Unit Group - Pick every unit in (Units within 1000.00 of Time_Hatcher_TPOABC) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to True
              • (Unit-type of (Picked unit)) Not equal to Saturn Caster |cffff00ff[Witch]
            • Then - Actions
              • Set Time_Hatcher_PU = (Picked unit)
              • Special Effect - Create a special effect at (Position of (Matching unit)) using Abilities\Spells\Items\TomeOfRetraining\TomeOfRetrainingCaster.mdl
              • Unit - Pause (Picked unit)
            • Else - Actions
      • Wait 2.00 seconds
      • Unit Group - Pick every unit in (Units within 1000.00 of Time_Hatcher_TPOABC) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to True
              • ((Picked unit) is paused) Equal to True
              • (Unit-type of (Picked unit)) Not equal to Saturn Caster |cffff00ff[Witch]
              • (Picked unit) Equal to Time_Hatcher_PU
            • Then - Actions
              • Unit - Unpause (Picked unit)
            • Else - Actions
      • Custom script: call RemoveLocation (udg_Time_Hatcher_TPOABC)
 

cleeezzz

The Undead Ranger.
Reaction score
268
Code:
(Picked unit) Equal to Time_Hatcher_PU

remove that line and it'll probably work
 
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