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

 
 
Show feedback again

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

Submitted by:  Anonymissimus <anonymissimus>
Submitted on:  Mon 13 Sep 2010 12:20:25 AM UTC  
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

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

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

 

Sat 02 Feb 2013 03:08:08 AM UTC, 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 22 Mar 2012 01:30:55 AM UTC, 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 11 Feb 2011 06:36:51 AM UTC, 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 11 Feb 2011 04:48:25 AM UTC, 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:

[event]
name=prestart
{VARIABLE ev_test 2}
[/event]
[event]
name="turn $ev_test"
first_time_only=no
[message]
speaker=narrator
message=_"turn $|ev_test event has fired"
[/message]
[/event]

Note that the suggested workaround also did not work

Patrick P <sapient>
Project Member
Mon 13 Sep 2010 04:26:49 AM UTC, 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 13 Sep 2010 12:20:25 AM UTC, 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

 

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

Attach File(s):
   
   
Comment:
   

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.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 9 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 22 Mar 2012 01:30:55 AM UTCsapientSummaryEvents with name=turn $var don\'t work unless quoted=>Events with name=turn $var don't work
    Wed 21 Mar 2012 10:11:02 PM UTCshadowmasterSummaryname=turn $var - event\'s don\'t work=>Events with name=turn $var don't work unless quoted
    Wed 14 Mar 2012 04:21:40 AM UTCsapientCarbon-Copy-=>Added sapient
    Fri 11 Feb 2011 06:36:51 AM UTCsileneItem Group None of the others=>WML
      Assigned tosilene=>None
    Fri 11 Feb 2011 05:43:08 AM UTCsapientOpen/ClosedClosed=>Open
    Fri 11 Feb 2011 04:48:24 AM UTCsapientStatusWont Fix=>Confirmed
    Sun 05 Dec 2010 06:28:57 PM UTCsileneStatusNone=>Wont Fix
      Open/ClosedOpen=>Closed
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup