HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

How to detect a critical strike success?

06-28-2003, 06:24 PM#1
dataangel
I had an idea to add a cool special effect for when critical strike is succesfull in my map -- only problem is I'm at a loss on how to detect a success.

Thing's I've tried:

-Adding a sound to it in the ability editor and setting up triggers to detect the sound. (Sound simply doesn't play)
-Scouring through blizzard.j to see if they had a temporary floating text variable in there to hold the critical strike numbers, so I could just tell if it was empty or not. No luck.
-Adding an order string in the ability editor. A success doesn't count as the order being given.
-Tried using the new ability events to detect it. Nope
-Making it do a float amount of damage, like 121.62 or something like that, and then I would just detect when a unit has a non-integer amount of damage done to it. Problem is due to the equation for armor (it multiplies by .06) just about every damage is a float. I could change the armor factor to 0 in gameplay constants, but I want armor to be a factor.
-Making the effect the target art for critical strike in the editor. No luck. Doesn't work as caster art or special art either.

The only thing I can think of doing now is setting up an equation to predict what the damage should be, and then if it's twice that do the effect. Problem is that will be a MAJOR PAIN IN THE ARSE. Even though there aren't that many guys in the map that will have the skill, I'd have to have the damage equation, and make it take into account all manner of power ups and item bonuses and stuff like that. Also, it'd be hard to predict the damage unless enemy units had a constant amount of armor -- at the moment they don't.

Anybody have any bright ideas?
06-28-2003, 08:10 PM#2
Raptor--
i dunno, about actually detecting it, but couldn't u easily simulate it by making a skill that doesn't do much but increments the % chance, and then u could make it look like a critical strike by using floating text above the hero when he lands one
06-28-2003, 09:13 PM#3
dataangel
Quote:
Originally posted by Raptor--
i dunno, about actually detecting it, but couldn't u easily simulate it by making a skill that doesn't do much but increments the % chance, and then u could make it look like a critical strike by using floating text above the hero when he lands one


How does making a skill that ups the chance simulate it?
06-28-2003, 09:27 PM#4
Raptor--
oh, whoops, i was thinking of the wrong skill, ups the multiplier

right, critical is always a set %
06-28-2003, 10:31 PM#5
Guest
Well, seeing as how when a Blademaster does a critical strike, he has a different animation. Maybe if you changed the animation of whatever unit you're using to have an animation to play when it casts critical strike, that might work. Of course, that would require a lot of fiddling with the unit's sprite, but it might work...
06-29-2003, 07:42 AM#6
Dead-Inside
I can solve this with triggers, but you'll have to make a dummy critical strike and run it trough triggers completely.
06-29-2003, 07:58 AM#7
dataangel
Quote:
Originally posted by Dead-Inside
I can solve this with triggers, but you'll have to make a dummy critical strike and run it trough triggers completely.


Yeah. I could too -- it's just that calculating damage is going to be a pain in the $#@!
06-29-2003, 12:51 PM#8
Dark Azonik
i dont think this would help..but i know that in event there is ''Wait For Sound'' if u could change the sound when the BM does his critical strike it would play this sound.(just use a footmen's attack sound) so the trigger would be

Event-Wait for sound
condition-(hmm i dunno)
action:whatever you want
06-29-2003, 12:55 PM#9
Dark Azonik
im kinda confused but if you want to know how to make highter damage with crit strike..

making a spell that make it do like 100X the damage time its pretty easy...(should have told in my tuto...oh wait i did lol)i know that in redsculls spell editor there is 2 fields for this spell
1.the number of X that the units damage will be multiplied
2.the chance in % that the attack will do a critical strike...

of course base ur ability of crit strike.
06-29-2003, 01:11 PM#10
Dead-Inside
dataangel...

Damage calculations would be made on the dmg made by the unit that attacks with critical strike. Either set a vavlue and have it as "Average Dmg" for the unit (not using 50-60 thingy dmg the unit actually has but have a variable with 55).
Now, depending on level, you do the dmg x1, x2 or x3, this will do and extra dmg point by the unit, 2 extra, or 3 extra.

The triggering thing is a "A unit is attacked" thingy
Where attacking unit is the BM
Now, take a random number, this depends on what level the spell is (Need an "If/Then/Else" here) and pick a random number between whatever, so you get the right precentage...
If the random number (Let's say 20%, meaning a random number between 1 and 5) = 3, then do nothing else do skip remaning actions.
Now if nothing is skipped, you do extra dmg to the attacked unit,
Assaign the text, and do the animation. As well as trigger whatever else you want.

Regards
Dead-Inside
06-29-2003, 01:12 PM#11
weaaddar
Dataangel to detect critical strike you rely on the unit attack event. Then there is an action that gets the damage done assume that the first hit will probably not be a critical strike. Set this to the constant. Then you do a detection if the Attack damage>1.5 (there is a range in attack and this is just buying fudge around room) then there was a critical strike. Hero damage doesn't fly up so radicially so you probably never have to up the constant damage done.
06-29-2003, 03:57 PM#12
Raptor--
hmm, ya, i just noticed theres a "takes damage" event, and a "damage taken" real comparison

were those just added in FT?

although theres no unit-type comparison of "unit dealing damage"
06-29-2003, 05:37 PM#13
dataangel
Quote:
Originally posted by weaaddar
Dataangel to detect critical strike you rely on the unit attack event. Then there is an action that gets the damage done assume that the first hit will probably not be a critical strike. Set this to the constant. Then you do a detection if the Attack damage>1.5 (there is a range in attack and this is just buying fudge around room) then there was a critical strike. Hero damage doesn't fly up so radicially so you probably never have to up the constant damage done.


Yeah, that's probably the easiest way. I'd have it change the constant everytime they leveled up. (With heroes having 10,000 levels in some maps, there _will_ be drastic damage changes)

Raptor: No, those are from classic. And actually there is a "unit dealing damage." It's "Attacking Unit" vs. "Attacked Unit"
06-29-2003, 05:41 PM#14
weaaddar
Alright. I forgot that you can get to level 10k...

However its hard to get the constant, so you may actually have to manually program it per level. (Like 50 then every level since it adds 1.8 agility add 2 damage to the constant)
Edit:
You can actually figure out the agility growth thanks to the new triggers, assuming that the BM mainstate remains agility.