HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

System to detect pheonix fire casting

05-21-2006, 12:09 AM#1
n13astra
I want to be able to detect the auto fire of the pheonix fire ability. So far, i have the ability cast a buff, which i detect via triggers. If the unit has the specific buff, i create a dummy caster and cast the "slow" onto the unit.

Here is the trigger which handles the abilities:

Trigger:
Special Item Weapon Handle
Collapse Events
Time - Every 0.10 seconds of game time
Conditions
Collapse Actions
-------- Item Weapon Abilities which do not attack STRUCTURES --------
Set Temp_Unit_Group = (Units in (Playable map area)(((Matching unit) is A structure) Equal to False))
Collapse Unit Group - Pick every unit in Temp_Unit_Group and do (Actions)
Collapse Loop - Actions
-------- Slowing Star Item --------
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Picked unit) has buff Slowing Stars ) Equal to True
Collapse Then - Actions
Unit - Remove Slowing Stars buff from (Picked unit)
Unit - Create 1 Slowing Stars for Neutral Hostile at ((Position of (Picked unit)) offset by (0.00, 0.00)) facing 0.00 degrees
Unit - Order (Last created unit) to (Order(slow)) (Picked unit)
Collapse Else - Actions
Do nothing
Custom script: call DestroyGroup (udg_Temp_Unit_Group)

That works like a charm, but the problem is this. Because i've picked every unit, and checked for the buff, i cannot tell which player actually cast the ability in the first place, hence cannot give the kill bounty to that player.

Is there a way around this problem?
05-21-2006, 01:09 AM#2
Vexorian
Phoenix fire is the kind of ability that is easier to emulate than detect
05-21-2006, 01:15 AM#3
Anitarf
Wouldn't damage detection together with the buff left behind by the ability make it simple enough?
05-21-2006, 01:39 AM#4
Vexorian
not as simple as emulating it
05-21-2006, 03:01 AM#5
n13astra
How does one emulate it?
05-21-2006, 08:49 AM#6
PerfectlyInsane
Hmmm not sure what you mean.. The bounty of the kill is automatically assigned without triggers. See battleships for instance.

The problem is detecting when a unit attacks with phoniex fire, in which the unit attacked unit does not die.
05-21-2006, 08:57 AM#7
n13astra
Yeah the bounty is correct, but the problem is that my current method of detecting pheonix fire does not record the player it came from, hence if it the ability the dummy unit casts kills the unit, then the bounty does not go to the player that initally fired it. Have a look at my trigger code up top.

Anyways, Vexorian - How do i emulate it?
05-21-2006, 09:15 AM#8
Anitarf
I disagree with Vex on this one, emulating the projectiles is more work than simply detecting damage from phoenix fire. Once a system for detecting damage is made, the job is more or less done; you just have to check for specific buffs left behind by those phoenix fire based attacks that are supposed to have special effects and apply those effects.

Granted, a good damage detection system needs some Jass, but so would a phoenix fire emulation system.
05-21-2006, 09:52 AM#9
PitzerMike
You could also use a different phoenix fire ability for each player (with a different buff).
Then you'd be able to tell which player it was by the buff.
05-21-2006, 10:57 AM#10
n13astra
Yeah i thought about having a different buff for each player, but then i would need to do that for every weapon.

Can someone suggest a starting point/sample code for a damage detection system? I dont know JASS, but am willing to learn if i have no other method.
05-21-2006, 12:48 PM#11
Vexorian
Quote:
Originally Posted by Anitarf
I disagree with Vex on this one, emulating the projectiles is more work than simply detecting damage from phoenix fire. Once a system for detecting damage is made, the job is more or less done; you just have to check for specific buffs left behind by those phoenix fire based attacks that are supposed to have special effects and apply those effects.

Granted, a good damage detection system needs some Jass, but so would a phoenix fire emulation system.
Little problem is that detecting damage would be much harder, to recognize if damage was actually caused by phoenix fire.

Missiles are really easy to make, just make some dummy cast acid bomb to the targets, you'll need acid bomb anyways for the damage and the buff
05-21-2006, 12:54 PM#12
Anitarf
Quote:
Originally Posted by Vexorian
Little problem is that detecting damage would be much harder, to recognize if damage was actually caused by phoenix fire.
The ability leaves behind a unique buff. Unless that buff wasn't applied at the moment the unit takes damage event fires, identifying phoenix fire damage should be no problem.
05-22-2006, 02:04 AM#13
n13astra
im confused? How will this allow me to detect the initial player that fired???
05-22-2006, 09:15 AM#14
Anitarf
The Damage Source event response to the Unit takes damage event.