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

Building on top of another building

Status
Not open for further replies.
Level 4
Joined
Aug 13, 2006
Messages
47
I'm trying to add navy to a map in this way:
on the map there are several neutral buidings called "Pier".
To build a shipyard you have to build it on thop of that pier, much like the undead can only build their haunted gold mines on top of a gold mine.

I failed to find a way of doing that myself, so I turned to this forum for enlightenment.
 
Level 14
Joined
Aug 31, 2009
Messages
775
Using a gold mine and the Haunted Gold mine as you mention is quite probably the best idea.

Of course, change the models, remove Minimap display for the pier (gets rid of the gold circle icon - you could even import your own minimap icon like an Anchor or something).

It will work like that, but do remember the 'Pier' building must have the gold mine ability or the Haunting Method will not work.
 
Level 14
Joined
Aug 31, 2009
Messages
775
That would also work.

Something along the lines of checking if there is a Pier Building within a Radius of 20 (or anything else VERY small) around the center of one of your constructed buildings - therefore checking it's nearly completely on top of the pier building. If there isn't one, destroy the building, give an error message to the player; refund gold etc. etc.

Drawbacks to this method:
The building becomes buildable in some very odd places (on trees, cliffs etc) but it will at least destroy the building a few seconds later if you made it a periodic check for the nearby pier.
 
Use this trigger that checks if there is a pier near the construction place:
  • Pier
    • Events
      • Unit - A unit Begins construction
    • Conditions
      • (Constructing structure) Equal to Naval Dock
    • Actions
      • Unit Group - Pick every unit in (Units within 400.00 of (Position of (Constructing structure))) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Pier
            • Then - Actions
              • Skip remaining actions
            • Else - Actions
      • Unit - Kill (Constructing structure)
      • Player - Add Pier'sGoldCost to (Owner of (Constructing structure)) Current gold
      • Player - Add Pier'sLumberCost to (Owner of (Constructing structure)) Current lumber
 
Status
Not open for further replies.
Top