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

how can i make a building work only when garrisoned

Status
Not open for further replies.
Level 21
Joined
Mar 2, 2010
Messages
3,069
i am thinking of porting rising lands to warcraft 3. there each building is operated by settlers(i believe they are called) which garrisons inside the buildings in order to run them and make them player controlled.(ungarrisoned buildings are neutral). i have been focusing on figuring out the gameplay mechanics before i start working as it is only going to be a 7 day project. please help me out. i would after all have helped you out with your problems.
 
Level 12
Joined
Jun 15, 2016
Messages
472
I'd create a trigger in which when a unit is ordered targeting a natural building (you'll need to give some kind of condition like assigning a value to them), it disappears (the settler enters the building, right?) and changes the controlling player of the building to your player.

I guess that means you should also add a sort of cancel or remove button to the building, but I don't know of anyway to do that except for making a custom ability and adding it manually to all buildings.
 
Level 19
Joined
Jul 2, 2011
Messages
2,162
use the orcs burrow ability

it activates the attack ability when peons garrison building

use just need to specify what unit the garrison ability responds too and how many units can enter

as for changing a neutral building to yours, make it so when a building is destroyed it is replaced by a replica of the same building under the ownership of the unit who destroys It

this saves you the trouble of creating another trig for enemy attacks on your buildings
 
Level 13
Joined
Jan 2, 2016
Messages
973
I'd do something like:
Event: a unit gets in range (of the building(s) you want)
Actions: If the building belongs to neutral passive - change the owner of the building to the owner of the triggering unit.
else if it belongs to an enemy player - count all the units, owned by that player in range xxx from the building; if they are 0 - change the owner again (else do nothing)

You will find some difficulties as once you've killed the enemy units - you'd need to get one unit further away, and then make it come back in order to take the building, but you could make more triggers to fix that.
 
use the orcs burrow ability

it activates the attack ability when peons garrison building

use just need to specify what unit the garrison ability responds too and how many units can enter

as for changing a neutral building to yours, make it so when a building is destroyed it is replaced by a replica of the same building under the ownership of the unit who destroys It

this saves you the trouble of creating another trig for enemy attacks on your buildings

it wont work on Neutral buildings. That ability works only for your buildings. He said that his buildings are initially neutral.
 
Status
Not open for further replies.
Top