increase hit% across the board
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.
Re: increase hit% across the board
Crow_T: I think you missed this part (maybe you did not, but that is how it looks to me):
For each unit type, this is defined in the [defense] tag. For most units, these are defined in the Wesnoth data directory in core/units.cfg. Scroll down to the end of the file, under "Move Types". So, if you wanted to hack the game to have it be more enjoyable for yourself locally, this is where you can do that. And then you could change some abilities like marksman or magic separately as explained above.
If you wanted it to work for, say, a campaign for others as well, then some of the suggestions made above would be better. (Well, that would be generally better than hacking the core files, but the hack would be the quick and dirty workaround.)
Or check out the 4th paragraph here, starting with "Every unit has a chance of being hit based on the terrain it is in..."Insinuator wrote:Save for the Marksman & Magical abilities, ALL chances to hit are based off terrain, not weapon type.
For each unit type, this is defined in the [defense] tag. For most units, these are defined in the Wesnoth data directory in core/units.cfg. Scroll down to the end of the file, under "Move Types". So, if you wanted to hack the game to have it be more enjoyable for yourself locally, this is where you can do that. And then you could change some abilities like marksman or magic separately as explained above.
If you wanted it to work for, say, a campaign for others as well, then some of the suggestions made above would be better. (Well, that would be generally better than hacking the core files, but the hack would be the quick and dirty workaround.)
SP campaigns: Galuldur's First Journey (1.12 & 1.14) & Grnk the Mighty (1.10 & 1.12)
AI experiments: Micro AIs (wiki, forum thread, known/fixed bugs), Fred, AI-demos add-on
AI experiments: Micro AIs (wiki, forum thread, known/fixed bugs), Fred, AI-demos add-on
- alexanderthegre
- Posts: 193
- Joined: December 8th, 2011, 3:23 am
- Location: nowhere
Re: increase hit% across the board
I got this code from BMR. I haven't tested it. The author of BMR probably wrote the macro, look in there somewhere.
Code: Select all
{FORCE_CHANCE_TO_HIT side=2 side=1 100 (
[variable]
name=turn_number
less_than=10
[/variable]
)}
- Pentarctagon
- Project Manager
- Posts: 5564
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: increase hit% across the board
You could also create an era whose sole purpose was to give all attacks the special I posted before to all leaders in a turn 1 event, then give it to all attacks of all units that are recruited in a recruit event. For example, the recruit event would essentially be this:
Code: Select all
[event]
name=recruit
first_time_only=no
[object]
silent=yes
[effect]
apply_to=attack
[set_specials]
[chance_to_hit]
id=id_here
name= _ "name here"
description= _ "description here"
add=20
active_on=offense
cumulative=no
[/chance_to_hit]
[/set_specials]
[/effect]
[/object]
[/event]
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
take one down, patch it around
-2,147,483,648 little bugs in the code
Re: increase hit% across the board
If I may make an observation:
0.0655%
The chance that four heavy infantry would miss on all their attacks, assuming the chocobone was on 40% defense terrain. (The OP did not mention the chance to hit, but 40% is fairly common.) This is approximately a 1-in-1500 chance, so it is practically bound to happen sooner or later, given the number of combats per campaign, and the number of people playing campaigns.) Does that mean the system is flawed? Perhaps, but there are two other numbers I would look at:
0.00656%
The chance that four heavy infantry would miss on all their attacks, assuming the defense rating was lowered to 30%.
0.00168%
The chance that four units with three attacks each would miss on all their attacks, assuming the defense rating stayed at 40%.
You get a smaller chance of failure by using better tactics than by changing the system. Heavy infantry are usually a good choice against chocobones since chocobones are weak against impact and heavy infantry are strong against pierce. However, once the chocobone is down to "a tick of energy", the heavy infantry's low number of attacks is a significant liability. (Unless... well, there are other strategies that might have been applicable, but there is no need to go into them here, I think. My point is that alternatives might be worth considering, not that they have to be considered.)
That is not to say you should not alter your game locally to better suit you. Rather, it might be worth asking if you are overreacting and is this work worth it? (Reloading the turn once in a while seems to me to be the smaller price to pay.)
Also keep in mind that this change is a double-edged sword. Not only will you become more likely to strike down your foes, but your foes will be able to more easily break through your defensive lines. Some scenarios might even become unbeatable. Still, this is all theoretical. Nothing beats a nice, practical trial to see how something actually works out.
That being said, how about I contribute something to the implementation? Let's see... maybe an example (of the long way to implement this)? To make a chocobone easier to hit, you would look for in the above-mentioned
In addition, you would need to make a similar edit to
0.0655%
The chance that four heavy infantry would miss on all their attacks, assuming the chocobone was on 40% defense terrain. (The OP did not mention the chance to hit, but 40% is fairly common.) This is approximately a 1-in-1500 chance, so it is practically bound to happen sooner or later, given the number of combats per campaign, and the number of people playing campaigns.) Does that mean the system is flawed? Perhaps, but there are two other numbers I would look at:
0.00656%
The chance that four heavy infantry would miss on all their attacks, assuming the defense rating was lowered to 30%.
0.00168%
The chance that four units with three attacks each would miss on all their attacks, assuming the defense rating stayed at 40%.
You get a smaller chance of failure by using better tactics than by changing the system. Heavy infantry are usually a good choice against chocobones since chocobones are weak against impact and heavy infantry are strong against pierce. However, once the chocobone is down to "a tick of energy", the heavy infantry's low number of attacks is a significant liability. (Unless... well, there are other strategies that might have been applicable, but there is no need to go into them here, I think. My point is that alternatives might be worth considering, not that they have to be considered.)
That is not to say you should not alter your game locally to better suit you. Rather, it might be worth asking if you are overreacting and is this work worth it? (Reloading the turn once in a while seems to me to be the smaller price to pay.)
Also keep in mind that this change is a double-edged sword. Not only will you become more likely to strike down your foes, but your foes will be able to more easily break through your defensive lines. Some scenarios might even become unbeatable. Still, this is all theoretical. Nothing beats a nice, practical trial to see how something actually works out.
That being said, how about I contribute something to the implementation? Let's see... maybe an example (of the long way to implement this)? To make a chocobone easier to hit, you would look for
Original undeadfoot
core/units.cfg
and replace it with Lowered defenses
core/units/undead/Skele_Chocobone.cfg
, since a chocobone's village defense is overridden there. So basically, follow this example for all the [movetype]s in units.cfg
, plus edit each [unit_type] that overrides defenses. (Hmm... there might be a reason others are favoring an object-based approach. However, seeing how to do it the long way might give you a better understanding of what you are doing.)Re: increase hit% across the board
I think Pentarctagon's suggestion is the most convenient. Write an event (or several) which ensures that every unit receives such a +10% CtH weapon special on all their attacks, wrap those events in a macro and use that macro in every scenario you intend to play, or in every era you want to use.
The LessLuck Era (1.6) does something very similar, and you could use that as an example.
The LessLuck Era (1.6) does something very similar, and you could use that as an example.
Re: increase hit% across the board
Thanks for the replies and the patience
Out of curiousity, when Insinuator said this:
Thanks again, I'll also look into modifying movetypes. I was thinking of increasing hit% but also increasing resistances a slight bit as a balance.
Out of curiousity, when Insinuator said this:
Which file would I be modifying? And would this code work there?First question, qualified yes. Each unit type, not each unit.
Code: Select all
[chance_to_hit]
id=add_chance
name= _ "add_change"
description= _ "description"
add=20
active_on=offense
cumulative=no
[/chance_to_hit]
I think maybe I need to set up my workstation like an old lady at bingo0.00168%
The chance that four units with three attacks each would miss on all their attacks, assuming the defense rating stayed at 40%.
-
- Posts: 706
- Joined: January 6th, 2004, 10:42 pm
- Location: Portland, OR
Re: increase hit% across the board
Well, if I remember correctly, you can either define that as a macro within it's own separate file and reference it or within your scenario file. Then, you alter the Unit file directly by inserting your macro's name under the [specials] tag. Remember, though, you'll need to useCrow_T wrote:Out of curiousity, when Insinuator said this:Which file would I be modifying? And would this code work there?First question, qualified yes. Each unit type, not each unit.Code: Select all
[chance_to_hit] id=add_chance name= _ "add_change" description= _ "description" add=20 active_on=offense cumulative=no [/chance_to_hit]
Code: Select all
#define NAME
Code: Select all
#enddef
Re: increase hit% across the board
Ok thanks, I'm going to try modding the movetype list first, only because I'm still pretty new with the code and it seems easier. If I end up liking this and want to make a campaign that utilizes this custom unit.cfg, how do I go about referencing it? Thanks again, the help is much appreciated, I think this is finally sinking into my thick skull.
Re: increase hit% across the board
Editing your units.cfg (and some of the individual unit .cfg's if/when necessary) is only suitable for making your copy of Wesnoth work differently. If you want to do such changes in a campaign you want other people to be able to play, then you have to do it differently; either according to my/Pentarctagon's suggestion, or by only using custom units in your campaign (based on core units, obviously, with only their defenses changed).Crow_T wrote:Ok thanks, I'm going to try modding the movetype list first, only because I'm still pretty new with the code and it seems easier. If I end up liking this and want to make a campaign that utilizes this custom unit.cfg, how do I go about referencing it?