HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Charge! how do i make this ability?

08-18-2003, 12:47 AM#1
zergiler
i want an ability (hero ability not unit) that can be used by a knight where he charges to the unit you select to be on the recieveing end, he stuns and deals damage to the units in the way. also he hits the target unit dealing massive damage. example: the caster selects charge and selects a unit. the caster charges towards that unit moving or knocking out of the way any units in the way and then deals a blow to the enemy unit. any suggestions?
08-18-2003, 01:00 AM#2
Norbo
That'd be pretty hard to do.

Hrmm.

I suppose you could...

Hide the casting unit, create a flying unit (the Charger unit that actually charges) that is facing the same way and looks the same as the previous hero unit..

Make that unit invulnerable (if not invulnerable, then be sure to transfer his hp back to the knight when he unhides), and order him to move to the position of the order. Keep a region on him while he moves and when any unit gets in that region, hurt them and move them instantly away a small distance. (move instantly and set hp value)

Once you get to the position of the final unit, then do a lot of damage to him. You'd have to record the targetted unit or it would be hard to tell which is the real enemy.


After that is all done and nice, poofify the flying unit and put the real knight there again.

Problems: Hard to do, might end up in a non-pathable area, or past cliffs. If you ended up in a non-pathable area.. you're real knight would be put somewhere a bit off-place, or wouldn't be placed at all.

If I were doing it, I would not have it a targettable ability. I'd just make him run forward 500 units in his facing direction and do the same effect... but that's me.
08-18-2003, 01:02 AM#3
zergiler
yea that seems a bit better. hmm might be puttin the bar to high and i dont think i can reach it. im gunna do some tinkering.
08-18-2003, 01:03 AM#4
Cloud-Strife
I dont think this would be possible without a load of triggering. I cant think of any real way you can make the units get "knocked away" and it wouldnt work in all places of a map (if they were next to a wall they wouldnt go anywhere) but there may be a trigger that you can make that will make any unit that gets near the charging unit receive knockback, but i dunno how that would work. As for the dmg, i think 1 way would be to have the spell create an invisible flying unit with XXX hp and have the unit always be above the charging hero and when the charging hero gets to the target, the unit could disappear and the target would take the dmg equal to the invisible unit's life. Figuring a difference between target and units in the way would be a different story however.
08-18-2003, 01:10 AM#5
Norbo
Naww, wouldn't be that hard. You'd decide on a value.. or a range of values.

If a unit entered the region that was following the charging unit (via move region calls on a periodic timer that is turned on when charge is activated) then it is moved instantly away, preferably away from the charging unit. You'd have to figure out the facing angle of the charging unit (easy) and then send the unit either to the left or right of the charging unit.

To do that, I suppose you could take the facing angle and subtract 90 or add 90, and move him away 100-200 units (not far, but noticable.) You'd use "move instantly to point with polar offset".

For damage, just modify the units entering the following regions hp... -100 or 200 or something, and if it has levels, you'd either have to see what the unit was (different unit for each level, charger (level 1) charger (level 2) etc.)



** If you have tons of chargers at the same time, it might lag a bit... maybe. You'd have to have a boolean and a forloop.

For each integer A 1 - (how many players in the game.. maybe 8?)
{
If (IsCharging[Integer A] = true)
{
center ChargingRegion[Integer A] to position of unit (units owned by player(integer A) of type (Charging Unit A))
}
}
That center command assumes that you have a region array with a region for each player for charging and its already set, and if you have multiple levels of charging units, that "Charging Unit A" would have to be an 'Or' for Charging unit A, B, C, etc..



... if that makes sense.


*** You know what, if I get bored someday, I might make the charge ability and put it up here. Seems fun.
08-18-2003, 04:50 AM#6
Zoizite
First off, you need a targetable dummy spell. I use Unholy Frenzy for this. Make sure you set all the buff/duration values to 0, also.

Make a "GetTarget" trigger. This would be A unit is issued an order targeting a unit. Issued order="unholyfrenzy" etc. Set your target variable to targeted unit.

Now, here's the fun(/sarcasm) part.
Pause your unit, have it play whatever animation(attack, walk, death, whatever).
Then set up a periodic event, and move your unit(instantly), in fractions of the total distance to the target unit.(use polar offset) This isn't fun, trust me. It involves quite a bit of math for it to look right. I use this in my matrix attack skill(see sig), and it was hell to get it right. This is also the reason I'm not just giving you the trigs.

When your unit is within a certain range(100 is good) have it spawn an invisible caster that casts a damage spell(no SFX). Edited Shadow Strike is good here, but you need to take the buffart out of nightelfunitfunc.txt, or you get the little critter.

I'm not sure how to check if there's a wall in the way, but I plan on doing a plain charge skill as well(no jumping involved) so I will need to figure this one out as well.

Hope I made sense here.

[edit] Btw, the moving part was nowhere near as hard as getting the trailing shadows to look right was.

[EDIT AGAIN] You think it would look better if the "shadows" didn't have a ground shadow below them?
08-18-2003, 09:22 AM#7
piRo-piOn
wow... what about stating the obvious?

when the spell is cast, make the knight invulnerable, and owned by neutral passive (no color change) remove his collition and give him the passive immolation ability, you can also add a buff to increase his movement rate if you want to.

Then just get him to attack the target unit... an even easier way to do this ould be to completeley replace the knight with a different unit with the same model.
08-18-2003, 10:51 AM#8
Zoizite
Mine was to make it look good. ^^

400 max speed hardly looks like he's charging. If he's fine w/ that, then it's easy. Could give the dummy unit a Wind Walk edit for extra speed, though.