• 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.
  • 💡 We're thrilled to announce that our upcoming texturing contest is in the works, and we're eager to hear your suggestions! Please take this opportunity to share your ideas in this theme discussion thread for the Texturing Contest #34!
  • 🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen masterpiece! 🔗 Click here to enter!

[Spell] An aid to program this.

Status
Not open for further replies.
Level 4
Joined
Mar 15, 2011
Messages
39
Hi, I'm editing a similar age of empires map. My problem is that I want that when a player builds its town center, the other players can only build your respective city center to a given distance. I also wish that buildings such as houses can only be created in a radius around the city center. I thank them for their help, because I have no idea how to program this XD.
 
On start construction event

Get city center of building player

If unit type id is your target

Use distance formula to get distance. If too far, cancel order

You can also compare distance to every other city center with a group enumeration. If too far, do whatever. If too close, etc. There is a native called IsUnitAlly as well if I'm not mistaken. You can also check player ids.

To cancel order, it's an IssueImmediateOrder I think. Check my sig for a list of orders. Don't know where I put it, dig around.

Pretty trivial to code this :)
 
Status
Not open for further replies.
Top