increase hit% across the board

The place to post your WML questions and answers.

Moderators: Forum Moderators, Developers

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.
User avatar
Crow_T
Posts: 851
Joined: February 24th, 2011, 4:20 am

increase hit% across the board

Post by Crow_T »

I'm playing DM, and there is a chocobone with a tick of energy left. I send not one, or two, but four heavy infantry to kill it- I need only one hit- and they all miss. Time to reload the turn...

That's not very satisfying to a player. I feel as though hit percentages could be increased 10%, or even 20%, across all units. If you really wanted to go crazy go 20% with a random damage range, but either way, whiffing is just bad. Really high hit rates combined with a decent damage range, for a L1 1 damage is better than nothing, would be satisfying on some level. The higher the level, the tighter the range. Elf Archer 1-5 damage 70% chance to hit, Sharpshooter 8-10 damage 90% chance.

Yes I know this will never happen, just a rant. Crap like this though just makes me close out the game and stay away for a few days, it takes the fun out. :annoyed:

Insinuator
Posts: 706
Joined: January 6th, 2004, 10:42 pm
Location: Portland, OR

Re: increase hit% across the board

Post by Insinuator »

Rant to people who care. Not here.

User avatar
alexanderthegre
Posts: 193
Joined: December 8th, 2011, 3:23 am
Location: nowhere

Re: increase hit% across the board

Post by alexanderthegre »

Well, you can certaintly increase the chance to hit using WML. I'm not sure how, though. IIRC there was something like this in the first scenario of bad moon rising.

User avatar
Crow_T
Posts: 851
Joined: February 24th, 2011, 4:20 am

Re: increase hit% across the board

Post by Crow_T »

If someone could point me to the files that I can modify, at least for hit%, it would be appreciated- I assume they are set up like defense/movement types?


User avatar
Crow_T
Posts: 851
Joined: February 24th, 2011, 4:20 am

Re: increase hit% across the board

Post by Crow_T »

Thanks for the link, but I was wondering where to hack the files that control each attack type, defense is described by movetypes like smallfoot and swimmer for instance, are attack types done in a similar fashion?

User avatar
Crendgrim
Moderator Emeritus
Posts: 1328
Joined: October 15th, 2010, 10:39 am
Location: Germany

Re: increase hit% across the board

Post by Crendgrim »

If you are referring to resistances against certain attack types, that is also done in the movement definitions.
UMC Story Images — Story images for your campaign!

User avatar
Crow_T
Posts: 851
Joined: February 24th, 2011, 4:20 am

Re: increase hit% across the board

Post by Crow_T »

I want to change, say, magic attack from 70% to 90%, mace attack from 40% to 60%, etc. across all units/attacks. Can this be done? Just looking now, attack percentages seem unaffected by terrain, only defense is affected by terrain. I just want to boost the chance to hit from the offensive side. Does this make sense?

User avatar
Pentarctagon
Project Manager
Posts: 4422
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: increase hit% across the board

Post by Pentarctagon »

This ability would do that:

Code: Select all

[chance_to_hit]
  id=add_chance
  name= _ "add_change"
  description= _ "description"
  add=20
  active_on=offense
  cumulative=no
[/chance_to_hit]
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code

Insinuator
Posts: 706
Joined: January 6th, 2004, 10:42 pm
Location: Portland, OR

Re: increase hit% across the board

Post by Insinuator »

I don't think you understand how percentage to hit is calculated. Save for the Marksman & Magical abilities, ALL chances to hit are based off terrain, not weapon type. If you really want to make this change yourself, reference this macro:

Code: Select all

#define WEAPON_SPECIAL_MARKSMAN
    # Canned definition of the Marksman ability to be included in a
    # [specials] clause.
    [chance_to_hit]
        id=marksman
        name= _ "marksman"
        description= _ "Marksman:
When used offensively, this attack always has at least a 60% chance to hit."
        value=60
        cumulative=yes
        active_on=offense
    [/chance_to_hit]
#enddef
The parts near the bottom are the ones you can manipulate in your own custom attack type. Then units that you give that weapon ability will have a forced higher chance to hit. This will simulate what you desire closely, but not perfectly.

EDIT: Criminey, ninja'ed by Pentarctagon! His code will do just what you want. But still be aware, you will have to give units that ability.
Last edited by Insinuator on June 15th, 2012, 10:47 pm, edited 1 time in total.

User avatar
Crow_T
Posts: 851
Joined: February 24th, 2011, 4:20 am

Re: increase hit% across the board

Post by Crow_T »

But I would need to do that for each character, right?
For example here is the elf archer attacks:

Code: Select all

[attack]
        name=sword
        description=_"sword"
        icon=attacks/sword-elven.png
        type=blade
        range=melee
        damage=5
        number=2
    [/attack]
    [attack]
        name=bow
        description=_"bow"
        icon=attacks/bow-elven.png
        type=pierce
        range=ranged
        damage=5
        number=4
    [/attack]
nowhere does it say what the hit% is, but I'm going to assume the "type" is where I can change what I need to. Is this correct, and if so where can I find them?

Insinuator
Posts: 706
Joined: January 6th, 2004, 10:42 pm
Location: Portland, OR

Re: increase hit% across the board

Post by Insinuator »

Crow_T wrote:But I would need to do that for each character, right? Nowhere does it say what the hit% is, but I'm going to assume the "type" is where I can change what I need to. Is this correct, and if so where can I find them?
First question, qualified yes. Each unit type, not each unit.

Second question, no. Best way (IMO) would be to define a custom macro using the "chance_to_hit" code and then putting that under a [specials] tag in your custom unit.

User avatar
Pentarctagon
Project Manager
Posts: 4422
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: increase hit% across the board

Post by Pentarctagon »

Moved to the WML Workshop, since you are now asking about how you would go about implementing this yourself.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code

User avatar
pauxlo
Posts: 1047
Joined: September 19th, 2006, 8:54 pm

Re: increase hit% across the board

Post by pauxlo »

If you just want all the units (both own and enemy ones) to hit more often, edit the defenses (defined with the movement types, usually). The chance to hit special is then only needed to adapt magical and marksman.

User avatar
Crow_T
Posts: 851
Joined: February 24th, 2011, 4:20 am

Re: increase hit% across the board

Post by Crow_T »

So basically, these numbers mean nothing and there is no way to modify the file that the game is pulling them from.
Image

Post Reply