Conditions and Damage types?

Ellimistrox

New Member
Reaction score
10
Problem Status: Solved (Unhappily)

***Just bear with me, I have only recently started Jassing and my experience is questionable. (Mainly self taught)***

I was wondering (Meaning this is absolutely vital to my map :nuts:) if damage types could be compared in a condition.


For Example...

If i used this event (Below)
call TriggerRegisterUnitEvent( gg_trg_Test, null, EVENT_UNIT_DAMAGED )

Could i compare the damage type of the damage dealt to that unit?

So.. if the damage type = hero then do actions, etc.
 

Frozenhelfir

set Gwypaas = Guhveepaws
Reaction score
56
There isn't really an up-front way of doing this, but it can be done. Setup a number system denoting attack types. Then, write down all the unitid's of units that you use in your map and record their attack type.

so you could do: 0=hero,1=chaos,2=normal etc. depending on your taste.

When a unit enters the map, get its ID and "call SetUnitUserData" the entering unit, and assign the values above based on its attack type. When you want to compare the attack type, "call GetUnitUserData == 0" if you want to see if it has hero attack type, according to my example.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top