• 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] Help me with this "egg hatching script" (I dont understand why it doesnt work)

Status
Not open for further replies.
Level 5
Joined
May 20, 2008
Messages
138
My "egg hatching script" does not work properly, please help me!

So...

I am making a ZulAman map (WoW raid) for Warcraft 3, and I am having some trouble with the script for one of the bosses.

The boss is called Janalai, and is a Dragonhawk avatar.
Janalai stands on top of a platform, and on the left and right side of this platform, there are two smaller platforms with Dragonhawk eggs.

During the bossfight, 2 "Hatcher" trolls will spawn, run to these small platforms (1 hatcher per platform) and start hatching the eggs there.

However, the trigger for the left platform is not working at all while the trigger for the right platform is working, and the left platform trigger is (should be) a perfect mirror of the trigger for the right platform...

Here is an initialization trigger

  • Janalai eggs init
    • Events
      • Time - Elapsed game time is 1.50 seconds
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in Janalai eggs left <gen>) and do (Actions)
        • Loop - Actions
          • Unit Group - Add (Picked unit) to JanalaiBoss_eggs_left
      • Unit Group - Pick every unit in (Units in Janalai eggs right <gen>) and do (Actions)
        • Loop - Actions
          • Unit Group - Add (Picked unit) to JanalaiBoss_eggs_right
Another trigger creating the hatchers and setting them to variables.

  • Janalai boss summon hatchers
    • Events
      • Time - JanalaiBoss_HatcherTimer expires
    • Conditions
      • JanalaiBoss_incombat Equal to True
    • Actions
      • Game - Display to (All players) the text: Where ma hatcha? Ge...
      • Countdown Timer - Start JanalaiBoss_HatcherTimer as a One-shot timer that will expire in 30.00 seconds
      • -------- Left Hatcher --------
      • Unit - Create 1 Amani'shi Hatcher for Player 12 (Brown) at ((Center of Janalai hatcher spawn point <gen>) offset by (0.00, 50.00)) facing Default building facing degrees
      • Set JanalaiBoss_HatcherLeft = (Last created unit)
      • Unit - Order (Last created unit) to Move To (Center of Janalai hatcher waitpoint Left <gen>)
      • -------- Right Hatcher --------
      • Unit - Create 1 Amani'shi Hatcher for Player 12 (Brown) at ((Center of Janalai hatcher spawn point <gen>) offset by (0.00, -50.00)) facing Default building facing degrees
      • Set JanalaiBoss_HatcherRight = (Last created unit)
      • Unit - Order (Last created unit) to Move To (Center of Janalai hatcher waitpoint Right <gen>)
The trigger for the right platform is working, put only partially. The hatcher doesnt run to the left platform once all the right eggs are hatched for some reason. But he does hatch the eggs. (read the trigger comments, I hope they explain good enough for you to understand what I WANT to happen)
  • Janalai boss hatch eggs right
    • Events
      • Unit - A unit enters Janalai hatchpoint right <gen>
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Entering unit) Equal to JanalaiBoss_HatcherLeft
          • (Entering unit) Equal to JanalaiBoss_HatcherRight
    • Actions
      • Unit - Order (Entering unit) to Hold Position
      • Wait 1.00 seconds
      • For each (Integer A) from 1 to 8, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (All units of JanalaiBoss_eggs_right are dead) Equal to True
            • Then - Actions
              • -------- If the right eggs already are hatched, check if all the eggs on the left platform are dead. If they are not, order the hatcher to run to the left hatching platform, else remove it (the hatcher). --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (All units of JanalaiBoss_eggs_left are dead) Equal to False
                • Then - Actions
                  • Unit - Order (Triggering unit) to Move To (Center of Janalai hatchpoint left <gen>)
                • Else - Actions
                  • Unit - Remove (Triggering unit) from the game
            • Else - Actions
              • -------- Else (if all the right eggs are dead = false) check if the hatching platform still contains the hatcher (and that it is alive). If those conditions are met, pick units in the "right eggs" unit group and kill a few of them. --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Janalai hatchpoint right <gen> contains (Triggering unit)) Equal to True
                  • ((Triggering unit) is alive) Equal to True
                • Then - Actions
                  • Unit Group - Pick every unit in (Random 2 units from JanalaiBoss_eggs_right) and do (Actions)
                    • Loop - Actions
                      • Unit - Kill (Picked unit)
                • Else - Actions
          • Wait 2.00 seconds

But the left platform triggers arent working at all. No eggs are hatched, the hatcher just stands there at the hatchpoint, doing nothing. (read the trigger comments, I hope they explain good enough for you to understand what I WANT to happen)

  • Janalai boss hatch eggs left
    • Events
      • Unit - A unit enters Janalai hatchpoint left <gen>
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Entering unit) Equal to JanalaiBoss_HatcherLeft
          • (Entering unit) Equal to JanalaiBoss_HatcherRight
    • Actions
      • -------- Why the eff you see kay doesn't this one work?? --------
      • Unit - Order (Entering unit) to Hold Position
      • Wait 1.00 seconds
      • For each (Integer A) from 1 to 8, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (All units of JanalaiBoss_eggs_left are dead) Equal to True
            • Then - Actions
              • -------- If the left eggs already are hatched, check if all the eggs on the right platform are dead. If they are not, order the hatcher to run to the right hatching platform, else remove it (the hatcher). --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (All units of JanalaiBoss_eggs_right are dead) Equal to False
                • Then - Actions
                  • Unit - Order (Triggering unit) to Move To (Center of Janalai hatchpoint right <gen>)
                • Else - Actions
                  • Unit - Remove (Triggering unit) from the game
            • Else - Actions
              • -------- Else (if all the left eggs are dead = false) check if the hatching platform still contains the hatcher (and that it is alive). If those conditions are met, pick units in the left eggs unit group and kill a few of them. --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Janalai hatchpoint left <gen> contains (Triggering unit)) Equal to True
                  • ((Triggering unit) is alive) Equal to True
                • Then - Actions
                  • Unit Group - Pick every unit in (Random 2 units from JanalaiBoss_eggs_left) and do (Actions)
                    • Loop - Actions
                      • Unit - Kill (Picked unit)
                • Else - Actions
          • Wait 2.00 seconds
