• 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] Unknown Trigger Problem

Status
Not open for further replies.
Level 15
Joined
Oct 18, 2008
Messages
1,591
Hey! I use this trigger to move the zombies on my map, but they doesn't react Oo
  • Zombie Move
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Set TempGroup = (Units in (Playable map area) matching (((Matching player) controller) Equal to User))
      • Unit Group - Pick every unit in (Units owned by Player 11 (Dark Green)) and do (Actions)
        • Loop - Actions
          • Unit - Set the custom value of (Picked unit) to ((Custom value of (Picked unit)) - 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Custom value of (Picked unit)) Less than or equal to 1
              • Or - Any (Conditions) are true
                • Conditions
                  • (Current order of (Picked unit)) Equal to (Order(stop))
                  • (Current order of (Picked unit)) Equal to (Order(<Empty String>))
            • Then - Actions
              • Set TempPos = (Position of (Random unit from TempGroup))
              • Unit - Order (Picked unit) to Attack-Move To TempPos
            • Else - Actions
      • Custom script: call DestroyGroup( udg_TempGroup )
 
Level 12
Joined
Aug 22, 2008
Messages
911
Maker is right, you need 2 variables:
  • Set tempgroup = (Units in Playable Map Area matching (Owner of (Matching Unit) is a human player) equal to True
  • Set tempgroup2 = Units owned by Player 11
Make sure you use those variables wherever you're supposed to, and you'd better clear the point leak (the target point of the order issued to the units).
And what's with the custom value thing? Custom values start from 0 anyway so all zombies with unmodified custom values are going to be ordered to attack!
 
Level 15
Joined
Oct 18, 2008
Messages
1,591
GOD... I fell dumb Oo At all I got my trigger right now (custom value was made because a player suggested to use them to avoid zombies wandering pointlessly between 2 player, it should incrase to 10 when a zombie attacks, but nevermind, it works fine without it :)

At all I'll need some1 for my project, I'm a bit noob at making everything leakless (and a bit lazy) so I want to ask some1 to check every trigger :D I try to avoid the most leaks, but you see, I'm not very used to Jass or vJass, so I only use GUI (and I try to make it MUI if I can) but sometimes I miss some functions (and a quick question: specific unit event why can't use unit variables? XD)
 
It's because Blizzard is so damn sexy :p
Well, you need to use this instead:
  • Trigger - Add to Trigger 2 <gen> the event (Unit - Unit1 dies)
Unit1 is your unit variable and Trigger 2 is the trigger you want the actions for that Unit1 performed.
Tell me though, why would you need a specific unit event, when you have a variable?
You could just do this:
  • (Triggering unit) Equal to (Unit1)
which is a Unit Comparison.
 
  • Trigger1
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units in (Playable Map Area)) and do (Actions)
      • Loop - Actions
        • Trigger - Add to Trigger 3 <gen> the event (Unit - (Picked unit) takes damage)
  • Trigger2
  • Events
    • Unit - A unit enters (Playable Map Area)
  • Conditions
  • Actions
    • Trigger - Add to Trigger3 <gen> the event (Unit - (Triggering unit) takes damage)
  • Trigger3
  • Events
  • Conditions
    • (Triggering unit) Equal to Unit1
  • Actions
    • //Actions here
 
Status
Not open for further replies.
Top