[solved]Is weapon special is active?
Moderator: Forum Moderators
[solved]Is weapon special is active?
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.
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
| Abandoned: Tales of the Setting Sun
GitHub link for these projects
Re: Is weapon special is active?
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...
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...
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
Re: Is weapon special is active?
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.
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
| Abandoned: Tales of the Setting Sun
GitHub link for these projects
Re: [solved]Is weapon special is active?
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.
The first of those commits also fixes bug #22179.
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