Detecting when unit takes damage

bananaHUNT

You can change this now in User CP
Reaction score
55
I need your help again :D
I have a morphing spell that changes the attack missille of my Batrider from the normal burning clask to the volcano missile (looks like a burning rock).
Now, what i want is that when it hits the target, the rock rolls along for a while, damaging unit on its path. I have everything set up, but there is only 1 problem:

I don't know when to create the rolling burning rock, cause I need something like a "Unit takes Damage" event. "Unit is attacked" won't work, because it creates the rock way too early. I've tried to add the event "Triggering unit takes damage", as suggested by other people on this forums, but that doesn't work somehow and it's very glitchy. Sometimes random rocks are being made, sometimes it just doesnt work etc.

I would be very thankfull if someone could take a look at my triggers:
This is the first part of the damage detection trigger someone suggested:
Code:
Burning Rock Init
    Events
        Map initialization
    Conditions
    Actions
        Set BR_Hero = Troll Batrider 0038 <gen>
        Set BR_Group = (Units in (Playable map area))
        Unit Group - Pick every unit in BR_Group and do (Actions)
            Loop - Actions
                Trigger - Add to Burning Rock Path <gen> the event (Unit - (Picked unit) Takes damage)
                Unit Group - Add (Picked unit) to BR_Group_Check
        Custom script:   call DestroyGroup (udg_BR_Group)

This is the second part
Code:
Burning Rock Init 2
    Events
        Unit - A unit enters (Playable map area)
    Conditions
        ((Triggering unit) is in BR_Group_Check) Equal to False
    Actions
        Trigger - Add to Burning Rock Path <gen> the event (Unit - (Triggering unit) Takes damage)
        Unit Group - Add (Triggering unit) to BR_Group_Check

This is to detect when he used the morphing ability or not
Code:
Burning Rock Missile
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Burning Rock 
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                BR_Check Equal to 0
            Then - Actions
                Set BR_Check = 1
                Trigger - Turn on Burning Rock Path <gen>
                Special Effect - Create a special effect attached to the weapon of (Casting unit) using Abilities\Spells\Other\Volcano\VolcanoMissile.mdl
                Set BR_Missile = (Last created special effect)
            Else - Actions
                Set BR_Check = 0
                Trigger - Turn off Burning Rock Path <gen>
                Special Effect - Destroy BR_Missile

This is when and where the rock is created - I need some help with this
Code:
Burning Rock Path
    Events
    Conditions
        (Damage source) Equal to BR_Hero
    Actions
        Set BR_TargetLoc = (Position of (Triggering unit))
        Set BR_HeroLoc = (Position of BR_Hero)
        Set BR_Angle = (Angle from BR_HeroLoc to BR_TargetLoc)
        Unit - Create 1 Burning Rock Missile for (Owner of BR_Hero) at BR_TargetLoc facing BR_Angle degrees
        Unit - Turn collision for (Last created unit) Off
        Set BR_Rock = (Last created unit)
        Trigger - Add to Burning Rock Damage <gen> the event (Unit - A unit comes within 100.00 of BADummy[(Custom value of (Last created unit))])
        Custom script:   call RemoveLocation (udg_BR_TargetLoc)
        Custom script:   call RemoveLocation (udg_BR_HeroLoc)

This is the movement of the rock (and destruction)
Code:
Burning Rock Movement
    Events
        Time - Every 0.02 seconds of game time
    Conditions
    Actions
        Set BR_RockPt = (Position of BR_Rock)
        Set BR_MovePt = (BR_RockPt offset by 10.00 towards BR_Angle degrees)
        Unit - Move BR_Rock instantly to BR_MovePt
        Set BR_Distance = (Distance between BR_HeroLoc and BR_MovePt)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                BR_Distance Greater than or equal to 500.00
            Then - Actions
                Unit - Remove BR_Rock from the game
            Else - Actions

Thank you very much :D
 

bananaHUNT

