[solved]Is weapon special is active?

Discussion of Lua and LuaWML support, development, and ideas.

Moderator: Forum Moderators

Post Reply
User avatar
doofus-01
Art Director
Posts: 4122
Joined: January 6th, 2008, 9:27 pm
Location: USA

[solved]Is weapon special is active?

Post by doofus-01 »

Hi,

I've got an external candidate action that controls if the AI will try to use a particular attack. The attack is not always available due to [disable] special, however the [disable] weapon special does not not prevent the AI from successfully using this attack, so I need to put a check in for whether the [disable] special is active or not. Is there some example of how to do that? I look at the unit data with ;inspect, and I don't see how to access that particular piece of info. It almost looks like there might be a way to do this with wesnoth.simulate_combat, but maybe not.

So, I guess my question can be summarized as: How does one check if a weapon special is active or not?

Thanks.
EDIT: Forgot to say, I'm using BfW 1.13.5.
EDIT2: Question answered, or at least made irrelevant.
Last edited by doofus-01 on August 1st, 2016, 12:57 am, edited 1 time in total.
BfW 1.12 supported, but active development only for BfW 1.13/1.14: Bad Moon Rising | Trinity | Archaic Era |
| Abandoned: Tales of the Setting Sun
GitHub link for these projects
mattsc
Inactive Developer
Posts: 1217
Joined: October 13th, 2010, 6:14 pm

Re: Is weapon special is active?

Post by mattsc »

Hi doofus-01,

This isn't going to answer the question you asked, but ... The AI ignoring the [disable] special is a bug (that's probably obvious and goes without saying). Maybe 2 months ago I looked into it and figured out why this is happening. Turns out that there are actually two separate bugs causing the AI to ignore this special in different circumstances (and it working in others). Back then, I was super busy at work and the fix to one of them was not obvious, so I put the problem aside. As of last week, I have a bit more time again, so I am planning to fix this by 1.13.6. It's already on my to-do list.

Of course, that doesn't help you right now...
User avatar
doofus-01
Art Director
Posts: 4122
Joined: January 6th, 2008, 9:27 pm
Location: USA

Re: Is weapon special is active?

Post by doofus-01 »

Thanks, mattsc.

I won't worry about it too much then, since anyone using these early BfW 1.13 versions should expect this sort of thing. I can't think of a case where I'd want to know if a weapon special is active or not, that isn't tied to this bug, so I guess this is closed.
BfW 1.12 supported, but active development only for BfW 1.13/1.14: Bad Moon Rising | Trinity | Archaic Era |
| Abandoned: Tales of the Setting Sun
GitHub link for these projects
mattsc
Inactive Developer
Posts: 1217
Joined: October 13th, 2010, 6:14 pm

Re: [solved]Is weapon special is active?

Post by mattsc »

The two instances of the [disable] weapon special being ignored by the AI that I am aware of have both been fixed now (commits 3c98423547 and cc986bbc50). Hopefully one of them was the cause of the problem you encountered.

The first of those commits also fixes bug #22179.
Post Reply