• 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.

Building *only* next to other buildings?

Status
Not open for further replies.
Level 1
Joined
Apr 8, 2006
Messages
3
I'm building a map based off of the old Dungeon Keeper games.
I'm not bad with triggering, but I'm having a really tough time figuring out an easy-ish way to work part of the map.
I've got an underground area with Imps that can dig (attack) through rock (destructibles). Another ability of the Imps is to pave a dug out area, bringing it under your control.
Right now the paving tiles are buildings that have no model and no pathing texture, just pavement, and each tile is upgradeable to different room types.
Firstly, I want the player to only be able to pave (build) next to areas that have already been paved, sorta like the roads in old Warcraft.
Secondly, since paving is a lot of micromanagement, I'd like it if you could start an Imp on paving, and have him continue on his merry way, down corridors, through rooms, and around corners. I'm trying to figure out how to get him to check all four directions for empty spots to pave on his own, but I'm having trouble.
Any help?
 
Level 1
Joined
Apr 8, 2006
Messages
3
Well, since nobody replied, I figured I'd post what I figured out.
Each player now has a region 3 cells wide x 1 cell tall and a region 1 cell wide x 3 cells tall. Whenever one of my imps begins building a floor tile these regions are centered on the tile being created and form a + sign, covering any adjacent existing tiles and becoming detectable by a trigger.

As far as the auto build, each imp is told after completing a job to build a building at his position offset by one cell to the right, then down, left, and up. He seems to try each direction and take whichever command sticks first.
I even put in a command for each player to turn a boolean true or false and have the trigger check this to figure out whether the player wants his imps to continue.
I also put in a command to set imps to jump in on other imps paving jobs, and a command to set a boolean deciding if they pave in straightforward patterns or in random fashion.

Explaining the exact triggers would take too long, but suffice it to say that it works, and it is possible!
 
Status
Not open for further replies.
Top