• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Refering to a unit

Status
Not open for further replies.
Level 4
Joined
Feb 25, 2010
Messages
73
Hi, i'm new in the world editor but i'm working to undertand it. In the momento, i am stuck in a single problem: i want to make a trigger that refers to a type of custom hero i did. The trigger basically is:

---Actions
When <type of unit i want to refer> takes damage

---Conditions
(Random number between 1 and 100) equal or less than 30
<type of unit i want to refer> have a custom buff i did

---Actions
Cause <type of unit i want to refer> to damage (Damage Source) dealing (Damage taken).


...but i can't find out a way to refer at the TYPE of unit, only a SPECIFIC unit (in the Generic Units Events there is no 'Takes Damage' Event...). Somebody can help? Anything with variables? I have the type of hero i want to refer stored in a variable but i can't refer to it.

Thanks to all
 
Level 9
Joined
Aug 21, 2008
Messages
533
This only works for specific Units.

3steps to get it work:
1.Dont use a action at your trigger.
2.Make a trigger.
event: unit enters playable map
action: add event <Entering Unit Takes Damage> to <Your first Trigger>
3.Make a Triggger on Map init or add this event to your current map init trigger:
Pick all Unit in playable map and do actions:
add event <Picked Unit Takes Damage> to <Your first Trigger>


Leaks and such crap you have to remove by yourself:grin:
 
Persay, you have more than one of these guys, and want to make a trigger that does these things if any one of these guys takes damage? Or is it just one guy?

I can make this happen for you but first you gotta answer those questions above. You're going to need custom scripts but it's easy cause all you gotta do is copy what I give you.
 
View attachment Damage System.w3x
This is a simple damage detection system.
In order to add the conditions you want, go to Trigger 2 and in the place of conditions, add whatever you want. The unit that takes the damage is referred as "Triggering unit", so, if you want to detect when a Footman-type unit takes damage, place the Unit-type comparison in the conditions:
  • (Unit-type of (Triggering unit)) Equal to Footman
To refer to the damage source, refer as "Damage Source". Simple.
 
Level 4
Joined
Feb 25, 2010
Messages
73
@SlayerII i bit confusing to me... but maybe this is the only exit to this problem

@Bribe anyone of these guys. This, in fact, is a skill for a Hero in a Hero Arena i'm doing, so, anybody that takes "Omniknight" will can do "Purification" (omni like a example :grin:)

@pharaoh_ i thanks to you and i will test immediattely (and, of course, try to understand all of it :xxd:)
 
Status
Not open for further replies.
Top