You can change this now in User CP
Reaction score
55
Yeah but I don't know how long the wait would be..
I mean he can attack from 600 range on which the wait should be like 1 second,
or he can attack from 300 range on which the wait should be maybe 0.5 second?
 

Firezy

New Member
Reaction score
14
2 ranges for each unit? you could change them both to something between both like 450 and problem solved

dunno cant think im in class right now
 

WolfieeifloW

WEHZ Helper
Reaction score
372
There are damage detection systems out there.
Don't use waits, they are hugely inaccurate, especially for this type of thing.
 

bananaHUNT

You can change this now in User CP
Reaction score
55
No.. what I mean is he can attack from anywhere from 600-0 range, depending on where he stands. So a wait wouldn't work, unless I can somehow do a [time for projectile to get from Batrider to target] wait.
thanks wolfie, could you link me to a good GUI damage detection ?
 

bananaHUNT

You can change this now in User CP
Reaction score
55
Hmm can someone take a look at my map, I still can't quite figure it out.
It usually works now, but somehow it fails to roll further sometimes..
 

Attachments

  • Burning Rock.w3x
    21.2 KB · Views: 82

RaiJin

New Member
Reaction score
40
here i made i redid it for you.. the problem was the periodic shit wasn't mui
 

Attachments

  • Burning Rock.w3x
    21.7 KB · Views: 96

bOb666777

Stand against the ugly world domination face!
Reaction score
117
You can use a wait (Distance between Position of damaged unit and Position of casting unit) / 500.
 

bananaHUNT

You can change this now in User CP
Reaction score
55
Thank you sooo much :D It works perfectly now !!
bob666777 nice idea but when he gets an attack speed bonus that wont work ^^
 

bananaHUNT

You can change this now in User CP
Reaction score
55
Hmm ok, though i said it worked perfectly before..
it doesnt.

Sometimes the rock wont roll along further, and sometimes you can see a wierd model on a random unit. And also when you throw another one in a different direction, the first one starts to roll in that direction as well.. :(
I have no clue what to do really..

Here's an image of what i want, maybe its better help
62160950.png

I have a morphing abiliy (based on Bear Form), that changes the projectile.
What I want is that when a target gets hit with the big flaming rock projectile, that it rolls along further for a short distance, damaging units on its path.
(and if its possible, with every thrown rock to slow his movement speed and attack speed, but that is for later. i cant even get this to work xD)
 

Sooda

Diversity enchants
Reaction score
318
Is your Rock missile homing? It depends on multiple things where rock should move on. Easiest is to roll rock always where target stands with back. To make it easy I suggest to use Slide System and when target gets hit then create your Rock unit and use Slide System to roll it some time where you want.

Maybe this helps: http://www.wc3c.net/resources.php?f=648&page=3&order=desc
Knock back system (use it on your rock to move it in right direction): http://www.wc3c.net/showthread.php?t=99720&highlight=slide+system
 

bananaHUNT

You can change this now in User CP
Reaction score
55
Aight I dunno, but anyways I got it to work.
Changed it to an autocastable one, for anyone that likes to see it or wants to use it in their map:

burningrockcopy.png


It will work like this. Whenever you cast it on a unit (or put the ability on autocast), in stead of the normal projectile, a burning piece of rock is thrown. When it hits the target, it rolls further for 500 distance, damaging enemies on its path. In stead of mana or heath, this unit slowly wears your movement speed and attack rate out. This exhaustion effect stacks. Every time you cast it, you lose 10% attack speed and 5% movement speed. Depending on the level of the ability, this effect lasts 8/6/4/2 seconds. I used the Batrider model in the testmap, because the ability looks very good on him and fits his fiery theme.

I would upload it to Spells but I have no idea if there are leaks and such or how to check for them.
 

Attachments

  • Burning Rock(3).w3x
    73.3 KB · Views: 93
General chit-chat
Help Users
  • No one is chatting at the moment.
  • 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
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      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