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

[JASS] Engine damage?

Status
Not open for further replies.
Level 7
Joined
Aug 20, 2005
Messages
98
As many of you may know damage detection systems in Warcraft don't really work. The problem being that you end up creating a trigger with a huge list of event attached to it. Now you can use the DestroyTrigger function to get rid of these leaked events but it seems that destroying triggers is not in itself safe.

My question is this: How does the Warcraft engine itself deal damage? Couldn't we just hook the function that it uses to deal damage?

The only functions that I know of for dealing damage are UnitDamageTarget and UnitDamagePoint. Does the engine use these to calculate attack damage?
 
Level 15
Joined
Dec 18, 2007
Messages
1,098
No idea. You have to hack the Warcraft engine (probably written in C) to find out.

Destroying Triggers cause some memory leak, but its cleaned up automatically after a while. That's what I heard. I also read that its safer to combine your actions with your conditions, so your trigger doesn't use an action, just a condition that does everything.

The thing is, I doubt that the natives are actually really native. I think that actually call another function written in another syntax language. I'm not too sure though. If its so, there's probably another function that actually does the damage.
 
Status
Not open for further replies.
Top