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

Saving Multiple Unit Positions

Status
Not open for further replies.
Level 11
Joined
Aug 11, 2009
Messages
605
I need some triggering help :) basically when a player builds a structure, the point it was built on will be saved to later be used to create a unit at.

So what I need help with is this:

Event - Unit finnishes building a structure (dont know if this exist but anyway, just an even which checks this)

Condition - Unit-type of structure built equal to X

Action - (Save the point it was built on)

---

After this I will have a trigger which creates a unit on the point the structure was built, but also depending on which building was built there will be a specific unit created.

---

If anyone could help me with those 2 triggers I would be really happy, +rep ofc for any help on this.

Thanks in advance!
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
Yes there is such an event. A unit is finished being built. Be aware that it is impossible to get which unit actually finished the building as there may be more than 1 or none at all.

You are after using global variables for this. Store the location into the global along as with the type of unit you want to spawn into another global. Then in your spawn trigger you just read the values in those globals and spawn the units.

If more than 1 of these buildings is possible, then you will need a dynamic memory system made with eithor hashtables or using some array instance management system.
 
Level 11
Joined
Aug 11, 2009
Messages
605
Yes there is such an event. A unit is finished being built. Be aware that it is impossible to get which unit actually finished the building as there may be more than 1 or none at all.

Ok, well who finnished building it does not matter, only which player built it :)

You are after using global variables for this. Store the location into the global along as with the type of unit you want to spawn into another global. Then in your spawn trigger you just read the values in those globals and spawn the units.

If more than 1 of these buildings is possible, then you will need a dynamic memory system made with eithor hashtables or using some array instance management system.

Yes, more than one of these buildings is possible, also up to 6 players would be able to build the same buildings.

It is for a map which works like Legion TD. Do you perhaps know some guid to using hashtables or something like that which could help me with this?

Thanks for the info :)
 
Level 14
Joined
Sep 28, 2011
Messages
968
you can also use group and add the building to the group when build and make a periodical event where each unit in the group is piked and spawn an unit in fonction of the building type at the position of the building also for finding the unit finishing the building use trigering unit
 
Status
Not open for further replies.
Top