Page 1 of 1

Problem with choices

Posted: Tue Sep 22, 2020 7:07 am
by RenGames69
Hi, I have a problem with simple choices. I have a 3 choices which after making them should show different pictures, but when I define them and then choose one of them it shows all of the pictures at once. How to separate them? I define them all as False, then I try 1 False, 2 True and 3...? dont know.

Can someone please change my code to get it working, I mean defining, and then menu

here's the code


default pws = True
default gop = True
default rct = True


menu:

"Alright, It's time to choose some nice lingerie"

"Purple with stockings":
$ pws = True
jump continue


"Grey one piece":
jump continue

"Red C Thru":
jump continue


label continue:


if pws:
show pwspicture at right

if gop:
show goppicture at right

if rct:
show rctpicture at right

"And here it shows all of them at once"

Re: Problem with choices

Posted: Tue Sep 22, 2020 8:10 am
by rayminator
would do it this way it better

Code: Select all

default pws = 0
default gop = 0
default rct = 0


menu:

"Alright, It's time to choose some nice lingerie"

"Purple with stockings":
$ pws = 1
jump continue


"Grey one piece":
jump continue

"Red C Thru":
jump continue


label continue:


if pws == 0:
show pwspicture at right

if gop == 0:
show goppicture at right

if rct == 0:
show rctpicture at right

Re: Problem with choices

Posted: Tue Sep 22, 2020 9:26 am
by RenGames69
After i made choice I get this

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/club.rpy", line 554, in script
    if rct == 0:
  File "game/club.rpy", line 554, in <module>
    if rct == 0:
NameError: name 'rct' is not defined

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "game/club.rpy", line 554, in script
    if rct == 0:
  File "C:\Users\awena\Documents\renpy-7.3.5-sdk\renpy\ast.py", line 1832, in execute
    if renpy.python.py_eval(condition):
  File "C:\Users\awena\Documents\renpy-7.3.5-sdk\renpy\python.py", line 2059, in py_eval
    return py_eval_bytecode(code, globals, locals)
  File "C:\Users\awena\Documents\renpy-7.3.5-sdk\renpy\python.py", line 2052, in py_eval_bytecode
    return eval(bytecode, globals, locals)
  File "game/club.rpy", line 554, in <module>
    if rct == 0:
NameError: name 'rct' is not defined

Windows-8-6.2.9200
Ren'Py 7.3.5.606
 0.1
Tue Sep 22 15:24:23 2020

Re: Problem with choices

Posted: Tue Sep 22, 2020 9:50 am
by RenGames69
I don't know why script don't want to define "rct" word

Re: Problem with choices

Posted: Tue Sep 22, 2020 10:03 am
by rayminator
change the zero into 1's my mistake

Code: Select all

if pws == 0:
if gop == 0:
if rct == 0:

Re: Problem with choices

Posted: Tue Sep 22, 2020 11:31 am
by RenGames69
It's really close, but still something missing. The 1st choice is working fine, but when I chose 2 or 3 it's not displaying image. It's 100% something with code, because those images are working everywere else in the script.

Re: Problem with choices

Posted: Tue Sep 22, 2020 11:50 am
by rayminator
it cause you forgot to add these to the other menus

Code: Select all

$ gop = 1

Code: Select all

$ rct = 1

Re: Problem with choices

Posted: Tue Sep 22, 2020 3:19 pm
by RenGames69
It's working! Thank you very much. You're very helpful.