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

Unit type within range of unit type

Status
Not open for further replies.

Sinroth

S

Sinroth

Hey, I'm just making a small scenario for fun, and can't seem to be able to get an action to happen off a certain unit type being within range of another unit type. The example in question is that I want a building to be un-buildable within a certain range of itself, so the player will have to spread that building out. Any ideas? Will I have to use Variables? Thanks in advance.

EDIT: Sorry, I just realised that I'm supposed to post this in Triggers & Scripts, so if someone could please move this to the appropriate sub-forum, that'd be great.
 
You'd be better off detecting a buildings construction, then finding all the units matching condition within range of the constructed unit, and removing the constructed unit/refunding the player when you find what you're looking for in the condition.
 
Well you're probably wanting the "Unit begins constructing a unit" event. From here you can check whether or not there are any units in an X radius of the same type and allow the unit to build the structure (leave him be) or disallow it (order him to stop, display message to user).
 
Status
Not open for further replies.
Back
Top