System Damage

Jesus4Lyf

Good Idea™
Reaction score
397
JASS:
//          function UnitDamageTargetEx takes lots of things returns boolean
//              - Replaces UnitDamageTarget in your map, with the same arguments.
See that "with the same arguments" thing? ;)

GUI users should use Damage_Pure, Damage_Spell or Damage_Physical, which list their arguments explicitly and may not even suck for GUI users to actually use.

>what the returned booleans mean for the functions
Ah. In case you're wondering, that's success - whether the damage was dealable or not. I suppose you're right. *Puts it on his mental to-do list.* <_<
 

Andrewgosu

The Silent Pandaren Helper
Reaction score
716
I don't see a reason why not to approve this, as this is really-really useful.
 

chobibo

Level 1 Crypt Lord
Reaction score
48
An O(n) sorting algorithm wouls be awesome....
\
O(1)

The system looks good, it works. I was thinking of a different approach to this but I can't comment yet since I haven't made things like this. Anyways great system.
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
Version 1.0.2: Added Damage_IsPure(), Damage_IsSpell(), Damage_IsPhysical() and Damage_IsAttack() (so damage can be physical but not count as an attack).

I've only found Damage_IsAttack
Also you should mention clearly that the user must code itself every spells which are causing damages, and not use the ones already made in the object editor. (even if it should be obvious)
 

Jesus4Lyf

Good Idea™
Reaction score
397
Quote sentence 3 of documentation:
It also provides a means to detect what type
// of damage was dealt, so long as all damage in your map is dealt using
// this system's deal damage functions (except for basic attacks).
And the other functions are made with a textmacro, and should inline to DamageTargetEx. :p
 

13lade619

is now a game developer :)
Reaction score
399
using this... thanks.

um, you should update the map. it still contains 1.0.1..
i had to return to get the isattack condition

sorry.. but Damage_IsAttack() doesnt actually seem to work for me...

i have this trigger:

