• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece!🔗 Click here to enter!

[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