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 The Helper:
    The forum software says we have 554 members online now. We did not have that many unique visitors the whole day today. Too many bots and the disconnect between the forum counts and the stats.
  • Varine Varine:
    Currently it says 413 guests and 2 members
    +1
  • Varine Varine:
    Aww
  • The Helper The Helper:
    That is going to be mostly bots
  • The Helper The Helper:
    527 (members: 2, guests: 525)
  • The Helper The Helper:
    Happy Saturday!
    +1
  • V-SNES V-SNES:
    Happy Saturday!
    +1
  • The Helper The Helper:
    622 (members: 2, guests: 620)
  • The Helper The Helper:
    666 (members: 4, guests: 662) :)
    +1
  • Varine Varine:
    609 (members: 4, guests: 605)
  • The Helper The Helper:
    I was posting that last one because the 666 users online :)
    +1
  • The Helper The Helper:
    Happy Wednesday Night!
    +1
  • The Helper The Helper:
    Happy Thursday!
    +1
  • The Helper The Helper:
    Marathon watching The Expanse!
    +1
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    leaving for the weekend in San Antonio will be gone until Sunday afternoon
    +1
  • The Helper The Helper:
    and I am back :)
    +1
  • The Helper The Helper:
    Happy Tuesday!
    +1

    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