JASS:
function Trig_BladebaneReturn_Conds takes nothing returns boolean
    return Damage_IsAttack()==true and ( UnitHasItemOfTypeBJ(GetTriggerUnit(), &#039;I01K&#039;) or UnitHasItemOfTypeBJ(GetTriggerUnit(), &#039;I01L&#039;) )
endfunction

function Trig_BladebaneReturn_Callback takes nothing returns nothing
    local unit caster = GetTriggerUnit()
    local unit target = GetEventDamageSource()
        
        call BJDebugMsg(&quot;CONSIDERED PHYSICAL&quot;)
        
        if UnitHasItemOfTypeBJ(caster, &#039;I01K&#039;) then
            call UnitDamageTargetBJ(caster,target,25,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL)
        elseif UnitHasItemOfTypeBJ(caster, &#039;I01L&#039;) then
            call UnitDamageTargetBJ(caster,target,55,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL)
        endif
    
    set caster = null
    set target = null
endfunction

function InitTrig_BladebaneReturn takes nothing returns nothing
    set gg_trg_BladebaneReturn = CreateTrigger()
    call Damage_RegisterEvent(gg_trg_BladebaneReturn)
    call TriggerAddAction(gg_trg_BladebaneReturn,function Trig_BladebaneReturn_Callback)
    call TriggerAddCondition( gg_trg_BladebaneReturn, Condition(function Trig_BladebaneReturn_Conds) )
endfunction


tried using the condition as action (as in the sample) but doesnt work either..
it detects almost all damages.. specially from spells..

i'd like it so that my trigger only responds to attacks, not spells.
 

Jesus4Lyf

Good Idea™
Reaction score
397
sorry.. but Damage_IsAttack() doesnt actually seem to work for me...
JASS:
//          all such functionality. It also provides a means to detect what type
//          of damage was dealt, so long as all damage in your map is dealt using
//          this system&#039;s deal damage functions (except for basic attacks).
Mmm. Includes IsAttack().

If you need to detect IsSpell, IsPure, IsPhysical, IsAttack, and GetType, you need to build your whole map around Damage. Unfortunate WC3 limitation.

Hope you still see some nice use out of this, even if you don't use those features. :thup:
 

13lade619

is now a game developer :)
Reaction score
399
tsk... oh man..

Unfortunate WC3 limitation.
*too lazy to rebuild my map* :p..

i was using the OnAttack template before.. the limitation was that DmgPerSec abilities were triggering the 'attack'..

anyways.. i had this idea before about a damage detecting system by using nulled passives..
but my problem is about buff stacking though.. i foresee some conflicts with it.. but maybe i'd give it a shot when i have time..
 

Jesus4Lyf

Good Idea™
Reaction score
397
I admit that I could accomplish "IsAttack" without that limitation, probably. But I don't think it would be completely reliable, and it wouldn't be as efficient...

I don't know. These days I just code my maps on Damage, and it serves me that extra functionality. <3

I may consider adding one thing - a filter that defines unit types that deal spell damage. So if you use dummy casters, it pick up the type as spell.

I admit I blatantly stole that idea off a user suggestion on WC3C for some system.
 

BRUTAL

I'm working
Reaction score
118
When I try saving my map with Damage I get this.
errordmg.jpg

:p
 

Bryce

New Member
Reaction score
0
Sorry but there's an error in your library. Last week i made test about DAMAGE_TYPE_XX.
DAMAGE_TYPE_NORMAL are spell damage, then there aren't physical and unaffect units with magic immunity, like SpellBreaker. You just have to replace DAMAGE_TYPE_NORMAL by DAMAGE_TYPE_FORCE for example.
 

Jesus4Lyf

Good Idea™
Reaction score
397
Sorry but there's an error in your library. Last week i made test about DAMAGE_TYPE_XX.
DAMAGE_TYPE_NORMAL are spell damage, then there aren't physical and unaffect units with magic immunity, like SpellBreaker. You just have to replace DAMAGE_TYPE_NORMAL by DAMAGE_TYPE_FORCE for example.
This simple snippet amplifies all damage by 500 physical.
JASS:
scope NoDamageOnMap initializer StartZeroDamage
    private function BlockAllDamage takes nothing returns boolean
        //call Damage_BlockAll()
        call DisableTrigger(GetTriggeringTrigger())
        call Damage_Physical(GetEventDamageSource(),GetTriggerUnit(),500,ATTACK_TYPE_NORMAL,true,false)
        call EnableTrigger(GetTriggeringTrigger())
        return false
    endfunction
    
    private function StartZeroDamage takes nothing returns nothing
        local trigger t=CreateTrigger()
        call TriggerAddCondition(t,Condition(function BlockAllDamage))
        call Damage_RegisterEvent(t)
    endfunction
endscope
It proves that you are mistaken (the amplification worked on a Phoenix just fine).

Thanks for your interest in this system.
Kind regards. :)
 

GoGo-Boy

You can change this now in User CP
Reaction score
40
Hmm I really dunno whether I should implant this system into my map. While it grants some advantages I had to reorganize every trigger that deals damage and had to work around other skills that I didn't want to do by dealing the damage via script.
Hmmm :/
Got some questions which are most likely already pointed out somewhere... but whatever:
This works kinda as a damage detection system as long as the damage is either dealt via your functions or through basic attacks?
Other damage detection systems suffer from some sorts of leaks. Is this free of such leaks duo to the restriction that the damage must be dealt with your functions?
My map will generate a lot creeps over time (a Diablo map ;P) and there will be some huge battles. Also there are some other triggers that consume some performance like a fixed-cam script. Do you think this system performs well enough with like 50-60 units in a battle field?

And last but not least... could you tell me where I can add your functions to allow the NewGen Editor to show me the arguments it takes etc?^^

Edit:
It seems to be really awesome btw :D
 

Jesus4Lyf

Good Idea™
Reaction score
397
I had to reorganize every trigger that deals damage and had to work around other skills that I didn't want to do by dealing the damage via script.
Only if you want to detect Damage_IsAttack, Damage_IsPure/Spell/Physical, and Damage_GetType.
This works kinda as a damage detection system as long as the damage is either dealt via your functions or through basic attacks?
Actually, copy pasting the library in and changing none of your code provides Damage_RegisterEvent, Damage_Block, Damage_BlockAll, Damage_Spell, Damage_Pure, Damage_Physical. Everything except type detection.
Other damage detection systems suffer from some sorts of leaks.
This is leakless regardless. The "any unit damaged" event is often implemented in ways that leak. This in this system is not dependent on using the special functions.
Do you think this system performs well enough with like 50-60 units in a battle field?
I think I tested it with about 100, blocking all damage that was dealt. I didn't drop a single fps on my 3 year old laptop that runs DotA at 25 fps (this map ran at 60).
And last but not least... could you tell me where I can add your functions to allow the NewGen Editor to show me the arguments it takes etc?^^
Hm. I should really start adding this to my systems. I was mapping and decided I want this feature just yesterday. I'll look into it.

Edit: Added TESH highlighting (see first page). :)

>It seems to be really awesome btw :D
Thanks! Lots of effort in this...

Two more things. The main point this stands out from other damage systems on is that it supports recursion (damage in response to a damage event, most systems get the types mixed up and such).
Even though you don't -have- to use the functions to deal all damage in your map, it is recommended because the Damage_IsSpell() and Damage_IsAttack() stuff is just awesome. And then you have it. :D
 

GoGo-Boy

You can change this now in User CP
Reaction score
40
Now that sounds promising! I will try it out once I get my JNGP working correctly again. Even TESH doesn't seem to work :/

For the highlighing I just need to create a .txt file, copy the code in there (the one with only the function names and arguments) and save it in the 'include' folder?
Because it doesn't seem to work for me, but then again it's probably duo to my malfunctioning JNGP anyway :eek:
 

GoGo-Boy

You can change this now in User CP
Reaction score
40
Hmm I dunno how to create a .j file.
Notepad seems to know ".txt" only :/
Is there some program you got suggest?
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/
  • The Helper The Helper:
    Decided to put up a healthier type recipe to mix it up - Honey Garlic Shrimp Stir-Fry https://www.thehelper.net/threads/recipe-honey-garlic-shrimp-stir-fry.193595/

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top