• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Whats wrong with this trigger?

Status
Not open for further replies.
Level 8
Joined
Mar 3, 2009
Messages
327
Im making a mob respawn system for dungeons in my RPG. The problem is, The variables RMCreepPoint[0] RMUT[0] and RMFacing[0] are the only ones being set. the reals equal 0, and the points are the center of the map. Interestingly enough, my debug trigger displays RMUC as being 1, which would indicate that it isnt "Looping". is there a better way to do this or have i done something wrong? Thanks for the help, everyone who replies.

  • RMinit
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in RMDEN <gen>) and do (Actions)
        • Loop - Actions
          • Set RMCreepPoint[RMUC] = (Position of (Picked unit))
          • Set RMUT[RMUC] = (Unit-type of (Picked unit))
          • Set RMFacing[RMUC] = (Facing of (Picked unit))
          • Set RMUC = (RMUC + 1)
  • Enter
    • Events
      • Unit - A unit enters RMDEN ent <gen>
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
      • (Unit-type of (Triggering unit)) Not equal to
    • Actions
      • Camera - Pan camera for (Owner of (Triggering unit)) to (Center of RMDEN ent dest <gen>) over 0.50 seconds
      • Unit - Move (Triggering unit) instantly to (Center of RMDEN ent dest <gen>)
  • Exit
    • Events
      • Unit - A unit enters RMDEN ex <gen>
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
      • (Unit-type of (Triggering unit)) Not equal to
    • Actions
      • Unit - Move (Triggering unit) instantly to (Center of RMDEN ex dest <gen>)
      • Camera - Pan camera for (Owner of (Triggering unit)) to (Center of RMDEN ex dest <gen>) over 0.50 seconds
      • Unit Group - Pick every unit in (Units in RMDEN <gen>) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Triggering unit) is A Hero) Equal to False
            • Then - Actions
              • Unit - Remove (Picked unit) from the game
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units in RMDEN <gen> matching (((Matching unit) is A Hero) Equal to True))) Equal to 0
        • Then - Actions
          • For each (Integer A) from 0 to RMUC, do (Actions)
            • Loop - Actions
              • Unit - Create 1 RMUT[(Integer A)] for Player 12 (Brown) at RMCreepPoint[(Integer A)] facing RMFacing[(Integer A)] degrees
        • Else - Actions
FYI: <Blank> is an actual unit.
 
Level 19
Joined
Feb 25, 2009
Messages
2,004
The group is never actually set anywhere before the init, thus it has no units in it.

For trigger #2, you might want to kill the units instead of removing them if you are going to use them again
otherwise they won't be ressurectable anymore.

  • (Number of units in (Units in RMDEN <gen> matching (((Matching unit) is A Hero) Equal to True))) Equal to 0
Leaks a group.
 
Level 8
Joined
Mar 3, 2009
Messages
327
Oh, okay. But how come it still registers one of the units as being there?

And also, whats the most efficient way to get the game to register the preplaced units in RMDEN? I've seen/used preplaced unit triggers before.

Thanks

EDIT: just got the game to register them with
  • RMinit
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (RMDEN <gen> contains (Picked unit)) Equal to True
            • Then - Actions
              • Set RMCreepPoint[RMUC] = (Position of (Picked unit))
              • Set RMUT[RMUC] = (Unit-type of (Picked unit))
              • Set RMFacing[RMUC] = (Facing of (Picked unit))
              • Set RMUC = (RMUC + 1)
            • Else - Actions
The variables are all being set right, but in the exit trigger nothing is getting removed or created.

EDIT2: out of curiousity, what would be more efficient, this trigger or one that compressed the I/T/E into the "Pick Every Unit" with "Matching unit"?
 
Last edited:
Level 29
Joined
Mar 10, 2009
Messages
5,016
dont double post!, coz its againts the rules here...

do like this coz your indexing is wrong...

  • Unit Group - Pick every unit OF TYPE in (Units in RMDEN <gen>) and do (Actions)
    • Set RMUC = (RMUC + 1)
    • Set RMCreepPoint[RMUC] = (Position of (Picked unit))
that is the correct way to 'index', anyway are you telling that you want to respawn a unit-type if a certain unit enters a point?
 
Level 8
Joined
Mar 3, 2009
Messages
327
It gets peoples attention.

When all of the heroes have left the dungeon I want the creeps to respawn facing the angle and at the point that they are in the terrain editor. How does where the index increment is make any difference? All it does my way is make it go instead of 1-6, 0-5.
 
Level 8
Joined
Mar 3, 2009
Messages
327
Thanks mckill, but mine is made to reset them, so when theyre damaged, or if theyve moved they get reset. I could probably modify yours to do the same thing, but I Just dont see why mine doesn't work.

EDIT: GOT IT TO WORK YAY. Just had to move a few things around.Thanks for the attempted help, guys.
 
Last edited:
Status
Not open for further replies.
Top