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

Spawning an Undead Gold Mine on a Gold Mine

Status
Not open for further replies.
Level 2
Joined
Feb 25, 2013
Messages
7
Hey there!

I'm making this map, and it has a Race Pick system (Quite simple, but it works.) and I've deleted most of the standard Map Init. triggers. One disadvantage of this is, that when I spawn the Undead Necropolis and the acolytes + ghoul, it doesn't spawn a Gold Mine for the Undead.

Is there a simple way (With the GUI ONLY), that you can tell it to spawn an Undead Gold Mine on top of the nearest Gold Mine, which is close to the Triggering Player's spawn location.

Hope you can help me :ogre_haosis:

Thanks on forehand
- Stormman67
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
This is made of 2 parts.
First you find the closest gold mine, then replace it with a blighted one.

EDIT: Instead of a long and hard to understand explanation I'll just show a sample trigger.

  • Untitled Trigger 001
    • Events
    • Conditions
    • Actions
      • Set TempGroup = (Units of type Gold Mine)
      • Set TempReal = 0.00
      • Set TempPointA = (Player 1 (Red) start location)
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Set TempPointB = (Position of (Picked unit))
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Distance between TempPointA and TempPointB) Less than (<) TempReal
              • Then - Actions
                • Set TempReal = (Distance between TempPointA and TempPointB)
                • Set TempUnit = (Picked unit)
              • Else - Actions
          • Custom script: call RemoveLocation(udg_TempPointB)
      • Unit - Replace TempUnit with a Haunted Gold Mine using The old unit's relative life and mana
      • Unit - Change ownership of (Last replaced unit) to Player 1 (Red) and Change color
 
Status
Not open for further replies.
Top