• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[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.
 
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:
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.
 
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 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.
 
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...
 
Alok's solution seems to be the best as of now. Thanks, hopefully someone knows a different way to avoid the loss of resources.
 
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

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.
 
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:
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.
 
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.
Back
Top