patchBattle for Wesnoth - Patches: patch #3742, Inner variable for adjacent filter...

Show feedback again

patch #3742: Inner variable for adjacent filter in abilities WML and TROW "distract" fix

Submitted by:  David Mikos <coffee>
Submitted on:  Sat Feb 23 07:53:57 2013  
Priority: 4Status: None
Privacy: PublicAssigned to: None
Open/Closed: Open

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

Please log in, so followups can be emailed to you.


(Jump to the original submission Jump to the original submission)

Wed Apr 24 03:56:53 2013, comment #10:

Since a fix is already prepared, you didn't really need to create a bug report, unless you're afraid I'll forget. ;)

I brought up bug reports first to check to see if my search skills failed me. If others could also not find a bug report for that, then my secondary motivation was to point out that the bug had not been fixed because of the lack of a bug report. (If I had been aware of this bug at the time, I would have fixed it when I was messing with unit abilities a few months ago.) The original submission for this patch makes it seem like "everyone" knows how distract is allegedly broken, and assuming such things is one way to keep bugs around forever.

In any event, I'll get the fix in next month, I hope. (This weekend is not looking good for me.) As for this patch, I guess the question is whether or not it should be done, and I cannot comment on that as I have not looked closely at bug #18893.

J Tyne <jamit>
Project Member
Mon Apr 22 14:18:23 2013, comment #9:

coffee: Then please work on fixing yourself instead of just demanding that it gets done. Without introducing new problems previously, which would only increase the fixing pressure. I for one had/have no suitable idea to do that. There's at least no easy way.

Anonymissimus <anonymissimus>
Project Member
Mon Apr 22 08:26:21 2013, comment #8:

After a bit of searching I did not find any bug reported, so being the kind person that I am I made one for you --

Still, we need a way to get the variables properly in the abilities WML like for $teleport_unit. However, maybe this needs be fixed along with aforementioned bug

David Mikos <coffee>
Project Member
Sun Apr 21 18:19:41 2013, comment #7:

Ah, I see. And I have it (the unit being adjacent to itself) fixed locally. Since this is apparently a known bug, there naturally should be a bug report filed for it. Is there one (so I can mark it fixed whenever the repository is done host-hopping)?

Also, are you aware of any other mainline content (other than distract) that contains a workaround for this bug?

J Tyne <jamit>
Project Member
Sun Apr 21 01:59:54 2013, comment #6:

As you move a unit it sees itself on the previous hex. This is a bug, for sure. However, we still really need to be able to access the unit in question by a variable in an abilities tag somehow.

David Mikos <coffee>
Project Member
Sun Apr 21 01:14:55 2013, comment #5:

That is rather strange, since as far as I've known, a unit can be in only one location. How can you arrange for a unit to be in two locations, one adjacent to the other?

J Tyne <jamit>
Project Member
Sun Apr 21 01:09:11 2013, comment #4:

Unfortunately it can be adjacent to itself and matches the filter. Hence, the patch. I'd like to use a similar ability in my own era that I have made as well.

David Mikos <coffee>
Project Member
Sun Apr 21 00:52:31 2013, comment #3:

I'm curious about the change to the distract ability. The new filter seems to say "exclude an adjacent unit if that unit is the unit it is adjacent to", but a unit can never be adjacent to itself, can it?

What exactly is broken about the distract ability that needs to be fixed? (Is there a bug report I could look at?)

J Tyne <jamit>
Project Member
Sat Apr 13 23:21:50 2013, comment #2:

I know about the other bug (I submitted it first). Let's fix it! There's no reason that $this.unit, $teleport_unit, or anything else should not work without strange work arounds.

David Mikos <coffee>
Project Member
Fri Apr 12 14:18:43 2013, comment #1:

I'm strongly against adding any more such variables, since they will suffer from the same problem like $teleport_unit, namely premature variable substitution if the ability is added to the unit using an [object]. The problems are described in

Anonymissimus <anonymissimus>
Project Member
Sat Feb 23 07:53:57 2013, original submission:

This is a small patch to add support for inner variables to abilities WML so that they all look like the $teleport_unit variable.



$skirmisher_unit would become $teleport_unit for [teleport], etc.

The patch also includes a fix for the "distract" ability in TROW campaign and allows more control over abilities with adjacent filters.

David Mikos <coffee>
Project Member


(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):

Attached Files


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by jamit (Posted a comment)
  • -unavailable- added by anonymissimus (Posted a comment)
  • -unavailable- added by coffee (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Error: not logged in



    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat Feb 23 07:53:57 2013coffeeAttached File-=>Added abilities_inner_variable_and_distract.patch, #17322
    Show feedback again

    Back to the top

    Powered by Savane 3.1-cleanup