Page 1 of 1

Screenlang simple expression parser consuming 'insensitive'

Posted: Sun Mar 02, 2014 8:25 pm
by Asceai
This code worked in Ren'Py 6.16:

Code: Select all

imagebutton xpos 1240 ypos 8 insensitive imb_n idle imb_i hover imb_h selected_idle imb_si selected_hover imb_sh action quickbtn[i][1]
It no longer works in Ren'Py 6.17:

Code: Select all

I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.


File "game/nav/navigation.rpy", line 146: Syntax error while parsing python expression.
    8 insensitive
                 ^
    

Ren'Py Version: Ren'Py 6.17.2.319
Expanding it out (but keeping the declaration identical) causes it to work again:

Code: Select all

imagebutton:
  xpos 1240
  ypos 8
  insensitive imb_n
  idle imb_i
  hover imb_h
  selected_idle imb_si
  selected_hover imb_sh
  action quickbtn[i][1]
EDIT: Just in case it wasn't clear from the error, the bug is from ren'py treating '8 insensitive' as a python expression to ypos. It doesn't happen with 'idle', 'hover', 'selected_idle' or 'selected_hover' but 'insensitive' is special for some reason.
i.e. these all work*:

Code: Select all

imagebutton ypos 8 idle Null() action NullAction
imagebutton ypos 8 hover Null() action NullAction
imagebutton ypos 8 selected_idle Null() action NullAction
imagebutton ypos 8 selected_hover Null() action NullAction
but this doesn't:

Code: Select all

imagebutton ypos 8 insensitive Null() action NullAction

*for certain values of 'work'. If the screen is actually displayed there will be an error for the missing idle image in the other examples, but at least they will parse.

Re: Screenlang simple expression parser consuming 'insensiti

Posted: Sun Mar 02, 2014 11:13 pm
by PyTom
This is fixed in Ren'Py master. I'll port it over to the 6.17 branch and make a 6.17.3 release soon.