• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Trigger] Problems with unit creation

Status
Not open for further replies.
Level 8
Joined
Sep 24, 2007
Messages
303
No units are created. Watafak? :/
  • Basics
    • Events
      • Time - Elapsed game time is 0.50 seconds
    • Conditions
    • Actions
      • -------- UNIT CREATION --------
        • Do Multiple ActionsFor each (Integer A) from 1 to 12, do (Actions)
          • Loop - Actions
            • -------- GONDOR MEELE CORPS 1 --------
            • Set Temploc = (Center of meele spawn gondor 1 <gen>)
            • Unit - Create 1 Footman for MeelePlayer[1] at Temploc facing 180.00 degrees
            • Unit Group - Add (Last created unit) to UnitGroup[1]
            • Unit - Set the custom value of (Last created unit) to 1
            • Custom script: call RemoveLocation(udg_Temploc)
            • -------- GONDOR MEELE CORPS 2 --------
            • Set Temploc = (Center of meele spawn gondor 2 <gen>)
            • Unit - Create 1 Footman for MeelePlayer[1] at Temploc facing 180.00 degrees
            • Unit - Set the custom value of (Last created unit) to 2
            • Unit Group - Add (Last created unit) to UnitGroup[2]
            • Custom script: call RemoveLocation(udg_Temploc)
            • Game - Display to (All players) the text: loop
Also, I am doing a selection system that would select all units from the same group. Dunno yet if it works, but just to ask if there's anything wrong so I won't come and ask twice.
  • selection system
    • Events
      • Player - Player 1 (Red) Selects a unit
      • Player - Player 2 (Blue) Selects a unit
      • Player - Player 3 (Teal) Selects a unit
      • Player - Player 4 (Purple) Selects a unit
      • Player - Player 5 (Yellow) Selects a unit
      • Player - Player 7 (Green) Selects a unit
      • Player - Player 8 (Pink) Selects a unit
      • Player - Player 9 (Gray) Selects a unit
      • Player - Player 10 (Light Blue) Selects a unit
      • Player - Player 11 (Dark Green) Selects a unit
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to (==) Footman
      • (Unit-type of (Triggering unit)) Equal to (==) Rohan knight
      • (Unit-type of (Triggering unit)) Equal to (==) Archer
      • (Unit-type of (Triggering unit)) Equal to (==) Grunt
      • (Unit-type of (Triggering unit)) Equal to (==) Raider
      • (Unit-type of (Triggering unit)) Equal to (==) Long distance artilery
      • (Unit-type of (Triggering unit)) Equal to (==) Catapult
      • (Unit-type of (Triggering unit)) Equal to (==) Gryphon Rider
      • (Unit-type of (Triggering unit)) Equal to (==) Gryphon Rider
    • Actions
      • Selection - Select UnitGroup[(Custom value of (Triggering unit))] for (Triggering player)
 
Is MeelePlayer[1] properly defined?

The second trigger needs to be

  • Conditions
    • OR
      • (Unit-type of (Triggering unit)) Equal to (==) Footman
      • (Unit-type of (Triggering unit)) Equal to (==) Rohan knight
      • ...
The first trigger is a bit unefficient, move set loc = center... and call RemoveLocation... out of the loop...nevermind, I'll post a trigger soon.
 
  • Hero pick
    • Events
      • Unit - A unit enters hero pick <gen>
    • Conditions
    • Actions
      • -------- GONDOR HEROES --------
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Unit-type of (Triggering unit)) Equal to (==) Aragorn
          • Then - Actions
            • Set Temploc = (Position of Meele shop 0018 <gen>)
            • Unit - Move (Triggering unit) instantly to Temploc
            • Camera - Pan camera for (Owner of (Triggering unit)) to Temploc over 0.00 seconds
            • Custom script: call RemoveLocation(udg_Temploc)
            • Set Tempgroup = (Units owned by (Owner of (Triggering unit)) of type Circle of Power)
            • Unit Group - Pick every unit in Tempgroup and do (Actions)
              • Loop - Actions
                • Unit - Remove (Picked unit) from the game
            • Custom script: call DestroyGroup(udg_Tempgroup)
            • Set MeelePlayer[1] = (Owner of (Triggering unit))
            • Hero - Create Sun Key and give it to (Triggering unit)
            • Hero - Create Meele Army Orders and give it to (Triggering unit)
            • Hero - Create Army Movement Points and give it to (Triggering unit)
          • Else - Actions
Player is assigned when player picks his hero. Didn't have any problems with it so far.
 
  • Untitled Trigger 001 Copy
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Set Temp_Loc_1 = (Center of Region 000 <gen>)
      • For each (Integer A) from 1 to 5, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Footman for Players[1] at Temp_Loc_1 facing Default building facing degrees
          • Unit Group - Add (Last created unit) to Unit_Group[1]
          • Unit - Set the custom value of (Last created unit) to 1
      • Custom script: call RemoveLocation(udg_Temp_Loc_1)
      • Set Temp_Loc_1 = (Center of Region 001 <gen>)
      • For each (Integer A) from 1 to 7, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Footman for Players[1] at Temp_Loc_1 facing Default building facing degrees
          • Unit Group - Add (Last created unit) to Unit_Group[2]
          • Unit - Set the custom value of (Last created unit) to 2
      • Custom script: call RemoveLocation(udg_Temp_Loc_1)
  • Untitled Trigger 002
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Footman
      • boolean[(Player number of (Triggering player))] Equal to False
    • Actions
      • Set boolean[(Player number of (Triggering player))] = True
      • Selection - Select Unit_Group[(Custom value of (Triggering unit))]
      • Countdown Timer - Start Timers[(Player number of (Triggering player))] as a One-shot timer that will expire in 0.10 seconds
  • Untitled Trigger 003
    • Events
      • Time - Timers[1] expires
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • boolean[(Integer A)] Equal to True
            • Then - Actions
              • Set boolean[(Integer A)] = False
            • Else - Actions
Without the countdown timer, the trigger will cause an infinite loop, and the game will crash.
 
sry for double post

The create units trigger still doesn't work. It must be something simple I guess. I will re-check regions, player and check if some other trigger is contradicting it. It must be something like this. :/


DANG! Units are created after 1 sec of game, but player is set after hero pick.

FAIL, sorry to use your time. But thanks for the fixes.
 
Status
Not open for further replies.
Back
Top