• 🏆 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] unload trigger

Status
Not open for further replies.
Level 4
Joined
Jun 8, 2008
Messages
87
Well here i am again :) lately ive been making some trigger, but this one seemed to amaze me, it didnt work! it intention is, to make a ship move to the harbour, then the ship unloads a unit for evry player (not a computer player) that is playing, the unit unloaded is a random unit, then its gonna move away. ive tried it in single player, and i keep getting the same unit. here is the trigger
  • Start ship unload
    • Events
      • Unit - A unit enters Unload location <gen>
    • Conditions
      • (Entering unit) Equal to Human Transport Ship 0232 <gen>
    • Actions
      • Player - Change color of Player 10 (Light Blue) to Red, Retaining color of existing units
      • Player - Change color of Player 11 (Dark Green) to Blue, Retaining color of existing units
      • Player - Change color of Player 12 (Brown) to Green, Retaining color of existing units
      • Set Random_starting_units[1] = (Random integer number between 1 and 3)
      • Set Random_starting_units[2] = (Random integer number between 1 and 3)
      • Set Random_starting_units[3] = (Random integer number between 1 and 3)
      • Wait 1.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Random_starting_units[1] Equal to 1
          • (Player 10 (Light Blue) slot status) Equal to Is playing
          • (Player 10 (Light Blue) controller) Equal to User
        • Then - Actions
          • Unit - Create 1 Peasant (Normal) for Player 10 (Light Blue) at (Center of Unload location <gen>) facing Default building facing degrees
          • Sound - Play Loading <gen> at 100.00% volume, located at (Center of Unload location <gen>) with Z offset 0.00
          • Camera - Lock camera target for (Owner of (Last created unit)) to (Last created unit), offset by (0.00, 0.00) using Default rotation
          • Game - Display to Player Group - Player 10 (Light Blue) the text: |cffFFFF00New unit ...
          • Wait 2.00 seconds
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Random_starting_units[1] Equal to 2
              • (Player 10 (Light Blue) slot status) Equal to Is playing
              • (Player 10 (Light Blue) controller) Equal to User
            • Then - Actions
              • Unit - Create 1 Peasant (beard) for Player 10 (Light Blue) at (Center of Unload location <gen>) facing Default building facing degrees
              • Sound - Play Loading <gen> at 100.00% volume, located at (Center of Unload location <gen>) with Z offset 0.00
              • Camera - Lock camera target for (Owner of (Last created unit)) to (Last created unit), offset by (0.00, 0.00) using Default rotation
              • Game - Display to Player Group - Player 10 (Light Blue) the text: |cffFFFF00New unit ...
              • Wait 2.00 seconds
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Random_starting_units[1] Equal to 3
                  • (Player 10 (Light Blue) controller) Equal to User
                  • (Player 10 (Light Blue) slot status) Equal to Is playing
                • Then - Actions
                  • Unit - Create 1 Peasant (Peasant) for Player 10 (Light Blue) at (Center of Unload location <gen>) facing Default building facing degrees
                  • Sound - Play Loading <gen> at 100.00% volume, located at (Center of Unload location <gen>) with Z offset 0.00
                  • Camera - Lock camera target for (Owner of (Last created unit)) to (Last created unit), offset by (0.00, 0.00) using Default rotation
                  • Game - Display to Player Group - Player 10 (Light Blue) the text: |cffFFFF00New unit ...
                  • Unit - Change color of (Last created unit) to Black
                  • Wait 2.00 seconds
                • Else - Actions
                  • Do nothing
      • Unit - Deny shared vision of Human Transport Ship 0232 <gen> to Player 10 (Light Blue)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Random_starting_units[2] Equal to 1
          • (Player 11 (Dark Green) controller) Equal to User
          • (Player 11 (Dark Green) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 Peasant (Normal) for Player 11 (Dark Green) at (Center of Unload location <gen>) facing Default building facing degrees
          • Sound - Play Loading <gen> at 100.00% volume, located at (Center of Unload location <gen>) with Z offset 0.00
          • Camera - Lock camera target for (Owner of (Last created unit)) to (Last created unit), offset by (0.00, 0.00) using Default rotation
          • Game - Display to Player Group - Player 10 (Light Blue) the text: |cffFFFF00New unit ...
          • Wait 2.00 seconds
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Player 11 (Dark Green) controller) Equal to User
              • (Player 11 (Dark Green) slot status) Equal to Is playing
              • Random_starting_units[2] Equal to 2
            • Then - Actions
              • Unit - Create 1 Peasant (beard) for Player 11 (Dark Green) at (Center of Unload location <gen>) facing Default building facing degrees
              • Sound - Play Loading <gen> at 100.00% volume, located at (Center of Unload location <gen>) with Z offset 0.00
              • Camera - Lock camera target for (Owner of (Last created unit)) to (Last created unit), offset by (0.00, 0.00) using Default rotation
              • Game - Display to Player Group - Player 11 (Dark Green) the text: |cffFFFF00New unit ...
              • Wait 2.00 seconds
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Player 11 (Dark Green) controller) Equal to User
                  • Random_starting_units[2] Equal to 3
                  • (Player 11 (Dark Green) slot status) Equal to Is playing
                • Then - Actions
                  • Unit - Create 1 Peasant (Peasant) for Player 11 (Dark Green) at (Center of Unload location <gen>) facing Default building facing degrees
                  • Sound - Play Loading <gen> at 100.00% volume, located at (Center of Unload location <gen>) with Z offset 0.00
                  • Camera - Lock camera target for (Owner of (Last created unit)) to (Last created unit), offset by (0.00, 0.00) using Default rotation
                  • Game - Display to Player Group - Player 11 (Dark Green) the text: |cffFFFF00New unit ...
                  • Unit - Change color of (Last created unit) to Black
                  • Wait 2.00 seconds
                • Else - Actions
                  • Do nothing
      • Unit - Deny shared vision of Human Transport Ship 0232 <gen> to Player 11 (Dark Green)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 12 (Brown) controller) Equal to User
          • (Player 12 (Brown) slot status) Equal to Is playing
          • Random_starting_units[3] Equal to 1
        • Then - Actions
          • Unit - Create 1 Peasant (Normal) for Player 12 (Brown) at (Center of Unload location <gen>) facing Default building facing degrees
          • Sound - Play Loading <gen> at 100.00% volume, located at (Center of Unload location <gen>) with Z offset 0.00
          • Camera - Lock camera target for (Owner of (Last created unit)) to (Last created unit), offset by (0.00, 0.00) using Default rotation
          • Game - Display to Player Group - Player 12 (Brown) the text: |cffFFFF00New unit ...
          • Wait 2.00 seconds
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Player 12 (Brown) slot status) Equal to Is playing
              • Random_starting_units[3] Equal to 2
              • (Player 12 (Brown) controller) Equal to User
            • Then - Actions
              • Unit - Create 1 Peasant (beard) for Player 12 (Brown) at (Center of Unload location <gen>) facing Default building facing degrees
              • Sound - Play Loading <gen> at 100.00% volume, located at (Center of Unload location <gen>) with Z offset 0.00
              • Camera - Lock camera target for (Owner of (Last created unit)) to (Last created unit), offset by (0.00, 0.00) using Default rotation
              • Game - Display to Player Group - Player 12 (Brown) the text: |cffFFFF00New unit ...
              • Wait 2.00 seconds
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Player 12 (Brown) slot status) Equal to Is playing
                  • (Player 12 (Brown) controller) Equal to User
                  • Random_starting_units[3] Equal to 3
                • Then - Actions
                  • Unit - Create 1 Peasant (Peasant) for Player 12 (Brown) at (Center of Unload location <gen>) facing Default building facing degrees
                  • Sound - Play Loading <gen> at 100.00% volume, located at (Center of Unload location <gen>) with Z offset 0.00
                  • Camera - Lock camera target for (Owner of (Last created unit)) to (Last created unit), offset by (0.00, 0.00) using Default rotation
                  • Game - Display to Player Group - Player 12 (Brown) the text: |cffFFFF00New unit ...
                  • Unit - Change color of (Last created unit) to Black
                  • Wait 2.00 seconds
                • Else - Actions
                  • Do nothing
      • Unit - Deny shared vision of Human Transport Ship 0232 <gen> to Player 10 (Light Blue)
      • Wait 1.00 seconds
      • Unit - Order Human Transport Ship 0232 <gen> to Move To (Center of remove ship location <gen>)
      • Trigger - Turn off (This trigger)
      • Custom script: call DestroyTrigger(GetTriggeringTrigger())
i know its quite messy :gg:
 
Status
Not open for further replies.
Top