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

Summoned Units and shops

Status
Not open for further replies.
Level 5
Joined
Feb 27, 2009
Messages
115
Hey, I have two problems that I do not know how to code.

The first one is about summoned units. With my AI characters, they make summoned units like normal. However, the summoned units will just stand there unless attacked. Is there any good decent trigger that assigns the summoned units to follow the caster? I've tried but haven't been able to get it to work.

Second, is that I have a building with upgrades that anyone on a team can click on and choose an upgrade. The way how I made this work was for the "upgrades" to actually be dummy units. When an upgrade occurred, the dummy unit would enter the map and immediately disappear due to a trigger.

I use the 'unit enters camera area' (i.e. the map) for the event. A big problem has occurred that while this method works, if I do too many then my map will not function correctly. Apparently too many events for looking for a unit entering map boundaries causes the game to malfunction.

I would be grateful for any advice on how to solve these two problems I've had!
 
Level 6
Joined
Jan 6, 2006
Messages
204
You could solve your first problem by storing your summoned units in a struct and then periodically ordering them to move/attack to the position of your summoner. While looping you have to check if the summoned unit is still alive. If not simply remove/destroy the struct.
 
Status
Not open for further replies.
Top