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

[Trigger] Stop the trigger and run another

Status
Not open for further replies.
I have these 2 trigger the first is starting active, the 2 only active. I like if when computer have 0 x unit,stop before trigger and run the trigger that is active only.
START ACTIVE
  • marine
    • Events
      • Time - Every 15.00 seconds of game time
    • Conditions
      • (Number of units in (Units owned by Player 9 (Gray) of type (Unit-type of Ship Starting 0015 <gen>))) Same as 1
    • Stocks
      • Unit - Create 3 Navy assault ship for Player 9 (Gray) at (Center of Region 007 <gen>) facing default orientation of the buildings degrees
      • Unit - Create 1 Battle Ship for Player 9 (Gray) at (Center of Region 007 <gen>) facing default orientation of the buildings degrees
      • Unit - Create 1 Marine Transport for Player 9 (Gray) at (Center of Region 007 <gen>) facing default orientation of the buildings degrees
      • Group units - Pick every unit in (Units in Region 007 <gen>) and do (Group units - Order (Units in Region 007 <gen>) to Attack - Go (Center creation of pirate ships <gen>))

ACTIVE NOT TO START
  • Marine assault
    • Events
      • Time - Every 10.00 seconds of game time
    • Conditions
      • (Number of units in (Units owned by Player 8 (Rosa) of type (Unit-type of Pirate Ship 0203 <gen>))) Same 0
    • Stocks
      • Unit - Create 4 Marine Transport for Player 9 (Gray) at (Center of Region 007 <gen>) facing default orientation of the buildings degrees
      • Group units - Pick every unit in (Units in Region 007 <gen>) and do (Group units - Order (Units in Region 007 <gen>) to Go (Center creation of pirate ships <gen>))
 
Level 8
Joined
Oct 28, 2007
Messages
435
Ummm. Turn off the second trigger. Then add to the first trigger:

if
Number of units in (playeble map area) matching Owner of (matching unit) equal to (your player) and Unit type equal to Sipyard equal to 0
then
Trigger - Turn off this trigger
Trigger turn on your second trigger
else
endif

Something like that or is it possible that the enemy builds another shipyard because then you will have to add to the first trigger

if
Number of units in (playeble map area) matching Owner of (matching unit) equal to (your player) and Unit type equal to Sipyard not equal to 0
then
-------Here comes all your actions
else
endif

and then to the second

if
Number of units in (playeble map area) matching Owner of (matching unit) equal to (your player) and Unit type equal to Sipyard EQUAL to 0
then
-------Here comes all your actions
else
endif

Hopes it helps.
 
I have put this but the trigger don't stop to make ship

  • make pirate ship
    • Events
      • Time - Every 15.00 seconds of game time
    • Conditions
      • (Number of units in (Units owned by Player 8 (Rosa) of type (Unit-type of Pirate Ship 0203 <gen>))) Same as 1
    • Stocks
      • Unit - Create Normal Pirate Ship 3 for Player 8 (Rosa) at (Center of building pirate ships <gen>) facing default orientation of the buildings degrees
      • Wait 2.00 seconds
      • Unit - Create 1 Battleship Piat for Player 8 (Rosa) at (Center of building pirate ships <gen>) facing default orientation of the buildings degrees
      • Unit - Create 1 Transport Ship for Player 8 (Rosa) at (Center of building pirate ships <gen>) facing default orientation of the buildings degrees
      • Group units - Pick every unit in (Units in building pirate ships <gen>) and do (Group units - Order (Units in building pirate ships <gen>) to Attack - Go (Center of Region 008 <gen>))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Unit-type of (Triggering unit)) Equal to Starting Ship) and ((Number of units in (Units in (Playable map area) matching ((Owner of (Matching unit)) Equal to Player 9 (Gray))) ) Equals 0)
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • Trigger - Turn on assault pirates <gen>
        • Otherwise - Stocks
 
Level 8
Joined
Oct 28, 2007
Messages
435
Your player firstly is not part of it, i meant YOUR player like player 9 or something. Secondly sorry man. I'm used to working in JASS so my Gui is a bit stuffed.

Oops. Sorry I made a mistake then. Remove the Triggering unit equal to Starting Ship and add under the conditions of the matching unit: Unit Type of (Matching Unit) equal to Starting Ship. There is no triggering unit when you have a timer. So your condition should be:

Number of Units in (Units in playeble map area matching ((Owner of matching unit equal to player 9 (Gray)) and ((Unit Type of (Matching Unit) equal to Starting Ship) equal to 0

it should work
 
is ok? -->

  • make pirate ship
    • Events
      • Time - Every 15.00 seconds of game time
    • Conditions
    • Stocks
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units in (Playable map area) matching (((Owner of (Matching unit)) Equal to Player 9 (Gray)) and ((Unit-type of (Matching unit)) Equal to Starting Ship)) )) Same 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • Trigger - Turn on assault pirates <gen>
        • Otherwise - Stocks
          • Unit - Create 1 Transport Ship for Player 8 (Rosa) at (Center of building pirate ships <gen>) facing default orientation of the buildings degrees
          • Wait 2.00 seconds
          • Unit - Create Normal Pirate Ship 3 for Player 8 (Rosa) at (Center of building pirate ships <gen>) facing default orientation of the buildings degrees
          • Unit - Create 1 Battleship Piat for Player 8 (Rosa) at (Center of building pirate ships <gen>) facing default orientation of the buildings degrees
 
Status
Not open for further replies.
Top