HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Absorb dmg trigger

04-21-2004, 08:21 PM#1
Wyll
I can't get the following trigger to work... basicly it checks for a certain buff and if it exists then absorb dmg. I just through it together to test functionality so no I don't plan on having brilliance aura absorb damage rofl.

Absorb
Events
Unit - A unit Is attacked
Conditions
((Attacked unit) has buff Brilliance Aura) Equal to True
Actions
Unit - Set life of (Attacked unit) to ((Life of (Attacked unit)) + ((Damage taken) x 2.00))


I have changed the dmg taken *2 portion and simply added 50 points which caused the 50 points to heal the target before the dmg was taken. I think this is where the problem lies... it somehow isn't using the damage of the attack in the trigger. I'd really like some help with this cause it will solve my map design greatly.
04-21-2004, 09:00 PM#2
ThyFlame
... what exactly is the problem?
04-21-2004, 09:02 PM#3
Wyll
There is no damage absorbed. All attacks are normal. I know the conditions work because i tested it with a 50 pt life added but when i change it to dmg taken nothing is done.
04-21-2004, 09:05 PM#4
linkmaster23
You have to have the event, a unit takes damage. That's why. Also, it is a specfic unit event. So you will need 2 triggers. One saying a unit is attacked, then setting the attacked unit to a unit variable. Then another one, which is the one you want, saying that, that unit took damage.
04-21-2004, 10:09 PM#5
Wyll
Having problems getting the variable in the second trigger... how do I make it a global variable?
04-21-2004, 10:39 PM#6
linkmaster23
You would have to pre-make the variable. I have made a tutorial that contains how to use variables if you do not understand them. Just check my sig.
04-21-2004, 11:01 PM#7
Wyll
I fully understand variables and I read your tutorial which didn't add any new info. I figured I'd need to premake them so I deleted my triggers just to make sure it wasn't a local and created the variable and then the triggers again. Same thing. Pretty much started from scratch and I still can't use the variable in the second trigger... is there something more in the first trigger besides Event Unit Attacked, Action set variable = unitattacked? I keep getting that grayed out text of 'no generated variables of this type'...
04-22-2004, 12:16 AM#8
linkmaster23
Well, could you send me the map? Post it AIM me it, whatever works for you.
04-22-2004, 12:28 AM#9
Wyll
Quote:
Originally Posted by linkmaster23
Well, could you send me the map? Post it AIM me it, whatever works for you.

Ok, i created a new map and added the two triggers. I'm able to use the variable in the condition and action but not the event... Try adding an event on the absorb trigger using specific unit and you'll see you can't select a variable.
04-22-2004, 12:37 AM#10
linkmaster23
Oh my, that is wierd. I could have sworn I just did this a few weeks ago. Hrmm... that doesn't make sense you can't use Variables as a Specifc Unit Event! No sense at all... I'll look into this and get back to you in about 5 minutes.
04-22-2004, 12:38 AM#11
joseka
Quote:
Originally Posted by Wyll
I fully understand variables and I read your tutorial which didn't add any new info. I figured I'd need to premake them so I deleted my triggers just to make sure it wasn't a local and created the variable and then the triggers again. Same thing. Pretty much started from scratch and I still can't use the variable in the second trigger... is there something more in the first trigger besides Event Unit Attacked, Action set variable = unitattacked? I keep getting that grayed out text of 'no generated variables of this type'...

When you use the A UNIT IS BEING ATTACKED, you must wait until some damage has been done, mayve this trigger could work

EVENT -A unit is attacked
CONDITION -Unit have Brillance Aura
ACTION

-Set <rUnitLife> = Lifeof(Attacked Unit)
-Wait until rUnitLife not equal to Lifeof(Attakced Unit) cheking every 0.10 s
-Set <rDamage> = rUnitLife - Lifeof(Attacked Unit)
-Set life of attacked unit to Lifeof(attacked Unit) + rDamage*2

Where rUnitLife and rDamage are Real Variables ( or maybe integer i dont remenber)

This will work because the A unit is Attacked action is not instantaneus
Hope it work :D
04-22-2004, 12:47 AM#12
linkmaster23
Sigh, I was just about to say that, then I hit REPLY, and your post came up, but I'll let you have it, since you came before me. Good job.
04-22-2004, 12:57 AM#13
ThyFlame
Neh. You had that 4 hours ago. How long were you gonna let him hang?
04-22-2004, 01:13 AM#14
linkmaster23
Man it sucks having someone that knows everyone of my plots and schemes... wait a minute... STALKER! ^_^ "P
04-22-2004, 01:17 AM#15
Taylor
There are a thousand ways a unit can lose health other than being attacked, checking if a units health has changed is just asking for trouble.

You also can't specify variables in events because they are not declared at that point when the script runs: that's why there's a Trigger – Add Event function.