Archived copy of war3source.com, the War3Source forum (2009–2020), rebuilt from the Internet Archive by wc3mods.net. This page was captured on 2012-10-25 (original capture). Forum · All archived topics · Wiki · Bug tracker · Blog
Chat

War3:Source
October 24, 2012, 09:09:35 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Download: http://war3source.com/index.php?board=9.0
What is War3Source?: http://war3source.com/index.php?topic=200.0
Sample Stats: http://war3source.com/war3stats
Steam Community Group: http://steamcommunity.com/groups/war3source
War3Source SVN Checkout: http://ownageclan.com/svn/war3source/
War3Source servers: http://www.game-monitor.com/search.php?vars=war3_version=
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: How does one do this nowadays...  (Read 634 times)
Glider⠠⠵
Global Moderator
Sr. Member
*****
Posts: 413


⠠⠵


View Profile
« on: September 04, 2011, 02:46:33 PM »

Some time ago these 2 forwards were changed:

Code:
//you may set damage mod percent HERE 
//you may NOT DAMAGE IN HERE 
forward OnW3TakeDmgAllPre(victim,attacker,Float:damage); 

//you may NOT set damage mod percent HERE   
//you may DAMAGE in here, however damage will be engine theoretical damage, not actual damage dealt
forward OnW3TakeDmgAll(victim,attacker,Float:damage); 

So what do I do nowadays when I want to use War3_DamageModPercent and War3_DealDamage? For example a item that mirrors friendly fire damage. I'd have to set the DamageModPercent to 0.0 but also War3_DealDamage back to the attacker. I could obviously send the stuff through a timer with datapacks but a 0.1 second delay is unacceptable for me.

If I use both in the same function my server will get spammed with warnings that this shouldn't be done but if there's no proper solution I'll just remove those hints since I'm very aware of what I'm doing :|
Logged

Ownz
Developer
Administrator
Hero Member
*****
Posts: 2046



View Profile WWW Email
« Reply #1 on: September 04, 2011, 03:32:42 PM »

sure, just add a native to flag that the next dealdamage should not be warned
Logged

DarkEnergy
Glider⠠⠵
Global Moderator
Sr. Member
*****
Posts: 413


⠠⠵


View Profile
« Reply #2 on: September 04, 2011, 03:41:48 PM »

So there is no proper way yet?

son I am disapoint
Logged

Ownz
Developer
Administrator
Hero Member
*****
Posts: 2046



View Profile WWW Email
« Reply #3 on: September 05, 2011, 05:55:27 AM »

u got a better algorithm?
Logged

DarkEnergy
Glider⠠⠵
Global Moderator
Sr. Member
*****
Posts: 413


⠠⠵


View Profile
« Reply #4 on: September 05, 2011, 10:00:09 AM »

:shrug:

I committed the change to svn.
Logged

nvn
Full Member
***
Posts: 133


View Profile
« Reply #5 on: September 05, 2011, 02:26:48 PM »

Is it harmful to use deal_damage on pre or mod_persent on usual?
Logged

Glider⠠⠵
Global Moderator
Sr. Member
*****
Posts: 413


⠠⠵


View Profile
« Reply #6 on: September 05, 2011, 02:59:05 PM »

I don't have access to the code right now so I'll just give a quick overview from memory.

We have 2 pre and 2 post damage hook events. One is filtered Bullet damage and the other is for all kinds of damage. To alter the damage DamageModPercent needs to be applied in a pre hook. Makes sense, since modifying the amount of damage to deal AFTER it has been dealt obviously does not make much sense. Now with DealDamage we got the following problem:

Let's say you have a race that mirrors damage. 2 people are playing this race, one shoots the other. Now person A did 10 damage to person B. Person B mirrors these 10 damage back to person A. Then person A mirrors again -> Hooray for infinite loop! That's why you need to be aware of what you're doing when using DealDamage in a damage hook.

I'm sure I'm forgetting something but if you're curious -> the damage engine isn't that magical when you really look at it.
Logged

Ownz
Developer
Administrator
Hero Member
*****
Posts: 2046



View Profile WWW Email
« Reply #7 on: September 05, 2011, 04:26:16 PM »

woah thats not compatable with older versions

u gotta check for numparams ==9

i was thinking of a complete separate native that gets set to true to hide the warning once. but yours is fine too as long as you do the numparams==9 check before getting GetNativeCell

Logged

DarkEnergy
Glider⠠⠵
Global Moderator
Sr. Member
*****
Posts: 413


⠠⠵


View Profile
« Reply #8 on: September 06, 2011, 06:46:07 AM »

Who updates their Interface without updating the damage engine? What the fuck? If it's that important I'll add it after I get home from work, but it doesn't really make sense to me.
Logged

Ownz
Developer
Administrator
Hero Member
*****
Posts: 2046



View Profile WWW Email
« Reply #9 on: September 06, 2011, 08:20:49 AM »

its not the engine, its the old races that need babysitting since people dont like "recompile required interface changes"
Logged

DarkEnergy
Glider⠠⠵
Global Moderator
Sr. Member
*****
Posts: 413


⠠⠵


View Profile
« Reply #10 on: September 06, 2011, 10:39:35 AM »

Updating without recompiling everything? People seriously do this? Ewww...

Anyway I comitted the new version.
Logged

Ownz
Developer
Administrator
Hero Member
*****
Posts: 2046



View Profile WWW Email
« Reply #11 on: September 06, 2011, 05:20:54 PM »

yea, shit like this happens

http://war3source.com/index.php?topic=738
Logged

DarkEnergy
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!