• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Global miss chance

Status
Not open for further replies.
Level 4
Joined
Nov 25, 2008
Messages
76
Hi fellow hivers

In my map I would like every unit to have a base chance to miss someone that could be increased/decreased in certain situations. Such as a Ranger having higher hit % than a Warrior. Currently in wc3 every strike lands but I have seen maps that could implement such a system. Could anyone help me in figuring out how this can be done?
 
Level 4
Joined
Nov 25, 2008
Messages
76
I have thought about that. However, as I said I want different hero classes to have different hit chances. Lets say a ranger could hit 80% of the time but a warrior could hit 65% of the time. With the evasion I'm not quite sure how this could be done.
 
Level 14
Joined
Nov 18, 2007
Messages
816
there might be, but bash was the first thing that jumped to my mind. And i have a hard time thinking of any other passive ability that does that (theres still an option to trigger it completely, which would be a shitload of work).
 
Level 4
Joined
Nov 25, 2008
Messages
76
Hmm, that "Chance to miss" wont increase more than 1 anyways...

I'm up for trigger ideas as well. Dont have to write the whole code, just pointers would help.
 
Level 4
Joined
Nov 25, 2008
Messages
76
Is this a pointer?

The problem with that as blooddancer said, that it would "heal" the damage after the damage is inflicted. Considering that I plan to add critical hits, the hp check goes out of the window. (A real strong warrior could have a minor chance to inflict great damage, killing a goblin in one strike.) If it is possible, I would like to have a solution that would not inflict the damage in the first place.

Although I must say it is a good alternative that I can use for the time being.
 
Level 4
Joined
Nov 25, 2008
Messages
76
I'll work on it and see if I can implement it. Actually the unit does not have to be close to the attacked unit, as a ranged hero can miss too, so maybe I can use a distance value to measure the distance between the 2 units. I have a question though: If I stop the unit with this way, can I immediately order it back to attack the same unit without user noticing a pause?

Also, I tried the bash ability Miss value. It does work like evasion, setting a unit's to be hit chance rather than to hit chance.
 
Level 22
Joined
Jun 24, 2008
Messages
3,050
@Daeod.

You might wanna get a grip of yourself, and know what you type, when you type in a language like that. Who knows, when your wrong, what do you expect the world to do? Ignore it, or flame the hell out of you.

@Problem.

You could add some system, that adds some type of evasion depending on the attacker.
Eg: Make a Evasion for Warrior when attacked by rangers, and add it when he is attacked by a ranger. But this would work for all units attacking him at the time.

What i would do:
If possible, trigger the whole attack system.
 
Level 14
Joined
Nov 18, 2007
Messages
816
okay...i didnt have the chance to test bash yet (did it by now), and i have to excuse myself, i wasnt aware that bash didnt work the way i expected it to.

Anyway, if you dont mind having a permanent buff on your heros, you could Enum all units every second and if it doesnt have a specific buff and meets certain requirements, cast some ability based off of cripple of silence on it (if you use silence, you have to make sure you dont silence another unit besides the one you want to).
 
Level 4
Joined
Nov 25, 2008
Messages
76
okay...i didnt have the chance to test bash yet (did it by now), and i have to excuse myself, i wasnt aware that bash didnt work the way i expected it to.

Anyway, if you dont mind having a permanent buff on your heros, you could Enum all units every second and if it doesnt have a specific buff and meets certain requirements, cast some ability based off of cripple of silence on it (if you use silence, you have to make sure you dont silence another unit besides the one you want to).

I'm sorry but you lost me there... What would the ability do? Give evasion? If then, wouldnt it apply to all character classes?
 
Level 4
Joined
Nov 25, 2008
Messages
76
Someone else have suggested curse on b.net today. I'll see if I can do what I want with curse. With evasion, it comes down to the same thing: I would not like a static percentage but rather a variable that can be changed depending on which class is attacking.
 
Level 12
Joined
Mar 23, 2008
Messages
942
Someone else have suggested curse on b.net today. I'll see if I can do what I want with curse. With evasion, it comes down to the same thing: I would not like a static percentage but rather a variable that can be changed depending on which class is attacking.

Do a evasion with 101 levels...
Or use this: Intuitive Damage Detection System - Wc3campaigns
And heal the damage after its done. It will work perfectly. The players will never notice.
 
Level 3
Joined
Jun 24, 2008
Messages
30
If you're not good with JASS, you can make a similar system in GUI.

Make a trigger with no events/conditions that handles damage. You could run an if/than/else to see if they miss or not, if they do, then heal the damage back immediately (I did this before on another map, they won't die before getting healed.)

You'll need another trigger or two to add to the previous trigger the event (Created Unit) or (Picked Unit) or whatever "Takes Damage", under Specific Unit event.

You'd need to use this rather than "A Unit is Attacked" in for this, as that would trigger when a unit is attacked, not when they take damage.
 
Level 3
Joined
Sep 25, 2008
Messages
39
You guys are over complicating things.
Give units an ability based from critical strike. Set it do deal x1 damage and set the always hit variable to true. Then set the %chance in the ability.
Give every unit 100% evasion.

This has an added benefit of also showing damage dealt with red numbers.
 
Level 4
Joined
Nov 25, 2008
Messages
76
You guys are over complicating things.
Give units an ability based from critical strike. Set it do deal x1 damage and set the always hit variable to true. Then set the %chance in the ability.
Give every unit 100% evasion.

This has an added benefit of also showing damage dealt with red numbers.

Alright I'll try this and see if it works.

Thank you all for your input.
 
Level 4
Joined
Nov 25, 2008
Messages
76
I tried this system and it does indeed work. However there is one tiny little problem.

Units will never ever hit allied units. Since teamkill is an essential part of my map (Sweet betrayal) how can I amend this factor in?
 
Level 4
Joined
Nov 25, 2008
Messages
76
That's an interesting idea, however after the enemy is killed I would have to reset the owner back as an ally. That raises another question, how do I tell the game to check for an event such as "Attacked unit is dead" or "Unit stopped attacking" AFTER firing that trigger you mentioned?

So the events would be

Specific Trigger activated
Every x second

Cond

Attacked Unit is dead or Unit stopped attacking

A
Set to default ally system
Disable the prior trigger
 
Level 4
Joined
Nov 25, 2008
Messages
76
Yeah I can do that, but I want this specific trigger to activate when the prior trigger is activated, not before. Is there a check that I can do to see if that prior trigger has been run before?

Actually now that I think about it, I can do this via a global variable. Still though, is it ever possible to make a trigger run after another has been activated?
 
Status
Not open for further replies.
Top