• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Undead mine remove

Status
Not open for further replies.
Level 12
Joined
Nov 20, 2007
Messages
660
Hello guys, i'm trying to make a modificated Melee Map and i have a "remake" command which "recreate" the map. The problem is that if any one has race Undead, a mine is created so i they will have 2 mines.
Start
  • Events
    • Player - Player 1 (Red) types a chat message containing !start as An exact match
  • Conditions
  • Actions
    • Set Game_PointLeak = (Center of Goldmine1 <gen>)
    • Unit - Create 1 Gold Mine for Neutral Passive at Game_PointLeak facing Default building facing degrees
    • Unit Group - Add (Last created unit) to Game_GoldMines
    • Set Game_PointLeak = (Center of Goldmine2 <gen>)
    • Unit - Create 1 Gold Mine for Neutral Passive at Game_PointLeak facing Default building facing degrees
    • Unit Group - Add (Last created unit) to Game_GoldMines
    • Set Game_PointLeak = (Center of Goldmine3 <gen>)
    • Unit - Create 1 Gold Mine for Neutral Passive at Game_PointLeak facing Default building facing degrees
    • Unit Group - Add (Last created unit) to Game_GoldMines
    • Set Game_PointLeak = (Center of Goldmine4 <gen>)
    • Unit - Create 1 Gold Mine for Neutral Passive at Game_PointLeak facing Default building facing degrees
    • Unit Group - Add (Last created unit) to Game_GoldMines
    • Destructible - Pick every destructible in (Playable map area) and do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ((Picked destructible) is dead) Equal to True
          • Then - Actions
            • Destructible - Resurrect (Picked destructible) with (Max life of (Picked destructible)) life and Show birth animation
          • Else - Actions
    • Set Game_PointLeak = (Center of (Playable map area))
    • Unit - Create 1 Dummy for Neutral Passive at Game_PointLeak facing Default building facing degrees
    • Unit - Order (Last created unit) to Night Elf Wisp - Detonate Game_PointLeak
    • Custom script: call RemoveLocation(udg_Game_PointLeak)
    • Melee Game - Use melee time of day (for all players)
    • Melee Game - Limit Heroes to 1 per Hero-type (for all players)
    • Melee Game - Give trained Heroes a Scroll of Town Portal (for all players)
    • Melee Game - Set starting resources (for all players)
    • Melee Game - Remove creeps and critters from used start locations (for all players)
    • Melee Game - Create starting units (for all players)
    • Melee Game - Run melee AI scripts (for computer players)
    • Trigger - Turn off Shuffle Players <gen>
 
Level 7
Joined
May 13, 2011
Messages
310
Does it do this for Night Elves as well or only Undead?
Also, what I'm assuming happens is that when you do this any Undead team get's a normal Goldmine in addition to a Haunted Goldmine, correct?
 
Level 5
Joined
Sep 1, 2010
Messages
168
I'd recommend storing the goldmines in a game cache on start of map.
When recreating the map, simply load the start values of those units and they'll be as they were at second one.

One important note though: if you're making a custom melee map, you should have a work around for every research, since warcraft can't (in contrast to starcraft II) revert done researches.
 
Level 12
Joined
Nov 20, 2007
Messages
660
I'd recommend storing the goldmines in a game cache on start of map.
When recreating the map, simply load the start values of those units and they'll be as they were at second one.

One important note though: if you're making a custom melee map, you should have a work around for every research, since warcraft can't (in contrast to starcraft II) revert done researches.

Thanks about research, but the store i'm not sure if it's gonna work
 
Level 5
Joined
Sep 1, 2010
Messages
168
Storing actually works fine.. just as a little example: follow the link of my singature -> when you open the map in worldeditor, you'll notice somewhere a few disabled triggers featuring some remake stuff.. enable them, test the map, let your ziggurat get killed, then type -remake and see if you get your ziggurat back :)
->Stored units^^
Should be same for gold mines, except you might need to set the gold value again.
And no, this is no advertisement of my td -> project is temporary on ice since I'm stuck with university stuff and have trouble fixing some triggers,ruining the whole game :X
 
Level 12
Joined
Nov 20, 2007
Messages
660
Storing actually works fine.. just as a little example: follow the link of my singature -> when you open the map in worldeditor, you'll notice somewhere a few disabled triggers featuring some remake stuff.. enable them, test the map, let your ziggurat get killed, then type -remake and see if you get your ziggurat back :)
->Stored units^^
Should be same for gold mines, except you might need to set the gold value again.
And no, this is no advertisement of my td -> project is temporary on ice since I'm stuck with university stuff and have trouble fixing some triggers,ruining the whole game :X

