damage detection

V

venci15

Guest
oh i'm trying to make something if a unit hit's anoter unit with a spell to get xp the xp part easy but the spells can be missable so how can i make it give
xp when spell dmg is made to a unit
 

Trithilon-V2

New Member
Reaction score
20
Damage detection is one of the greatest mysteries......
I assume you are a gui user.....
Try and get emjlr's (i forgot the spellin :p ) On Attack Template.
Its helps you detect damage types,although it has some serious limitations.
Just because, we dont have access to inbuilt functions like, units attack damage,cooldown,animatin back&front swing its really difficult to detect it.
 
V

venci15

Guest
found an easyer way to make the damage thing but:
Code:
Untitled Trigger 006
    Events
        Time - Elapsed game time is 0.05 seconds
    Conditions
    Actions
        Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
            Loop - Actions
                Trigger - Add to Untitled Trigger 007 <gen> the event (Unit - (Picked unit) Takes damage)
Code:
Untitled Trigger 007
    Events
    Conditions
    Actions
        Set damagedunit = (Triggering unit)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Region 016 <gen> contains (Triggering unit)) Equal to True
            Then - Actions
                Hero - Add 10 experience to (Damage source), Hide level-up graphics
            Else - Actions
                Do nothing
but the trigger makes when a spell is cast but the damage is done after the cast
Code:
Knockback Cast
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
    Actions
        Set Temp_Int = 0
        Set Timer_Delay = 0.03
        Set Caster = (Triggering unit)
        Set Caster_Loc = (Position of Caster)
        Set Knockback_Value = (0.05 x (Real((Hero experience of Caster))))
        Set Knockback_Group = (Units owned by (Owner of (Damage source)))
        Countdown Timer - Start Knockback_Timer as a Repeating timer that will expire in Timer_Delay seconds
        Wait 1.25 seconds
        Countdown Timer - Pause Knockback_Timer
        Custom script:   call RemoveLocation(udg_Caster_Loc)
        Custom script:   call DestroyGroup(udg_Knockback_Group)
 

Trithilon-V2

New Member
Reaction score
20
ok...tell me what exactly you need?
i mean be a lil more precise.... i cudnt undestand ur above post.
 
V

venci15

Guest
well i want when a unit casts a spell to knockback the affected unit's from the ability so in other words make the two scripts work together.
 

Xenoche

Member
Reaction score
18
Why don't you use a dummy unit thats created for the player when the spell is cast, cause the dummy to damage the target unit (for 1 damage).

Then add a if/then/else condition in your damage trigger checking that its the unit type of the dummy you just created, if it is, knock back.
 
V

venci15

Guest
i think the dummy unit should be a hero becouse my knockback system is for the caster so i need to make it so the knockback from the trigger be the same size as the knockback from the hero
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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