HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Change owner trigger (Need help)

08-08-2008, 12:37 AM#1
Shadow_killer
Trigger:
h
Collapse Events
Advanced - Any unit takes damage
Collapse Conditions
(Unit-type of (Triggering unit)) Equal to Circle of Power
(Life of (Triggering unit)) Less than or equal to 100.00
Collapse Actions
Game - Display to (All players) the text: DIN TRIGGER FUNKAR!...
Unit - Change ownership of (Attacked unit) to (Owner of (Attacking unit)) and Change color
Unit - Set life of (Triggering unit) to 100.00%

I want the trigger to change to the owner of the attacking player. But for some reason it doesnt work. The trigger does work if i set it to change to a certain player. Dont mind the display text trigger its just to see if the trigger executes or not.
08-08-2008, 12:43 AM#2
Bobo_The_Kodo
The event should be:
Trigger:
Events
Unit - A unit Is attacked
08-08-2008, 01:22 AM#3
Shadow_killer
Quote:
Originally Posted by Bobo_The_Kodo
The event should be:
Trigger:
Events
Unit - A unit Is attacked

I tryed that. But when i attack the circles of power i own they just die and vanish. But with the trigger i have know it works even if you kill your own circles of powers. But then they wont change owner.
08-08-2008, 02:40 AM#4
Eznce
What is the damage being dealt to the circles? They might just die because...their health is at 100 or less (as in your condition) The circles are the ones being attacked, right? If so i would change you're conditions from triggering unit to attacked unit. That might help, because i think the triggering unit is the attacking unit.
08-08-2008, 02:56 AM#5
DioD
you need

GetTriggerUnit() For attacked unit

And GetEventDamageSource() For attacking unit
08-08-2008, 03:03 AM#6
Eznce
...doesnt he want it explained in GUI?
08-08-2008, 08:09 AM#7
Pyrogasm
Quote:
Originally Posted by DioD
you need

GetTriggerUnit() For attacked unit

And GetEventDamageSource() For attacking unit
you need

Triggering Unit for "Attacked Unit"

And Event Damage Source for "Attacking Unit"
08-08-2008, 08:28 AM#8
Shadow_killer
Thanks Eznce and Pyrogasm it worked.
08-08-2008, 08:34 AM#9
Troll-Brain
Btw attacked unit is simply a slow triggering unit, you should never use it .

Collapse JASS:
function GetAttackedUnitBJ takes nothing returns unit
    return GetTriggerUnit()
endfunction