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

How to make a building detection?

Status
Not open for further replies.
Level 2
Joined
May 3, 2014
Messages
17
Hello, (this is my first post :) )

Well, I'm trying to make a DOTA-like map, and my project is to allow the user to have really different heroes.
For example, some heroes would be like any other hero: they have to go and kill.
Some others will be more subtle, because they can create buildings that will spawn periodically some troops according to the level of technology the player has.

The problem: To spawn creatures, I though I could ask Warcraft III to scan the map in search of buildings, and then order them to produce the unit needed (a bit like the buildings in castle fight if you know the map (although it is not a DOTA map))...
But I do not find the good trigger event, or action or anything that would help me...

I've tried to go on the Internet to look for informations, but I don't find any...
Can someone help me?
Thanks in advance.
 
Level 2
Joined
May 3, 2014
Messages
17
Thanks for responding so fast, but I think no...
The fact is that I don't know how to select the buildings in order to order them to produce the new unit.
 
Level 4
Joined
Jan 5, 2014
Messages
79
well, you need 2 triggers:

trigger 1

Event: Building is built

Action: Order proper unit to be trained

trigger 2

Event: Unit is trained

Action: Order the building that trained that unit to train the same unit

(I have been working on something simmilar a way back and I think, that when the unit is built, you need to order it to train two units instead of one for some reason, but I dont remember why, just try it out =) )
 
Level 2
Joined
May 3, 2014
Messages
17
That's a good solution.
I think it might work.

However, when the player will research another technology, how can I include it?
 
Level 4
Joined
Jan 5, 2014
Messages
79
ok, you made open WC3 editor =)

EDIT: what should this new technology do? change the building or the unit trained?
 
Level 2
Joined
May 3, 2014
Messages
17
Only the unit trained, but I think I will make another trigger saying:

event: the player researched <tecnology>
conditions: none
actions: wait for a unit to be trained
issue order to the building: stop training + start another production

Your solution works perfectly. Thanks for this. =)
 
Level 2
Joined
May 3, 2014
Messages
17
Is it possible to turn off the sound of the buildings when they produce a unit?
(or decrease the volume a lot)?
 
Status
Not open for further replies.
Top