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

Necropolis gold mine distance restriction?

Status
Not open for further replies.
Level 12
Joined
May 9, 2009
Messages
735
I am trying to make it so the undead necropolis is affected by the same distance-to-gold mine restriction as the town halls of the other races. It seems like a simple matter but I can't get my head around it. The undead necropolis can always be built next to a gold mine like any regular building, even though I added the exact same 'return gold and lumber' ability to it. I also tried removing it's classification as undead or change its race but it didn't work out.

Anyone know what needs to be done to restrict building the necropolis right up close to the gold mine?
 
Level 12
Joined
May 9, 2009
Messages
735
Eh? If you mean that building the town hall closer doesn't yield advantages I am sure you are mistaken as you would require less builders to gain gold at the same rate.

Besides, I know it is possible to make the necropolis affected by the distance restriction but I would have to create a new unit based on the human or orc town hall and I don't want to resort to that, I am looking if there is any option I can change for the necropolis that already exists.
 
If build click orders could be triggered, there would be a workaround. However it does not seem to be the case.
You mean to evaluate a new, better location and then order to build it there? It would be possible actually:

You have event if unit gets a point order.
Then you can check if order is equal build order of Necropolis: GetIssuedOrderId() == 'unpl'
Last you could make a new order call IssueBuildOrderById(GetTriggerUnit(), 'unpl', x, y)

'unpl' is the rawcode for Necropolis
x,y are new coordinates where you would want to build


Getting best x/y values is an other question. ^^
 
No, I was talking about triggered building click (where you can then afterwards place it somewhere).

Cancel the previous order on top of that to give the idea that it cannot be built there.
Ok, but then he can check if build order is necropolis and then you check for gold mines in range. If there is one you order builder to stop and print a message.
 
Status
Not open for further replies.
Top