• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Triggering Phoenix Fire

Status
Not open for further replies.
Level 6
Joined
Jan 2, 2007
Messages
189
This system works very much like phoenix fire in that the hero can run around freely while shooting projectiles while moving. However, I want to change it in two ways:

-the hero "attacks" (right-clicks) a unit and the triggered phoenix fire only hits that unit.

-the projectiles are triggered so that they can miss thier target.

I can do the projectile part but what i cant figure out is how to pull it all together and make it act like phoenix fire.

I was thinking of making it into 3 parts:

-Trigger one- would activate when the hero attacks a unit. the attacked unit is stored into a variable (z).

-Trigger two- checks every x amount of time if the target (z) is within x range of the hero. If it is, if fires trigger three.

-Trigger three-fires the projectile.

Is this a proper/efficient way of doing this? thank you in advance for all your help!
 
Hm, I'd use A unit is attacked event, store the attacking unit to the attacked unit and then add to another trigger the event Unit - (Attacked unit) takes damage. That trigger will contain a damage detection system, that will check if the Damage Source equals to the Attacking unit. You need a physical damage detection system though, so that it doesn't work for any type of damage (e.g. Spells' damage).
 
Level 6
Joined
Jan 2, 2007
Messages
189
hmm i dont quite understand the point of the damage detection (possibly bc i didnt explain myself correctly) because the only time the attacked unit takes damage is from the triggered projectiles. The attacking hero doesnt actually do any damage from its "normal" attack.
 
Well, that's even easier to handle!
Use hashtables.
Once a unit is attacked an you create the projectile,
  • Hashtable - Save Handle of (Attacking unit) as Key(source) of (Key(Attacked unit)) in Hashtable
Then, when you damage the target with the projectile, check if the damaged unit has been damaged by the stored Key(source) {I guess you cause your attacker to cause the damage, not the dummy projectile, right?} and if that is true (it will be a Unit comparison), pick up every nearby unit and damage it the way you want it, so as to assimilate the Phoenix Fire effect.
 
Level 6
Joined
Jan 2, 2007
Messages
189
hmm it makes sense but i still dont see how it will work. the hero only has to attack its target once and from that point on the projetiles fire every x amount of time as long as the target stays within range of the hero. Im understanding what youre doing but i dont think we're on the same page haha.

ive never played but from what i understand its very similar to the combat system in WoW. like the hero selects its target and will then automatically "attack" (in my case, fire a projectile) the target until either the target dies or a new target is selected.
 
Status
Not open for further replies.
Top