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

[Trigger] Custom Race Map

Status
Not open for further replies.
Level 25
Joined
May 11, 2007
Messages
4,651
  • Race Selection Setup
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
  • //Here you have a pretty big flaw, first you select all players, you check if a player is a computer player then you pick all players AGAIN and check their race, so for each computer player you're going to create an additional base.
    • Else - Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked player) controller) Equal to Computer
            • Then - Actions
              • Player Group - Pick every player in (All players) and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Race of (Picked player)) Equal to Human
                    • Then - Actions
                      • Melee Game - Create Human starting units for (Triggering player) at ((Triggering player) start location) (Include Heroes)
                    • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Race of (Picked player)) Equal to Orc
                    • Then - Actions
                      • Melee Game - Create Orc starting units for (Triggering player) at ((Triggering player) start location) (Include Heroes)
                    • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Race of (Picked player)) Equal to Undead
                    • Then - Actions
                      • Melee Game - Create Undead starting units for (Triggering player) at ((Triggering player) start location) (Include Heroes)
                    • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Race of (Picked player)) Equal to Night Elf
                    • Then - Actions
                      • Melee Game - Create Night Elf starting units for (Triggering player) at ((Triggering player) start location) (Include Heroes)
                    • Else - Actions
            • Else - Actions
    • Trigger - Turn on Race Selection Pick <gen>
Just use this for the dialog:
  • Race Selection Setup
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked player) controller) Equal to User
            • Then - Actions
              • Dialog - Change the title of Race_Dialog to Race Selection
              • Dialog - Create a dialog button for Race_Dialog labelled Humans
              • Set Race_Dialog_Buttons[0] = (Last created dialog Button)
              • Dialog - Create a dialog button for Race_Dialog labelled Orcs
              • Set Race_Dialog_Buttons[1] = (Last created dialog Button)
              • Dialog - Create a dialog button for Race_Dialog labelled Undead Scourge
              • Set Race_Dialog_Buttons[2] = (Last created dialog Button)
              • Dialog - Create a dialog button for Race_Dialog labelled Night Elf
              • Set Race_Dialog_Buttons[3] = (Last created dialog Button)
              • Dialog - Create a dialog button for Race_Dialog labelled Forsaken
              • Set Race_Dialog_Buttons[4] = (Last created dialog Button)
            • Else - 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
              • ((Player((Integer A))) controller) Equal to User
            • Then - Actions
              • Dialog - Show Race_Dialog for (Player((Integer A)))
            • Else - Actions
      • Trigger - Turn on Race Selection Pick <gen>
and this for the computers:
  • Computers Init
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked player) controller) Equal to Computer
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Race of (Picked player)) Equal to Human
                • Then - Actions
                  • Melee Game - Create Human starting units for (Triggering player) at ((Triggering player) start location) (Include Heroes)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Race of (Picked player)) Equal to Orc
                • Then - Actions
                  • Melee Game - Create Orc starting units for (Triggering player) at ((Triggering player) start location) (Include Heroes)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Race of (Picked player)) Equal to Undead
                • Then - Actions
                  • Melee Game - Create Undead starting units for (Triggering player) at ((Triggering player) start location) (Include Heroes)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Race of (Picked player)) Equal to Night Elf
                • Then - Actions
                  • Melee Game - Create Night Elf starting units for (Triggering player) at ((Triggering player) start location) (Include Heroes)
                • Else - Actions
            • Else - Actions
Will check more soon, food time.
 
Last edited:
Level 25
Joined
May 11, 2007
Messages
4,651
I checked some of your abilities, might want to change the hotkeys for them as the hotkey 'S' is used by the Stop command button. (Sacrifice ability, Shadow Arrow)
H = Hold Position, (Hand of Death), I much more prefer QWERTY hotkeys.

Might want to change the race of the Servants (Worker unit) to either Human (Multiple units can build) or orcs (1 builder) as of right now they summon a building but it looks like they're building it. It won't affect their race classification.

I tested around, it's your Computer Init trigger that removes the gold mines when it creates starting units. Why, I don't really know but you should try placing the units manually instead.

Oh and leaks.
 
Level 25
Joined
May 11, 2007
Messages
4,651
Everytime you create a unit, move a camera etc to a point that you do not save in a variable that you later destroy in Warcraft 3, you "leak" it, as in that Warcraft 3 removes all references to it but it's still saved in the memory of the game.

So the longer you play your game with non-removed leaks, the more memory it's going to use up and eventually cause the players to start getting frame-drops / disconnect.


So instead of doing this:
  • create unit BAD WAY
    • Events
    • Conditions
    • Actions
      • Unit - Create 1 Footman for Player 1 (Red) at (Center of Region 001 <gen>) facing Default building facing degrees
You do this:
  • create unit NO LEAKS YAY
    • Events
    • Conditions
    • Actions
      • Set tempPoint1 = (Center of Region 001 <gen>)
      • Unit - Create 1 Footman for Player 1 (Red) at tempPoint1 facing Default building facing degrees
      • Custom script: call RemoveLocation( udg_tempPoint1 )
And the memory can be used for something else, it's a bit annyoing in the beginning but once you get used to it's easier. Read the thread (link!) for more about them leaks.
 
Status
Not open for further replies.
Top