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

[General] How to disable building in a certain region?

Do you like Bannanas?

  • Maybe.

    Votes: 0 0.0%
  • No.

    Votes: 0 0.0%

  • Total voters
    5
  • Poll closed .
Status
Not open for further replies.
Level 7
Joined
Mar 9, 2016
Messages
226
I'm working on a new version of my map, (cant be found on Hive yet, its listed at makemehost.com)
How can I disable building in a certain region? There's this no pvp safe zone, which is the spawn area and err, I don't want players to build there. Its a city with shops, trainers, etc.
 
Level 7
Joined
Mar 9, 2016
Messages
226
Put tiles on which you can't build ?
Nope, there's buildings in there. I don't want it to be a place without buildings completely. As I said there's shops, etc in there.

I mean, maybe I could make those buildings buildable on 'any' terrain, etc. However the problem is, I cant afford to add any more tiles to the tileset. There's 3 continents each with different tile designs, i'd have to remove some to add the unbuildable ones. :r

Here's the overview of the city
Screenshot
Here's the minimap
Screenshot
 
Last edited:
Level 7
Joined
Mar 9, 2016
Messages
226
Well, I came with a temporary solution until someone replies with a real one. :p
Screenshot
Its basically a patch up, i'd prefer a pure-er system.
Though it doesn't really give it a minus, cosmetically speaking.
 
Level 15
Joined
Sep 6, 2015
Messages
576
A very simple solution:

Create a region over that whole area and use this trigger:

  • Destroy Building
    • Events
      • Unit - A unit Begins construction
    • Conditions
      • (Region 000 <gen> contains (Position of (Constructing structure))) Equal to True
    • Actions
      • Unit - Kill (Constructing structure)
This will destroy any building built in that region.
 
Level 15
Joined
Sep 6, 2015
Messages
576
Yeah but then you lose the building's gold/lumber costs.
Then you add actions before that Kill action to compensate the cost:

If type of constructing unit equal to Farm
Set Triggering Player gold to Current gold + gold cost of the farm
Set Triggering Player lumber to Current lumber + lumber cost of the farm​
If type of constructing unit equal to Barracks
Set Triggering Player gold to Current gold + gold cost of the barracks
Set Triggering Player lumber to Current lumber + lumber cost of the barracks​
etc.

You do this for each building that can be constructed.
 
Level 7
Joined
Mar 9, 2016
Messages
226
Maybe you can do it by putting unbuildable tiles around the shops ?
As I said before, I cannot add anymore tiles to the tile-set.

What about invisible building blockers? Check Custom Pathing Maps.


You basically want a blue custom pathing map of your desired size and give it to a custom invisible platform.
But would that block movement as well?

A very simple solution:

Create a region over that whole area and use this trigger:

  • Destroy Building
    • Events
      • Unit - A unit Begins construction
    • Conditions
      • (Region 000 <gen> contains (Position of (Constructing structure))) Equal to True
    • Actions
      • Unit - Kill (Constructing structure)
This will destroy any building built in that region.
Yeah, the same thing is in FOTN.

Yeah but then you lose the building's gold/lumber costs.
Same with FOTN, maybe add a warning at the beginning of the map.

Then you add actions before that Kill action to compensate the cost:

If type of constructing unit equal to Farm
Set Triggering Player gold to Current gold + gold cost of the farm
Set Triggering Player lumber to Current lumber + lumber cost of the farm​
If type of constructing unit equal to Barracks
Set Triggering Player gold to Current gold + gold cost of the barracks
Set Triggering Player lumber to Current lumber + lumber cost of the barracks​
etc.

You do this for each building that can be constructed.
Yeah but there's like million structures. The techtree, buildings are completely custom and there's literally far too many. It would slow down the game loading the triggers. Maybe there's a better solution for this... Though no idea...
 
Level 7
Joined
Mar 9, 2016
Messages
226
Alok's solution seems to be the best as of now. Thanks, hopefully someone knows a different way to avoid the loss of resources.
 
Level 21
Joined
Dec 4, 2007
Messages
1,478
Using the method i posted requires:
a) 1 custom invisibile destructible with your edited pathing map (you could make it in the size of farms)
b) placement wherever you want to deny building construction

Also: It is only blocking building, not walking, not flying.

I have one lying around so you can just take it and try it out, it's very easy.
 

Attachments

  • 4x4 NoBuilding.tga
    92 bytes · Views: 100

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
You could paint the area as unbuildable. Might need a third party tool to do this as World Edit lacks brushes for the pathing map. No doodads/destructables needed!

A trigger solution would be to process the foundation placement orders and cancel the order if placed inside a specific region/rect. No resources would be deducted as the order was cancelled before the foundation started construction.
 
Level 7
Joined
Mar 9, 2016
Messages
226
Using the method i posted requires:
a) 1 custom invisibile destructible with your edited pathing map (you could make it in the size of farms)
b) placement wherever you want to deny building construction

Also: It is only blocking building, not walking, not flying.

I have one lying around so you can just take it and try it out, it's very easy.
Awesome, this makes it much easier.

You can also do the same thing like A]mun said from units instead of destructible. Using the circle of power, delete its model. Units can walk on it but you cannot build anything on it.
Yeah, makes sense, Thank you.

You could paint the area as unbuildable. Might need a third party tool to do this as World Edit lacks brushes for the pathing map. No doodads/destructables needed!

A trigger solution would be to process the foundation placement orders and cancel the order if placed inside a specific region/rect. No resources would be deducted as the order was cancelled before the foundation started construction.
I see.. Though what do you mean by paint the area unbuildable, how is that do-able?

EDIT: I just realize that those ideas are good but would cause far too much lag. The game would constantly read those invisible units within a frame.
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Though what do you mean by paint the area unbuildable, how is that do-able?
Warcraft III maps have a pathing map file inside their MPQ archive. That pathing map file is nothing more than a giant pathing image, in fact back in RoC beta it was a tga image. Being image like, one could paint pathing directly to it. Just World Edit lacks brushes and instead automatically generates the pathing file on save, hence the need for a third party tool.
 
Level 7
Joined
Mar 9, 2016
Messages
226
I was prioritizing other fixes on the map, back here now.
A very simple solution:

Create a region over that whole area and use this trigger:

  • Destroy Building
    • Events
      • Unit - A unit Begins construction
    • Conditions
      • (Region 000 <gen> contains (Position of (Constructing structure))) Equal to True
    • Actions
      • Unit - Kill (Constructing structure)
This will destroy any building built in that region.

I can't seem to find that condition. Its not region/construction condition.. Its inside another condition.
Unit condition doesn't seem to fit, unless it uses custom variables?
 
Status
Not open for further replies.
Top