i enabled the trigger, i typed "-rmk" but nothing happend (only shows the message)
Edit : i will find another way to achive my system, thanks anyway +rep
 
Level 5
Joined
Sep 1, 2010
Messages
168
Sorry, seemed that is an older version (haven't updated in a while). Might be a version before I tried implementing the remake..
Should have been something like this (1&3 should be interesting for you, 2 in only to run number 3):
  • Game Cache
    • Ereignisse
      • Map initialization
    • Bedingungen
    • Aktionen
      • Auslöser - Turn off (This trigger)
      • Spiel-Cache - Create a game cache from ZigguratTD.w3v
      • Spiel-Cache - Store Ancient Ziggurat 0014 <gen> as 1 of Ziggurats in (Last created game cache)
      • Spiel-Cache - Store Ancient Ziggurat 0017 <gen> as 2 of Ziggurats in (Last created game cache)
      • Spiel-Cache - Store Ancient Ziggurat 0016 <gen> as 3 of Ziggurats in (Last created game cache)
      • Spiel-Cache - Store Ancient Ziggurat 0015 <gen> as 4 of Ziggurats in (Last created game cache)
      • Spiel-Cache - Save (Last created game cache)

  • WIP RMK command
    • Ereignisse
      • Spieler - Spieler 1 (Rot) types a chat message containing -rmk as Exakte Übereinstimmung
      • Spieler - Spieler 1 (Rot) types a chat message containing -remake as Exakte Übereinstimmung
      • Spieler - Spieler 2 (Blau) types a chat message containing -rmk as Exakte Übereinstimmung
      • Spieler - Spieler 2 (Blau) types a chat message containing -remake as Exakte Übereinstimmung
      • Spieler - Spieler 3 (Blaugrau) types a chat message containing -rmk as Exakte Übereinstimmung
      • Spieler - Spieler 3 (Blaugrau) types a chat message containing -remake as Exakte Übereinstimmung
      • Spieler - Spieler 4 (Lila) types a chat message containing -rmk as Exakte Übereinstimmung
      • Spieler - Spieler 4 (Lila) types a chat message containing -remake as Exakte Übereinstimmung
    • Bedingungen
      • Remake_Total_Counter Kleiner als 4
    • Aktionen
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • Remake_Counter[(Player number of (Triggering player))] Gleich 0
        • 'THEN'-Aktionen
          • Set Remake_Total_Counter = (Remake_Total_Counter + 1)
          • Set Remake_Counter[(Player number of (Triggering player))] = 1
        • 'ELSE'-Aktionen
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • Remake_Total_Counter Kleiner als 4
        • 'THEN'-Aktionen
          • Spiel - Display to (All players) the text: (((Name of (Triggering player)) + has voted for a remake. ) + ((String((4 - Remake_Total_Counter))) + more votes are needed to pass.))
        • 'ELSE'-Aktionen
          • Spiel - Display to (All players) the text: All Players have ag...
          • Wait 5.00 seconds
          • Spiel - Pause the game
          • Auslöser - Run remake function <gen> (ignoring conditions)
          • -------- now needed: restore units, restore research levels, reload units, run triggers ignoring conditions, kill all units,.... --------

  • remake function
    • Ereignisse
    • Bedingungen
    • Aktionen
      • Einheitengruppe - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Schleifen - Aktionen
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • ((Picked unit) is dead) Gleich False
              • (Unit-type of (Picked unit)) Ungleich Watch Guard
            • 'THEN'-Aktionen
              • Einheit - Remove (Picked unit) from the game
            • 'ELSE'-Aktionen
      • Spiel-Cache - Reload all game cache data from disk
      • Spiel-Cache - Restore 1 of Ziggurats from (Last created game cache) for Spieler 1 (Rot) at (Center of Target Creeps Player 1 <gen>) facing (Center of (Playable map area))
      • Spiel-Cache - Restore 2 of Ziggurats from (Last created game cache) for Spieler 2 (Blau) at (Center of Target Creeps Player 2 <gen>) facing (Center of (Playable map area))
      • Spiel-Cache - Restore 3 of Ziggurats from (Last created game cache) for Spieler 3 (Blaugrau) at (Center of Target Creeps Player 3 <gen>) facing (Center of (Playable map area))
      • Spiel-Cache - Restore 4 of Ziggurats from (Last created game cache) for Spieler 4 (Lila) at (Center of Target Creeps Player 4 <gen>) facing (Center of (Playable map area))
      • Wait 1.00 seconds
      • Spiel - Unpause the game
 
Level 12
Joined
Nov 20, 2007
Messages
660
Sorry, seemed that is an older version (haven't updated in a while). Might be a version before I tried implementing the remake..
Should have been something like this (1&3 should be interesting for you, 2 in only to run number 3):
  • Game Cache
    • Ereignisse
      • Map initialization
    • Bedingungen
    • Aktionen
      • Auslöser - Turn off (This trigger)
      • Spiel-Cache - Create a game cache from ZigguratTD.w3v
      • Spiel-Cache - Store Ancient Ziggurat 0014 <gen> as 1 of Ziggurats in (Last created game cache)
      • Spiel-Cache - Store Ancient Ziggurat 0017 <gen> as 2 of Ziggurats in (Last created game cache)
      • Spiel-Cache - Store Ancient Ziggurat 0016 <gen> as 3 of Ziggurats in (Last created game cache)
      • Spiel-Cache - Store Ancient Ziggurat 0015 <gen> as 4 of Ziggurats in (Last created game cache)
      • Spiel-Cache - Save (Last created game cache)

  • WIP RMK command
    • Ereignisse
      • Spieler - Spieler 1 (Rot) types a chat message containing -rmk as Exakte Übereinstimmung
      • Spieler - Spieler 1 (Rot) types a chat message containing -remake as Exakte Übereinstimmung
      • Spieler - Spieler 2 (Blau) types a chat message containing -rmk as Exakte Übereinstimmung
      • Spieler - Spieler 2 (Blau) types a chat message containing -remake as Exakte Übereinstimmung
      • Spieler - Spieler 3 (Blaugrau) types a chat message containing -rmk as Exakte Übereinstimmung
      • Spieler - Spieler 3 (Blaugrau) types a chat message containing -remake as Exakte Übereinstimmung
      • Spieler - Spieler 4 (Lila) types a chat message containing -rmk as Exakte Übereinstimmung
      • Spieler - Spieler 4 (Lila) types a chat message containing -remake as Exakte Übereinstimmung
    • Bedingungen
      • Remake_Total_Counter Kleiner als 4
    • Aktionen
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • Remake_Counter[(Player number of (Triggering player))] Gleich 0
        • 'THEN'-Aktionen
          • Set Remake_Total_Counter = (Remake_Total_Counter + 1)
          • Set Remake_Counter[(Player number of (Triggering player))] = 1
        • 'ELSE'-Aktionen
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • Remake_Total_Counter Kleiner als 4
        • 'THEN'-Aktionen
          • Spiel - Display to (All players) the text: (((Name of (Triggering player)) + has voted for a remake. ) + ((String((4 - Remake_Total_Counter))) + more votes are needed to pass.))
        • 'ELSE'-Aktionen
          • Spiel - Display to (All players) the text: All Players have ag...
          • Wait 5.00 seconds
          • Spiel - Pause the game
          • Auslöser - Run remake function <gen> (ignoring conditions)
          • -------- now needed: restore units, restore research levels, reload units, run triggers ignoring conditions, kill all units,.... --------

  • remake function
    • Ereignisse
    • Bedingungen
    • Aktionen
      • Einheitengruppe - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Schleifen - Aktionen
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • ((Picked unit) is dead) Gleich False
              • (Unit-type of (Picked unit)) Ungleich Watch Guard
            • 'THEN'-Aktionen
              • Einheit - Remove (Picked unit) from the game
            • 'ELSE'-Aktionen
      • Spiel-Cache - Reload all game cache data from disk
      • Spiel-Cache - Restore 1 of Ziggurats from (Last created game cache) for Spieler 1 (Rot) at (Center of Target Creeps Player 1 <gen>) facing (Center of (Playable map area))
      • Spiel-Cache - Restore 2 of Ziggurats from (Last created game cache) for Spieler 2 (Blau) at (Center of Target Creeps Player 2 <gen>) facing (Center of (Playable map area))
      • Spiel-Cache - Restore 3 of Ziggurats from (Last created game cache) for Spieler 3 (Blaugrau) at (Center of Target Creeps Player 3 <gen>) facing (Center of (Playable map area))
      • Spiel-Cache - Restore 4 of Ziggurats from (Last created game cache) for Spieler 4 (Lila) at (Center of Target Creeps Player 4 <gen>) facing (Center of (Playable map area))
      • Wait 1.00 seconds
      • Spiel - Unpause the game

Oh, thank you little GOD. It worked :ogre_hurrhurr: thanks !!
 
Status
Not open for further replies.
Top