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!
When the unit dies from enemy i check what lvl it is to give the exp based on the basic formula(slightly changed) for the exp. now it wont check the level of the unit somehow? Does that only work for heroes?
If a unit dies, he still exists, unless you remove it.Try this :
Example for showing that detecting a level of a dying unit works
Events
Unit - A Unit Dies
Conditions
(Triggering Unit) Equal to 'Your Unit) == You can use unit type then
Actions
Set RIP_Unit = (Triggering Unit)
Game - Show (Integer To String (Level of RIP_Unit)) to All Players
------ Ok if it shows the unit level then it's ok, u can do anything. ------
It may mess with this trigger ( If you have one that exists ):
The Only possibility I can guess if the trigger above doesn't work , the issue would be :
Events
Unit - A Unit dies
Conditions
Actions
Unit - Remove (Triggering Unit) from the game == This will interrupt last trigger :/ so if you have a trigger like this, remove it or modify it , I don't suggest this.
If a unit dies, he still exists, unless you remove it.Try this :
Example for showing that detecting a level of a dying unit works
Events
Unit - A Unit Dies
Conditions
(Triggering Unit) Equal to 'Your Unit) == You can use unit type then
Actions
Set RIP_Unit = (Triggering Unit)
Game - Show (Integer To String (Level of RIP_Unit)) to All Players
------ Ok if it shows the unit level then it's ok, u can do anything. ------
It may mess with this trigger ( If you have one that exists ):
The Only possibility I can guess if the trigger above doesn't work , the issue would be :
Events
Unit - A Unit dies
Conditions
Actions
Unit - Remove (Triggering Unit) from the game == This will interrupt last trigger :/ so if you have a trigger like this, remove it or modify it , I don't suggest this.
One thing to note is that units always leak 4kb of memory. (Even when removed.)
You should try to avoid creating the units over and over again. Especially in spells.
Try to use one dummy unit for spells to lower this memory leak.
As for triggers there are lots of ways to do them with only one unit. You should try to do what you can to reduce the amount of units being created and removed.
One thing to note is that units always leak 4kb of memory. (Even when removed.)
You should try to avoid creating the units over and over again. Especially in spells.
Try to use one dummy unit for spells to lower this memory leak.
As for triggers there are lots of ways to do them with only one unit. You should try to do what you can to reduce the amount of units being created and removed.
When the unit dies from enemy i check what lvl it is to give the exp based on the basic formula(slightly changed) for the exp. now it wont check the level of the unit somehow? Does that only work for heroes?
better if u make a variable: LV and if and check if dying unit is hero or no
if dieing unit is hero then save hero lv into LV variable else save unit level into LV variable because unit level to hero is 0 (i guess) and same the unit level for hero
The limit for units is when the game crashes from running out of memory.
The best way as mentioned is to save the units into a hashtable based on their unit type then load them as needed.
To prevent lag from building up more the unused units onto a spot on the map that will not be seen for the game and hide the units.
The limit for units is when the game crashes from running out of memory.
The best way as mentioned is to save the units into a hashtable based on their unit type then load them as needed.
To prevent lag from building up more the unused units onto a spot on the map that will not be seen for the game and hide the units.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.