how to manually update number of strikes in combat estimation window?

The place to post your WML questions and answers.

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.
Post Reply
lea
Posts: 301
Joined: October 1st, 2016, 7:25 pm

how to manually update number of strikes in combat estimation window?

Post by lea »

when there is a weapon that can have different number of strikes depending on (for example) value of certain WML variable then Wesnoth seems to update weapon's number of strikes (as shown in combat estimation window) only when such weapon is used by given unit in combat encounter and only after combat encounter starts so it always performs correct number of strikes but seldom shows the correct number of strikes in UI

is the any way to update number of strikes (as shown in combat estimation window) from WML or lua code or otherwise fix this issue?
author of: Altered Era/Ruleset (AKA "Altera"), latest version is on add-ons servers for BfW 1.16 and 1.14, latest version also still supports BfW 1.12 and 1.10, 1.10 server is stuck with older buggy version)
User avatar
beetlenaut
Developer
Posts: 2822
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: how to manually update number of strikes in combat estimation window?

Post by beetlenaut »

I'm pretty sure there is no way to modify the combat dialog itself; you have to modify the information it is reading. You must have an event that modifies the number of strikes, and it depends on when that event fires. If it is in some kind of attack event, that would explain what you are seeing. You probably just need to modify the number of strikes when the WML variable changes instead of when the attack happens. How to do this depends on what exactly you are trying to do. You will get much better suggestions if you explain that.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Post Reply