Unit Takes Damage Event

chukky-jr

Member
Reaction score
15
how do you check the source damage is in GUI? (which unit deals the damage to the victim) i use Conditiion - Attacked Unit is blabla and it doesn't work

can you clear an Event from trigger? i'm periodically adding events to the damage trigger everytime a unit is attacked, but that would cause a lot of event in one trigger.
 

chukky-jr

Member
Reaction score
15
err can you give a quick answer first would it be codeable or not? (of course i'll read that link too)

E: well no shit.. i don't understand that..

E2 : somehow does it uses indexing system? cuz i don't really now how to index units
 

Dirac

22710180
Reaction score
147
Codeable? yes.

You need to index units, i'm quite sure Bribe submitted a GUI indexing system, and Weep a damage detection system.

You can't remove events from triggers, therefore you should only add the event once (when the unit enters the map).

I forgot everything i knew about GUI so i wouldn't know what would be the best approach since GUI is very limited
 

chukky-jr

Member
Reaction score
15
but i thought a unit enter playable map area that run once causes the next unit that enters it doesn't get added to the Event for the trigger?
 

Medeam

New Member
Reaction score
3
You can just keep doing what your doing, just make multiple copies of the same trigger and add to that trigger and so on to avoid trigger event leaks so you turn off this trigger once you make a integer and it hits 8000 then turn that trigger off and use the next one.
 

Amn

Member
Reaction score
18
RedHead damages Wall :banghead:

Trigger:
Wall Takes Damage

Unit Triggering unit = Wall
Unit Damage Source = RedHead
 

chukky-jr

Member
Reaction score
15
Use Weep's GDD system for all of your GUI damage needs. Click Me

i already know that, but i don't want directly implement something without knowing it part by part, i'm learning little by little now

You can just keep doing what your doing, just make multiple copies of the same trigger and add to that trigger and so on to avoid trigger event leaks so you turn off this trigger once you make a integer and it hits 8000 then turn that trigger off and use the next one.

maximum unit will be created in my map approximately 500 per game, so i don't think this event leaks will be huge problem (but yeah it still leaks, i'l find a way to it later) , btw i don't get what you really mean, so far i'm able to stop registering same unit into the event (so it won't run twice per unit)

RedHead damages Wall :banghead:

Trigger:
Wall Takes Damage

Unit Triggering unit = Wall
Unit Damage Source = RedHead

i'm not really sure by what you mean, if there is a GUI trigger to check damage source, i wouldn't be asking here


btw i convert the condition Attacking unit is (unit i want to check) to jass script, it turned out it uses GetAttacker (or something like that), i change GetAttacker to GetEventDamageSource, will it work find to check who is dealing damage to unit that takes damage?

btw what syntax you use to add condition in jass? and check nearest unit from unit X?
 

Dirac

22710180
Reaction score
147
Hold your horses

If you're a GUI user don't use JASS here, you don't need it, you don't know how it works. Remember that these units respond to the event, so if the event is "unit takes damage" there is no attacking unit, and if the event is "unit is attacked" there is no damage source. JASS's logic is very different to GUI's, so trying to explain how to add conditions to a trigger would have to include the whole jass deal. To check for the nearest unit you would have to run all the units within X of a location through a loop and comparing them with each other to determine which one is closer.
 

chukky-jr

Member
Reaction score
15
the event is indeed "triggering unit takes damage", i add a condition using that GetEventDamageSource to check who damages the triggering unit, would be any problem with that trigger?
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
You can only use a Specific Unit for "Unit Takes Damage". However, you can do this:

Create a trigger (T). The variables you can use are Triggering Unit (Damaged Unit), Damage Source and Damage Taken. Whenever a unit enters the Playable Map Area for the first time, add to T the event Triggering Unit Takes Damage, then add the unit to a group. This group will be used to check whether a unit's events have been added. Then do whatever actions you like.
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
im pretty sure with a simple line of custom script you could add a generic unit takes damage event, you could add it in map initialization
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
Do you have any idea what that line is? I sure don't. Nor do I think it even exists, or Weep's GDD probably wouldn't be around.
 

Dirac

22710180
Reaction score
147
im pretty sure with a simple line of custom script you could add a generic unit takes damage event, you could add it in map initialization
No.

There are multiple damage detection systems in vJass, all of them work adding an event to a trigger everytime an unit enters the map
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
really? i thought the reason why dds in vjass was so much easier than in gui was because of its generic damage event, there is one in sc2 :/
 

Dirac

22710180
Reaction score
147
Well it IS easier since there are already written and you can easily copy paste them into your map. They also save lots of work (like most systems do) when it comes to preventing damage done to an unit.
 

tommerbob

Minecraft. :D
Reaction score
110
Well it IS easier since there are already written and you can easily copy paste them into your map. They also save lots of work (like most systems do) when it comes to preventing damage done to an unit.

Exactly.

@ the Op: That's why I suggest using Weep's system if you are doing GUI.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • 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 The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top