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

Last created unit in region?

Status
Not open for further replies.
Level 3
Joined
Jan 28, 2009
Messages
42
Hi. I'm working on a hero defence // td like map and i got a huge bump in my road now. I am using a spell called MUI GUI Bet Assault v1. Before i had it like display to all players a text where it took the name of last created unit.
Now it creates the dummy name of the spell instead of the waves name. I need it to take the name of last created unit in region or something like that because its too much work setting each and every waves names.. And i can't delete this spell because it fits so perfectly with my hero. Thanks.
 
Level 7
Joined
Jul 20, 2008
Messages
377
Set the last created (significant) unit to a variable. Do not set dummies to this variable.
 
Level 3
Joined
Jan 28, 2009
Messages
42
Store the value of last created unit to global unit variable.

Hmm..? A bit more explanation please? I am not very good with variables.. all the variable related things done so far in my map is done by my friend.. We are 2 guys working on it but he is away for this week so i kinda need to fix this myself. Can someone explain better? I open trigger Editor --> Click Variables --> ??PUT-INFORMATION-HERE?? :p
Thanks
EDIT: I been looking thru the variables and a few more things now.. Do i have to change the SPELL or the level text? Because this is how it looks so far (done by him)
  • Game - Display to (All players) for 5.00 seconds the text: (|cffff0000Level + ((String(pointer)) + (: |r + ((Name of (Last created unit)) + (|cff00ff00 ( + ((String(EnemyCount[pointer])) + spawned)|r))))))
 
Level 7
Joined
Jul 20, 2008
Messages
377
A variable is basically just a slot that holds a certain type of information. For example, an unit variable stores an unit (you can reference that unit by referring to the variable). You'll want to create a variable called something like... "LastCreatedUnit" and then when you instead of referring to the pre-made last created unit function when you need to get the name of the last created unit, you refer to this variable you created.
 
Level 3
Joined
Jan 28, 2009
Messages
42
A variable is basically just a slot that holds a certain type of information. For example, an unit variable stores an unit (you can reference that unit by referring to the variable). You'll want to create a variable called something like... "LastCreatedUnit" and then when you instead of referring to the pre-made last created unit function when you need to get the name of the last created unit, you refer to this variable you created.

Woah that was a fast reply.. Look at my edit please.. :p
 
Level 7
Joined
Jul 20, 2008
Messages
377
No, whenever you create an unit that you WANT to keep the name for, you just store that unit to a variable. Then when you display the text:

Game - Display to (All players) for 5.00 seconds the text: (|cffff0000Level + ((String(pointer)) + :) |r + ((Name of your variable here) + (|cff00ff00 ( + ((String(EnemyCount[pointer])) + spawned)|r))))))
 
Level 3
Joined
Jan 28, 2009
Messages
42
No, whenever you create an unit that you WANT to keep the name for, you just store that unit to a variable. Then when you display the text:

Game - Display to (All players) for 5.00 seconds the text: (|cffff0000Level + ((String(pointer)) + :) |r + ((Name of your variable here) + (|cff00ff00 ( + ((String(EnemyCount[pointer])) + spawned)|r))))))


So lets say i 85 levels.. I have to do 85 new variables?
 
Status
Not open for further replies.
Top