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
187
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
396
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
187
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.
  • V-SNES V-SNES:
    Happy Sunday!
    +1
  • ToshibaNuon ToshibaNuon:
    Happy sunday!
    +2
  • The Helper The Helper:
    And its Friday!
  • The Helper The Helper:
    Happy Saturday!
    +1
  • V-SNES V-SNES:
    Happy Saturday!
  • The Helper The Helper:
    Happy Monday!
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    Happy Friday!
    +1
  • tom_mai78101 tom_mai78101:
    Starting this upcoming Thursday, I will be in Japan for 10 days.
  • tom_mai78101 tom_mai78101:
    Thursday - Friday will be my Japan arrival flight. 9 days later, on a Sunday, will be my return departure flight.
    +2
  • The Helper The Helper:
    Hope you have safe travels my friend!
    +1
  • vypur85 vypur85:
    Wow spring time in Japan is awesome. Enjoy!
  • The Helper The Helper:
    Hopefully it will be more pleasure than work
  • vypur85 vypur85:
    Recently tried out ChatGPT about WE triggering. Wow it's capable of giving a somewhat legitimate response.
  • The Helper The Helper:
    I am sure it has read all the info on the forums here
  • The Helper The Helper:
    i think triggering is just scripting and chatgpt is real good at code
  • vypur85 vypur85:
    Yeah I suppose so. It's interesting how it can explain in so much detail.
  • vypur85 vypur85:
    But yet it won't work.
  • The Helper The Helper:
    it does a bad ass job doing excel vba code it has leveled me up at my job when I deal with excel that is for sure
  • vypur85 vypur85:
    Nice! I love Excel coding as well. Has always been using Google to help me. Maybe I'll use ChatGPT next time when I need it.
  • The Helper The Helper:
    yeah whatever it puts out even if it is not perfect I can fix it and the latest version of chatgpt can create websites from pictures it will not be long until it can do that with almost all the tools
    +1
  • The Helper The Helper:
    These new Chat AI programs are going to change everything everyone better Buckle the Fuck Up!
  • The Helper The Helper:
    oh and Happy Tuesday Evening! :)

    The Helper Discord

    Members online

    No members online now.

    Affiliates

    Hive Workshop NUON Dome World Editor Tutorials

    Network Sponsors

    Apex Steel Pipe - Buys and sells Steel Pipe.
    Top