- Jul 18, 2018
- 90
- 149
The basic idea is that the player is playing the same game for larger stakes every time. I've got most of it working perfectly: before each iteration, a different variable in the main script is set to "true" that affects the difficulty and stakes present in the game script via a series of 'if' statements in the game script.
The tricky part is that when the player hits the "exit" button inside the game, I want that button to send them to a different label in the main script depending on which variable is set to "true". In this case, the current variables I'm using are market0 and market1. Below is the "Play Again?" screen inside the game. You can see my initial attempt to modify the "Quit" action button with a pair of "if" statements that affect the Jump function, but Ren'Py doesn't like it one bit. The error it throws is "expected a keyword argument or end of line".
Any ideas, oh wise F95 gurus?
P.S. As a last resort, I'm willing to kludge by creating a new mini game script for every instance the game is used, but that strikes me as extremely inelegant.
EDIT: I figured it out. The 'if' statement needs to create a whole new image button, like so:
The tricky part is that when the player hits the "exit" button inside the game, I want that button to send them to a different label in the main script depending on which variable is set to "true". In this case, the current variables I'm using are market0 and market1. Below is the "Play Again?" screen inside the game. You can see my initial attempt to modify the "Quit" action button with a pair of "if" statements that affect the Jump function, but Ren'Py doesn't like it one bit. The error it throws is "expected a keyword argument or end of line".
Any ideas, oh wise F95 gurus?
P.S. As a last resort, I'm willing to kludge by creating a new mini game script for every instance the game is used, but that strikes me as extremely inelegant.
Code:
screen market_again_screen:
modal True
key "hide_windows" action NullAction()
$ renpy.block_rollback()
imagebutton:
xpos 0
ypos 0
focus_mask True
idle Transform("images/Market/PlayAgainNormal.png")
hover Transform("images/Market/PlayAgainHover.png")
action [Hide("displayTextScreen"), Hide("market_again_screen"),Hide("market_scr"),Hide("screen_market_losemoney"),Hide("screen_market_wonmoney"), Jump("market_label"),]
unhovered Hide("displayTextScreen")
imagebutton:
xpos 0
ypos 0
focus_mask True
idle Transform("images/Market/PlayExitNormal.png")
hover Transform("images/Market/PlayExitHover.png")
action:
if market0 == True
[Hide("displayTextScreen"), Hide("market_again_screen"),Hide("market_scr"),Hide("screen_market_losemoney"),Hide("screen_market_wonmoney"), Jump("finishup"),]
if market1 == True
[Hide("displayTextScreen"), Hide("market_again_screen"),Hide("market_scr"),Hide("screen_market_losemoney"),Hide("screen_market_wonmoney"), Jump("whoa"),]
unhovered Hide("displayTextScreen")
Code:
screen market_again_screen:
modal True
key "hide_windows" action NullAction()
$ renpy.block_rollback()
imagebutton:
xpos 0
ypos 0
focus_mask True
idle Transform("images/Market/PlayAgainNormal.png")
hover Transform("images/Market/PlayAgainHover.png")
action [Hide("displayTextScreen"), Hide("market_again_screen"),Hide("market_scr"),Hide("screen_market_losemoney"),Hide("screen_market_wonmoney"), Jump("market_label"),]
unhovered Hide("displayTextScreen")
if market_0 == True:
imagebutton:
xpos 0
ypos 0
focus_mask True
idle Transform("images/Market/PlayExitNormal.png")
hover Transform("images/Market/PlayExitHover.png")
action [Hide("displayTextScreen"), Hide("market_again_screen"),Hide("market_scr"),Hide("screen_market_losemoney"),Hide("screen_market_wonmoney"), Jump("finishup"),]
unhovered Hide("displayTextScreen")
if market_1 == True:
imagebutton:
xpos 0
ypos 0
focus_mask True
idle Transform("images/Market/PlayExitNormal.png")
hover Transform("images/Market/PlayExitHover.png")
action [Hide("displayTextScreen"), Hide("market_again_screen"),Hide("market_scr"),Hide("screen_market_losemoney"),Hide("screen_market_wonmoney"), Jump("whoa"),]
unhovered Hide("displayTextScreen")
Last edited: