• 🏆 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!

Trigger: Region, Move and Unit Group (Help plz)

Status
Not open for further replies.
Level 8
Joined
Jun 13, 2010
Messages
344
Hi,

I am making a Crypt Dungeon. When you enter the region, you will be put into a random room of 5. When you have cleared the room of hostiles (player 12), your troops will be moved to a new random room of 5.
The ghoul is to continue until you luckily will land in the final crypt room.

Now I am having some trouble. When I enter the room first enter region, it just sends me to the same room every time. But when I clear the room, nothing happends. I have noted by making sure it will not count dead enemies or the player heroes. So what am I missing?

Please ask if you do not understand my question or need further more details.

Here is my trigger. I have made it like this for all 4 Crypt rooms and none for the final crypt room, since you will have to kill the boss you leave there and loot items etc etc.

  • Kings Crypt Room 1
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Kings Crypt 1 <gen> contains (Dying unit)) Equal to True
    • Actions
      • Set Dungeon_Integer = 0
      • Set Dungeon_Integer1 = 0
      • Unit Group - Pick every unit in (Units in Kings Crypt 1 <gen>) and do (Actions)
        • Loop - Actions
          • Set Dungeon_Unit = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Dungeon_Unit is A Hero) Equal to False
              • (Dungeon_Unit is dead) Equal to False
              • (Owner of Dungeon_Unit) Equal to Player 12 (Brown)
            • Then - Actions
              • Set Dungeon_Integer = (Dungeon_Integer + 1)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Dungeon_Integer Equal to 0
              • (Dungeon_Hero is A Hero) Equal to True
              • (Owner of Dungeon_Unit) Not equal to Player 12 (Brown)
            • Then - Actions
              • Set Dungeon_Integer1 = (Random integer number between 1 and 5)
              • Game - Display to (All players controlled by a ((Owner of Dungeon_Unit) controller) player) the text: You try and make yo...
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Dungeon_Integer1 Equal to 1
                • Then - Actions
                  • Unit - Move Dungeon_Unit instantly to (Center of Kings Crypt 1 Enter <gen>)
                  • Camera - Pan camera as necessary for (Owner of Dungeon_Unit) to (Center of Kings Crypt 1 Enter <gen>) over 0.00 seconds
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Dungeon_Integer1 Equal to 2
                • Then - Actions
                  • Unit - Move Dungeon_Unit instantly to (Center of Kings Crypt 2 Enter <gen>)
                  • Camera - Pan camera as necessary for (Owner of Dungeon_Unit) to (Center of Kings Crypt 2 Enter <gen>) over 0.00 seconds
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Dungeon_Integer1 Equal to 3
                • Then - Actions
                  • Unit - Move Dungeon_Unit instantly to (Center of Kings Crypt 3 Enter <gen>)
                  • Camera - Pan camera as necessary for (Owner of Dungeon_Unit) to (Center of Kings Crypt 3 Enter <gen>) over 0.00 seconds
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Dungeon_Integer1 Equal to 4
                • Then - Actions
                  • Unit - Move Dungeon_Unit instantly to (Center of Kings Crypt 4 Enter <gen>)
                  • Camera - Pan camera as necessary for (Owner of Dungeon_Unit) to (Center of Kings Crypt 4 Enter <gen>) over 0.00 seconds
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Dungeon_Integer1 Equal to 5
                • Then - Actions
                  • Unit - Move Dungeon_Unit instantly to (Center of Kings Crypt Final <gen>)
                  • Camera - Pan camera as necessary for (Owner of Dungeon_Unit) to (Center of Kings Crypt Final <gen>) over 0.00 seconds
                • Else - Actions
            • Else - Actions
Can you spot what I am missing?

Basically my idea was for it to register whenever an enemy is killed. Then count if there are anymore enemies left there. If all enemies in the region are dead, then all players are picked and moved to another region.
 
Level 13
Joined
Jan 2, 2016
Messages
973
I can see one major mistake. You have one "If dungeon_hero is a Hero" condition, but you never defined who is dungeon_hero. Perhaps you need to start another loop that picks all the units there and set dungeon_hero to picked unit. (Or think of another way to do things with just one loop)

EDIT: Also.. The second "If" doesn't need to be under the loop as it needs to happen AFTER the loop and it doesn't need to be happening during the loop.

And.. the way I would do this would be (it has 2 loops, but the 2-nd only happens under a condition):
Loop: If picked unit is a Hero then add picked unit to TeleportationGroup (Unit Group)
If picked unit is not a hero, is not dead, is owned by player 12 then Set Dungeon_Integer = Dungeon integer + 1
----- Close the loop -----
(If you want all the heroes to be teleported to the same room - you need to set the Dungeone_Integer1 here, otherwise if you want each hero to go into a random room - set the Dungeon_Integer1 in the loop)
If Dungeon_Integer = 0 then pick all units from TeleportationGroup and ........ (teleport them)

remove all units from TeleportationGroup
 
Last edited:
Level 8
Joined
Jun 13, 2010
Messages
344
I can see one major mistake. You have one "If dungeon_hero is a Hero" condition, but you never defined who is dungeon_hero. Perhaps you need to start another loop that picks all the units there and set dungeon_hero to picked unit. (Or think of another way to do things with just one loop)

EDIT: Also.. The second "If" doesn't need to be under the loop as it needs to happen AFTER the loop and it doesn't need to be happening during the loop.

And.. the way I would do this would be (it has 2 loops, but the 2-nd only happens under a condition):
Loop: If picked unit is a Hero then add picked unit to TeleportationGroup (Unit Group)
If picked unit is not a hero, is not dead, is owned by player 12 then Set Dungeon_Integer = Dungeon integer + 1
----- Close the loop -----
(If you want all the heroes to be teleported to the same room - you need to set the Dungeone_Integer1 here, otherwise if you want each hero to go into a random room - set the Dungeon_Integer1 in the loop)
If Dungeon_Integer = 0 then pick all units from TeleportationGroup and ........ (teleport them)

remove all units from TeleportationGroup

Oh ofcause. I had earlier picked 2 unit groups, but realized I could make the trigger much simpler. So I just forgot to switch it all back. Makes sense. Stupid.. xD
Thx mate.
 
Status
Not open for further replies.
Top