bugBattle for Wesnoth - Bugs: bug #16692, Events with name=turn $var don't...

Show feedback again

You are not allowed to post comments on this tracker with your current authentification level.

bug #16692: Events with name=turn $var don't work

Submitted by:  Anonymissimus <anonymissimus>
Submitted on:  Mon Sep 13 00:20:25 2010  
Votes:  95  
Category: BugSeverity: 3 - Normal
Priority: 5 - NormalItem Group: WML
Status: ConfirmedPrivacy: Public
Assigned to: NoneOpen/Closed: Open
Release: trunk r46431Operating System: win xp

Sat Feb 2 03:08:08 2013, SVN revision 56163:

(Re-)Allow variable substitution in event names.

Fixes the second issue brought up in bug #16692.

(Browse SVN revision 56163)

J Tyne <jamit>
Project Member
Thu Mar 22 01:30:55 2012, comment #4:

Regarding bug #16692, the test code in comment #2 still does not work in Wesnoth 1.10 (despite having quotes).
I suspect there is no variable substitution at all occurring in the event name.

Event names should perform variable substitution at the time that they are checked for a match with the fired event, not before. The contents of the [event] should be substituted at event firing time, unless documented otherwise; that is the default assumption, and the way it worked in previous versions.

Patrick P <sapient>
Project Member
Fri Feb 11 06:36:51 2011, comment #3:

As far as I can tell, the bug you report is completely unrelated to the original one from Anonymissimus, so I'm unassigning the issue from myself. The original bug was about the spacing being lost, which it isn't in your case, as can be seen by looking at the savefile.

Guillaume Melquiond <silene>
Fri Feb 11 04:48:25 2011, comment #2:

How is this "won't fix"? I consider this a valid bug.

The following code worked in 1.6 but no longer works:

{VARIABLE ev_test 2}
name="turn $ev_test"
message=_"turn $|ev_test event has fired"

Note that the suggested workaround also did not work

Patrick P <sapient>
Project Member
Mon Sep 13 04:26:49 2010, comment #1:

Another workaround is to put quotes around "turn $var" so that the engine doesn't consider that the space is meaningless.

Guillaume Melquiond <silene>
Mon Sep 13 00:20:25 2010, original submission:

The nested event's name expands to turn3 instead of turn 3, visible in the savegame and thus doesn't fire. It works if the space in turn $var is replaced by an underscore so that's a workaround.
lua.cpp, luaW_tovconfig, line 392: The config data about the nested event's name looks already suspicious when it comes from the lua interface and it looks like a bug that may have more than this effect.

Anonymissimus <anonymissimus>
Project Member


No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by shadowmaster (Updated the item)
  • -unavailable- added by sapient (Voted in favor of this item)
  • -unavailable- added by sapient (Posted a comment)
  • -unavailable- added by silene (Posted a comment)
  • -unavailable- added by anonymissimus (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 95 encouragements so far.

    Only logged-in users can vote.


    Error: not logged in



    Follow 9 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu Mar 22 01:30:55 2012sapientSummaryEvents with name=turn $var don\'t work unless quoted=>Events with name=turn $var don't work
    Wed Mar 21 22:11:02 2012shadowmasterSummaryname=turn $var - event\'s don\'t work=>Events with name=turn $var don't work unless quoted
    Wed Mar 14 04:21:40 2012sapientCarbon-Copy-=>Added sapient
    Fri Feb 11 06:36:51 2011sileneItem Group None of the others=>WML
      Assigned tosilene=>None
    Fri Feb 11 05:43:08 2011sapientOpen/ClosedClosed=>Open
    Fri Feb 11 04:48:24 2011sapientStatusWont Fix=>Confirmed
    Sun Dec 5 18:28:57 2010sileneStatusNone=>Wont Fix
    Show feedback again

    Back to the top

    Powered by Savane 3.1-cleanup