Screenlang simple expression parser consuming 'insensitive'

In this forum we discuss the future of Ren'Py, both bug fixes and longer-term development. Pre-releases are announced and discussed here.
Post Reply
Message
Author
Asceai
Eileen-Class Veteran
Posts: 1258
Joined: Fri Sep 21, 2007 7:13 am
Projects: a battle engine
Contact:

Screenlang simple expression parser consuming 'insensitive'

#1 Post 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.

User avatar
PyTom
Ren'Py Creator
Posts: 16088
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Screenlang simple expression parser consuming 'insensiti

#2 Post 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.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Post Reply

Who is online

Users browsing this forum: No registered users