System Damage

hgkjfhfdsj

Active Member
Reaction score
55
In which case, I agree, you need to attach to the damage stack some how. But then you need callbacks to flush your attachments as the damage stack increments... which becomes a pain.
i got lost there :p
for learning purposes could you/someone sketch what it would look like?
 

aggro

New Member
Reaction score
0
hi there, im kinda new in jass. im trying this system and its really good. im making some basic examples to find out the system. however im getting "undeclared function Damage_IsAttack" error
JASS:
scope Example initializer Start

private function Actions takes nothing returns boolean
     if Damage_IsAttack() then           
        call Damage_BlockAll()
    endif
    return false
endfunction

function Start takes nothing returns nothing
        local trigger t = CreateTrigger()
        call TriggerAddAction( t, function Actions )
        call Damage_RegisterEvent(t)
endfunction

endscope


what's wrong in there?
 

aggro

New Member
Reaction score
0
>>i think you meant TriggerAddCondition?

yeah, thats the point. i couldnt add Damage_IsAttack condition. it gives the error what i told up here. i have the latest jasshelper newgen etc.
 

Bribe

vJass errors are legion
Reaction score
67
JASS:
//
    private struct Detector extends array // Uses AIDS.
        //! runtextmacro AIDS()
        
        private static conditionfunc ACTIONS_COND
        
        private trigger t
        
        private method AIDS_onCreate takes nothing returns nothing
            set this.t=CreateTrigger()
            call TriggerAddCondition(this.t,thistype.ACTIONS_COND)
            call TriggerRegisterUnitEvent(this.t,this.unit,EVENT_UNIT_DAMAGED)
        endmethod
        
        private method AIDS_onDestroy takes nothing returns nothing
            call DestroyTrigger(this.t)
        endmethod
        
        private static method AIDS_onInit takes nothing returns nothing
            set thistype.ACTIONS_COND=Condition(function OnDamageActions)
        endmethod
    endstruct


Due to the JASSHelper compile-time wackiness, putting the AIDS textmacro at the top of the struct like this wastefully creates three conditions to execute onInit, onCreate, and onDestroy, needlessly increasing handle count and needlessly slowing down those processes. Putting the textmacro at the bottom of the struct prevents this problem. Then again, you're using the method operator unit from the AIDS struct, which stupidly compiles to a condition-evaluation instead of inlining if the textmacro is below the declaration. vJass totally fails.
 

Lmfaocj

Active Member
Reaction score
1
I am new and I don't know jass can anyone help me.
I know don't how to make every skill deal damage using "Damage" ex. "Shock Wave"
 

Laiev

Hey Listen!!
Reaction score
188
you need recreate that spell with trigger to use the function to deals damage by the system
 

Lmfaocj

Active Member
Reaction score
1
you need recreate that spell with trigger to use the function to deals damage by the system

How would I do that, with the shock wave spell because it's a aoe and has not buffs, how would I make the skill deal damage?

and does normal attacking have something I can add so it does not detect normal damage.

like if I was to use

JASS:
//function Conditions takes nothing return boolean
//    if ( not (  ) )
//        return false
//    endif
//    return true
//endfunction

function Actions takes nothing returns nothing
    local real Damage=GetEventDamage
    call Damage_Block
    call UnitDamageTargetEx( GetEventDamageSource(), GetTriggerUnit(), Damage, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC, WEAPON_TYPE_WHOKNOWS)
endfunction
    
//===========================================================================
function HyperAttack takes nothing returns nothing
    local trigger t= CreateTrigger()
//    call TriggerAddCondition( t, function Conditions)
    call TriggerAddAction( t, function Actions)
    call Damage_RegisterEvent
endfunction
 

Jesus4Lyf

Good Idea™
Reaction score
397
If you don't know JASS, it's probably a bit unrealistic to try to trigger damage for something like Shockwave...

There's a few ways, the simplest being make it deal 0 damage, then register Damage's Zero damage event, and deal the actual damage. If you use a dummy caster, you can also attach the caster to the dummy and the amount of damage... Would allow you to change the damage of spells over time, etc, as well. :)

But if you don't know JASS in the first place, it's a bit of a pain. By a bit of a pain, I mean I don't find it likely that you can complete it.

Edit: I wonder if someone can make a system which does the above in an effective way..?
 

W!†A_cRaft

Ultra Cool Member
Reaction score
28
JASS:
//          function Damage_RegisterEvent takes trigger whichTrigger returns nothing
//              - This registers a special "any unit takes damage" event.
//              - This event supports dynamic trigger use.
//              - Only triggers registered on this event may block damage.
//              - Only fires when the damage dealt is not 0.


How do I control this thing, or to put it more precissly, what am i suppose to do with this function? Where am i suppose to call it?

EDIT: can normal damage (regular attacks from unit within the map) be blocked? Or do I have to make another "healing trigger" for those attacks?
 

Laiev

Hey Listen!!
Reaction score
188
JASS:
//          function Damage_RegisterEvent takes trigger whichTrigger returns nothing
//              - This registers a special "any unit takes damage" event.
//              - This event supports dynamic trigger use.
//              - Only triggers registered on this event may block damage.
//              - Only fires when the damage dealt is not 0.


How do I control this thing, or to put it more precissly, what am i suppose to do with this function? Where am i suppose to call it?

in the event part, instead of any other event, call it, that is the event

EDIT: can normal damage (regular attacks from unit within the map) be blocked? Or do I have to make another "healing trigger" for those attacks?
ya, it can block regular damage from unit
 

W!†A_cRaft

Ultra Cool Member
Reaction score
28
instead of any event?

what if i want an periodic event or something?
or possibly a player chat message event?

EDIT: am i suppose to put this in the regular trigger event register, at the bottom of the trigger? or in the actions of the trigger simply calling an event register function?
 

W!†A_cRaft

Ultra Cool Member
Reaction score
28
but, what is this OnInit function, i mean from where to call it/use it?

am i suppose to call it from the regular action function? or
from the InitTrig_<triggername> or what?

EDIT: what confuses me is that they say "must register every trigger to it, or else they cant block"
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
am i suppose to call it from the regular action function? or
from the InitTrig_<triggername> or what?
Jasshelper allows you to make your own init function.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top