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

Help with WE replacement and set townhall and defeat triggers

Status
Not open for further replies.
Level 6
Joined
Mar 19, 2016
Messages
113
Hello everyone.
I'm here to ask for help for WE replace Town hall/Great Hall/Tree of Life/ Necropolis with a custom building. Also for the "reveal townhall" since the custom Town Halls I've made reveals players.
I'm not proficient with triggers, please make it simple and easy.
 
Okay the unit references are hardcoded into "Blizzards-Create Starting Units"-Action, either you change the orginal ones or you Replace them after they are created.

For Replacing
You'll need to Loop through all Buildings of all Players and Replace them with the new ones.
Townhall_Types are Unit-Types
  • Nahkampf-Initialisierung
    • Ereignisse
      • Map initialization
    • Bedingungen
    • Aktionen
      • Set Old_Townhall_Type[1] = Rathaus
      • Set Old_Townhall_Type[2] = Haupthaus
      • Set Old_Townhall_Type[3] = Nekropole
      • Set Old_Townhall_Type[4] = Baum des Lebens
      • -------- Inserer yours Here --------
      • -------- Human, Orc, Undead, Nightelf --------
      • Set New_Townhall_Type[1] = Rathaus
      • Set New_Townhall_Type[2] = Haupthaus
      • Set New_Townhall_Type[3] = Nekropole
      • Set New_Townhall_Type[4] = Baum des Lebens
      • -------- Basic Setup --------
      • Nahkampf-Spiel - Use melee time of day (for all players)
      • Nahkampf-Spiel - Limit Heroes to 1 per Hero-type (for all players)
      • Nahkampf-Spiel - Give trained Heroes a Scroll of Town Portal (for all players)
      • Nahkampf-Spiel - Set starting resources (for all players)
      • Nahkampf-Spiel - Remove creeps and critters from used start locations (for all players)
      • Nahkampf-Spiel - Create starting units (for all players)
      • Nahkampf-Spiel - Run melee AI scripts (for computer players)
      • Nahkampf-Spiel - Enforce victory/defeat conditions (for all players)
      • -------- Replace Townhalls --------
      • -------- Auto Clean next Created-Group --------
      • Custom script: set bj_wantDestroyGroup=true
      • Einheitengruppe - Pick every unit in (Units in (Playable map area) matching (((Matching unit) is Unit is Townhall) equal True)) and do (Actions)
        • Schleifen - Aktionen
          • For each (Integer A) from 1 to 4, do (Actions)
            • Schleifen - Aktionen
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of (Picked unit)) equal Old_Townhall_Type[(Integer A)]
                • Then - Action
                  • Unit - Replace (Picked unit) with a New_Townhall_Type[(Integer A)] using Alte Einheit: Rel. life and mana
                • Else - Action
 
Level 6
Joined
Mar 19, 2016
Messages
113
Okay the unit references are hardcoded into "Blizzards-Create Starting Units"-Action, either you change the orginal ones or you Replace them after they are created.

For Replacing
You'll need to Loop through all Buildings of all Players and Replace them with the new ones.
Townhall_Types are Unit-Types
  • Nahkampf-Initialisierung
    • Ereignisse
      • Map initialization
    • Bedingungen
    • Aktionen
      • Set Old_Townhall_Type[1] = Rathaus
      • Set Old_Townhall_Type[2] = Haupthaus
      • Set Old_Townhall_Type[3] = Nekropole
      • Set Old_Townhall_Type[4] = Baum des Lebens
      • -------- Inserer yours Here --------
      • -------- Human, Orc, Undead, Nightelf --------
      • Set New_Townhall_Type[1] = Rathaus
      • Set New_Townhall_Type[2] = Haupthaus
      • Set New_Townhall_Type[3] = Nekropole
      • Set New_Townhall_Type[4] = Baum des Lebens
      • -------- Basic Setup --------
      • Nahkampf-Spiel - Use melee time of day (for all players)
      • Nahkampf-Spiel - Limit Heroes to 1 per Hero-type (for all players)
      • Nahkampf-Spiel - Give trained Heroes a Scroll of Town Portal (for all players)
      • Nahkampf-Spiel - Set starting resources (for all players)
      • Nahkampf-Spiel - Remove creeps and critters from used start locations (for all players)
      • Nahkampf-Spiel - Create starting units (for all players)
      • Nahkampf-Spiel - Run melee AI scripts (for computer players)
      • Nahkampf-Spiel - Enforce victory/defeat conditions (for all players)
      • -------- Replace Townhalls --------
      • -------- Auto Clean next Created-Group --------
      • Custom script: set bj_wantDestroyGroup=true
      • Einheitengruppe - Pick every unit in (Units in (Playable map area) matching (((Matching unit) is Unit is Townhall) equal True)) and do (Actions)
        • Schleifen - Aktionen
          • For each (Integer A) from 1 to 4, do (Actions)
            • Schleifen - Aktionen
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of (Picked unit)) equal Old_Townhall_Type[(Integer A)]
                • Then - Action
                  • Unit - Replace (Picked unit) with a New_Townhall_Type[(Integer A)] using Alte Einheit: Rel. life and mana
                • Else - Action
Right, it seems to be the same as the one in the Custom Race tutorial.
 
Status
Not open for further replies.
Top