a couple of [chance_to_hit] questions
Moderator: Forum Moderators
Forum rules
- Please use [code] BBCode tags in your posts for embedding WML snippets.
- To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
a couple of [chance_to_hit] questions
1. Based on the way Marskman and Magic are implemented, it would appear that "cumulative" in [chance_to_hit] works a little different than one might think - that is, a [chance_to_hit] that is "cumulative" overlaps with the existing chance to hit, so that Marskman is the better of normal chance to hit or 60%.
I had an idea to create a weapon special, "Skillful" - your chance to hit is improved by 10%.
So, if the unit you are attacking has 70% defense, you would have a 40% chance to hit, and if they have a 20% defense, you would have a 90% chance to hit, etc.
Is there any way to implement this in WML right now?
2. Affecting the opponent's chance to hit.
Let's say I wanted to make a weapon special "take cover" - a ranged "attack" that does no damage, but makes you harder to hit with ranged attacks (for example, it drops your opponent's chance to hit). How would this interact with "Magic" or "Marksmen" (or custom abilities of that type)?
I had an idea to create a weapon special, "Skillful" - your chance to hit is improved by 10%.
So, if the unit you are attacking has 70% defense, you would have a 40% chance to hit, and if they have a 20% defense, you would have a 90% chance to hit, etc.
Is there any way to implement this in WML right now?
2. Affecting the opponent's chance to hit.
Let's say I wanted to make a weapon special "take cover" - a ranged "attack" that does no damage, but makes you harder to hit with ranged attacks (for example, it drops your opponent's chance to hit). How would this interact with "Magic" or "Marksmen" (or custom abilities of that type)?
Insert nifty witticism here... if only I had one.
Hmmh...instead of value=60 (or whatever), try add=10 (with both values for cumulative=, I don't know which you should use). I just glanced at the weapon specials code, and it looks like there's an add= key available in addition to value= and multiply=, but looks like it's undocumented. If you'd try this and report back on whether it works, it'd be nice.deoxy wrote:1.
Hard to say. Try it?deoxy wrote:2.
Thanks! (Yes, I do try to check the documentation fairly well before I ask this stuff.) I'll give it a shot.zookeeper wrote:1. Hmmh...instead of value=60 (or whatever), try add=10 (with both values for cumulative=, I don't know which you should use). I just glanced at the weapon specials code, and it looks like there's an add= key available in addition to value= and multiply=, but looks like it's undocumented. If you'd try this and report back on whether it works, it'd be nice.
Well, "try it" is a bit hard, sincezookeeper wrote:2. Hard to say. Try it?
small amount of change + randomness = hard to know what exactly happened
I've had 18 attacks in a row miss a surrounded 70% unit before (3 attacks per surrounding unit), so judging the actually chances from game results is definitely not as easy as it might sound.
I guess I could set up some fairly extreme situations and run them multiple times... someone who actually knows how it works would be better, though.
Thanks for the quick response! I'll try out that first thing later today (if I get time).
Insert nifty witticism here... if only I had one.