• 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] error when testing/loading map

Status
Not open for further replies.
Level 4
Joined
Oct 15, 2008
Messages
77
i have no idea why im getting this error....the error messege im receiving is

if ( not ( UnitTypeIsInRegion(gg_rct_start_loc, 'hbla') == false ) ) then


my trigger looks like this
  • Player Group - Pick every player in Force1 and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Does start_loc <gen> contain a unit of Type random_race[1]) Equal to False
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Does start_loc <gen> contain a unit of Type Blacksmith) Equal to False
            • Then - Actions
              • Unit - Create 1 Blacksmith for (Triggering player) at (starting_location[(Player number of (Triggering player))] offset by (800.00, 150.00)) facing Default building facing (270.0) degrees
            • Else - Actions
              • Do nothing
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Does start_loc <gen> contain a unit of Type random_race[2]) Equal to False
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Does start_loc <gen> contain a unit of Type Blacksmith) Equal to False
                • Then - Actions
                  • Unit - Create 1 Blacksmith for (Triggering player) at (starting_location[(Player number of (Triggering player))] offset by (800.00, 150.00)) facing Default building facing (270.0) degrees
                • Else - Actions
                  • Do nothing
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Does start_loc <gen> contain a unit of Type random_race[3]) Equal to False
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Does start_loc <gen> contain a unit of Type Blacksmith) Equal to False
                    • Then - Actions
                      • Unit - Create 1 Blacksmith for (Triggering player) at (starting_location[(Player number of (Triggering player))] offset by (800.00, 150.00)) facing Default building facing (270.0) degrees
                    • Else - Actions
                      • Do nothing
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Does start_loc <gen> contain a unit of Type random_race[4]) Equal to False
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Does start_loc <gen> contain a unit of Type Blacksmith) Equal to False
                        • Then - Actions
                          • Unit - Create 1 Blacksmith for (Triggering player) at (starting_location[(Player number of (Triggering player))] offset by (800.00, 150.00)) facing Default building facing (270.0) degrees
                        • Else - Actions
                          • Do nothing
                    • Else - Actions
                      • Do nothing
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
Isn't there another message you see just above that? (Starting with Line ...: <ERROR TYPE>)

Also, I suggest you remove all 'Do Nothing' commands from the Else - Actions. There's no need for them, and they seem to still need to be performed as an actions (so I've heared), so it's only annoying to add them if not necessary.
 
Level 4
Joined
Oct 15, 2008
Messages
77
the error when i got that was "name expected" or w/e, and thanks for the heads up on removing do nothings, and what do you mean by nest my if/then/else's?
 
Level 24
Joined
May 9, 2007
Messages
3,563
Put the if/the/else's inside of each other. That way it reduces the number of checks it has t do. If its this, then it stops checking and does the actions. They way you have it now, even if the first check is true, it will still try the others.
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
Remember that hawk900's way is for when you need only 1 of the If/Then/Else triggers to activate. If you want multiple Then - Actions to activate, don't put them in the Else command of the other trigger that also has to activate.
 
Level 5
Joined
Nov 14, 2007
Messages
161
if ( not ( UnitTypeIsInRegion(gg_rct_start_loc, 'hbla') == false ) ) then

what type of array is random_race[x] and are u sure that 1-4 have values? i think it's crashing because random_race[x] is set to null or not set yet.
 
Last edited:
Level 4
Joined
Oct 15, 2008
Messages
77
random race[x] is a unit-type array thats the main Hall. they have their values set in the map intialization trigger
 
Status
Not open for further replies.
Top