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

[General] Exp Triggered

Status
Not open for further replies.
Level 15
Joined
Oct 29, 2012
Messages
1,474
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.
 
Level 8
Joined
Nov 9, 2011
Messages
326
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.

Well for some reasons i was trying to remove some lagging by removing cuz its large map so ty man mystery solved
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
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.
 
Level 8
Joined
Nov 9, 2011
Messages
326
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.

What is the limit and i will try to do that
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
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
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
What is the limit and i will try to do that

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.
 
Level 8
Joined
Nov 9, 2011
Messages
326
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.

ah so thats why my arena lagged after 15 minutes. it was horrible
 
Status
Not open for further replies.
Top