I dont understand why the right platform trigger works but not the left one... this is driving me mad! I have been trying to solve this for over a week...

If you help me solve this or explain why it doesn't work I'll be forever grateful :p
 
Last edited:
Level 2
Joined
Aug 31, 2008
Messages
22
You should better create a new (two) trigger triggered by "Janalai boss hatch eggs right" and "Janalai boss hatch eggs left" with a periodic 2sec event and then make a loop ...
That unreadable ...
 
Level 5
Joined
May 20, 2008
Messages
138
Ok, I changed the triggers in my post, they are now shorter but function in exactly the same way. So I still got my problem.

But maybe it is a bit easier to read now, so maybe you can help me :p
 
Level 8
Joined
Jul 22, 2008
Messages
331
Marsmallos, don't be desperate. someone will help you... me for example... :)
And don't double post, you will get -rep. x)

First, i don't think that you need condition which sais:
  • Or - Any (Conditions) are true
    • Conditions
      • (Entering unit) Equal to JanalaiBoss_HatcherLeft
      • (Entering unit) Equal to JanalaiBoss_HatcherRight
I think that you need this:
for left platform:

  • Or - Any (Conditions) are true
    • Conditions
      • (Entering unit) Equal to JanalaiBoss_HatcherLeft
for right platform:

  • Or - Any (Conditions) are true
    • Conditions
      • (Entering unit) Equal to JanalaiBoss_HatcherRight
and Try to make a loop. that should be like this:

  • Actions
    • Unit - Order (Entering unit) to Hold Position
    • Wait 1.00 seconds
    • For each (Integer A) from 1 to 8, do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (All units of JanalaiBoss_eggs_right are dead) Equal to True
          • Then - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (All units of JanalaiBoss_eggs_left are dead) Equal to False
              • Then - Actions
                • Unit - Order (Triggering unit) to Move To (Center of Janalai hatchpoint left <gen>)
              • Else - Actions
                • Unit - Remove (Triggering unit) from the game
                • --------Now do like this:--------
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (Janalai hatchpoint right <gen> contains (Triggering unit)) Equal to True
                    • ((Triggering unit) is alive) Equal to True
                  • Then - Actions
                    • Unit Group - Pick every unit in (Random 2 units from JanalaiBoss_eggs_right) and do (Actions)
                      • Loop - Actions
                        • Unit - Kill (Picked unit)
                  • Else - Actions
          • Wait 2.00 seconds
If that doesn't work (i have no much time to study trigger deeply)

do it like this:

  • Actions
    • Unit - Order (Entering unit) to Hold Position
    • Wait 1.00 seconds
    • For each (Integer A) from 1 to 8, do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (All units of JanalaiBoss_eggs_right are dead) Equal to True
          • Then - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (All units of JanalaiBoss_eggs_left are dead) Equal to False
              • Then - Actions
                • Unit - Order (Triggering unit) to Move To (Center of Janalai hatchpoint left <gen>)
              • Else - Actions
                • Unit - Remove (Triggering unit) from the game
                • --------Now do like this:--------
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • And - All (Conditions) are true
                      • Conditions
                        • (Janalai hatchpoint right <gen> contains (Triggering unit)) Equal to True
                        • ((Triggering unit) is alive) Equal to True
                  • Then - Actions
                    • Unit Group - Pick every unit in (Random 2 units from JanalaiBoss_eggs_right) and do (Actions)
                      • Loop - Actions
                        • Unit - Kill (Picked unit)
                  • Else - Actions
          • Wait 2.00 seconds
or like this:

  • Actions
    • Unit - Order (Entering unit) to Hold Position
    • Wait 1.00 seconds
    • For each (Integer A) from 1 to 8, do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (All units of JanalaiBoss_eggs_right are dead) Equal to True
          • Then - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (All units of JanalaiBoss_eggs_left are dead) Equal to False
              • Then - Actions
                • Unit - Order (Triggering unit) to Move To (Center of Janalai hatchpoint left <gen>)
              • Else - Actions
                • Unit - Remove (Triggering unit) from the game
                • --------Now do like this:--------
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • Or - Any (Conditions) are true
                      • Conditions
                        • (Janalai hatchpoint right <gen> contains (Triggering unit)) Equal to True
                        • ((Triggering unit) is alive) Equal to True
                  • Then - Actions
                    • Unit Group - Pick every unit in (Random 2 units from JanalaiBoss_eggs_right) and do (Actions)
                      • Loop - Actions
                        • Unit - Kill (Picked unit)
                  • Else - Actions
          • Wait 2.00 seconds
I hope i helped you... Good luck...
and do not double post... ok?
 
Status
Not open for further replies.
Top