Persistent Data Question
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
-
- Regular
- Posts: 58
- Joined: Sun May 31, 2009 8:28 pm
- Projects: Angels
- Contact:
Persistent Data Question
Ok
so how can i get this picture to come up after the main menu
http://i221.photobucket.com/albums/dd29 ... rymenu.jpg
I dont want it like a picture to be part of the actual game itself
I want it to be like you can choose one of those three words on the picture for each different story
How do I make them clickable so that you click whichever story you want to play?
Also how do I set it so that you can only go to the "Memories" portion after you get 3 good endings in the "Wishes" portion
Same for you have to get one good ending in the "Memories" portion to go into the "Angels" portion
so how can i get this picture to come up after the main menu
http://i221.photobucket.com/albums/dd29 ... rymenu.jpg
I dont want it like a picture to be part of the actual game itself
I want it to be like you can choose one of those three words on the picture for each different story
How do I make them clickable so that you click whichever story you want to play?
Also how do I set it so that you can only go to the "Memories" portion after you get 3 good endings in the "Wishes" portion
Same for you have to get one good ending in the "Memories" portion to go into the "Angels" portion
Re: Persistent Data Question
You can try imagemap
http://www.renpy.org/wiki/renpy/doc/ref ... y.imagemap
and persistent data
http://www.renpy.org/wiki/renpy/doc/ref ... stent_Data
And it looks like:
http://www.renpy.org/wiki/renpy/doc/ref ... y.imagemap
and persistent data
http://www.renpy.org/wiki/renpy/doc/ref ... stent_Data
And it looks like:
Code: Select all
label start:
$ result = renpy.imagemap{"your_pictur.png",
"your_pictur_with_all_words_selected.png", [(x1,
y1, x2, y2, "Wishes"), (x1, y1, x2, y2,
"Memories"), (x1, y1, x2, y2, "Angels"), ])
# instead of x and y you should place your coordinates
if result == "Wishes":
jump Wishes
elif result == "Memories":
if persistent.good_endings_in_Wishes < 3: # here we check if player got enough good endings for Wishes
jump start
else:
jump Memories
else:
if persistent.good_endings_in_Memories < 1: # here we check if player got enough good endings for Memories
jump start
else:
jump Angels
label Wishes:
some code
$ persistent.good_endings_in_Wishes +=1 # got one good ending
label Wishes:
some code
$ persistent.good_endings_in_Memories +=1 # got one good ending
label Angels:
some code
-
- Regular
- Posts: 58
- Joined: Sun May 31, 2009 8:28 pm
- Projects: Angels
- Contact:
Re: Persistent Data Question
Ok so this is the code I am currently using
and this error comes up
i've checked the spacing and they are all 4 apart (unless i miscounted somewhere)
what's wrong?
Code: Select all
$ result = renpy.imagemap("story menu.jpg", "story map hover.jpg" [
(256, 54, 358, 92, "Wishes"),
(289, 153, 418, 191, "Memories"),
(315, 233, 418, 269, "Angels")
])
if result == "Wishes":
jump Wishes
elif result == "Memories":
if persistent.good_endings_in_Wishes < 3:
jump start
else:
jump Memories
else:
if persistent.good_endings_in_Memories < 1:
jump start
else:
jump Angels
and this error comes up
Code: Select all
I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.
On line 34 of C:\Documents and Settings\John\Desktop\renpy-6.9.2\Angels/game/script.rpy: one-line python statement does not expect a block. Please check the indentation of the line after this one.
$ result = renpy.imagemap("story menu.jpg", "story map hover.jpg" [
(256, 54, 358, 92, "Wishes"),
(289, 153, 418, 191, "Memories"),
(315, 233, 418, 269, "Angels")
])
Ren'Py Version: Ren'Py 6.9.2a
what's wrong?
-
- Miko-Class Veteran
- Posts: 636
- Joined: Thu May 14, 2009 8:15 pm
- Projects: Castle of Arhannia
- Contact:
Re: Persistent Data Question
Code: Select all
$ result = renpy.imagemap("story menu.jpg", "story map hover.jpg" [
(256, 54, 358, 92, "Wishes"),
(289, 153, 418, 191, "Memories"),
(315, 233, 418, 269, "Angels")
])
if result == "Wishes":
-
- Regular
- Posts: 58
- Joined: Sun May 31, 2009 8:28 pm
- Projects: Angels
- Contact:
Re: Persistent Data Question
that was one problem but i fixed it and another problem
problem
whats an integer?
Code: Select all
$ result = renpy.imagemap("story menu.jpg", "story map hover.jpg" [
(256, 54, 358, 92, "Wishes"),
(289, 153, 418, 191, "Memories"),
(315, 233, 418, 269, "Angels")
])
if result == "Wishes":
jump Wishes
elif result == "Memories":
if persistent.good_endings_in_Wishes < 3:
jump start
else:
jump Memories
else:
if persistent.good_endings_in_Memories < 1:
jump start
else:
jump Angels
Code: Select all
I'm sorry, but an exception occured while executing your Ren'Py
script.
TypeError: string indices must be integers
While running game code:
- script at line 34 of C:\Documents and Settings\John\Desktop\renpy-6.9.2\Angels/game/script.rpy
- python at line 37 of C:\Documents and Settings\John\Desktop\renpy-6.9.2\Angels/game/script.rpy.
-- Full Traceback ------------------------------------------------------------
File "C:\Documents and Settings\John\Desktop\renpy-6.9.2\renpy\bootstrap.py", line 255, in bootstrap
File "C:\Documents and Settings\John\Desktop\renpy-6.9.2\renpy\main.py", line 308, in main
File "C:\Documents and Settings\John\Desktop\renpy-6.9.2\renpy\main.py", line 92, in run
File "C:\Documents and Settings\John\Desktop\renpy-6.9.2\renpy\execution.py", line 230, in run
File "C:\Documents and Settings\John\Desktop\renpy-6.9.2\renpy\ast.py", line 558, in execute
File "C:\Documents and Settings\John\Desktop\renpy-6.9.2\renpy\python.py", line 921, in py_exec_bytecode
File "C:\Documents and Settings\John\Desktop\renpy-6.9.2\Angels/game/script.rpy", line 37, in <module>
TypeError: string indices must be integers
While running game code:
- script at line 34 of C:\Documents and Settings\John\Desktop\renpy-6.9.2\Angels/game/script.rpy
- python at line 37 of C:\Documents and Settings\John\Desktop\renpy-6.9.2\Angels/game/script.rpy.
Ren'Py Version: Ren'Py 6.9.2a
whats an integer?
Re: Persistent Data Question
You missed a comma. Changing the first bit toshould make it work better.
Code: Select all
$ result = renpy.imagemap("story menu.jpg", "story map hover.jpg", [
(256, 54, 358, 92, "Wishes"),
(289, 153, 418, 191, "Memories"),
(315, 233, 418, 269, "Angels")
])
It's a type of number. The error doesn't really have anything to do with numbers, though,... it's just that the computer got confuzzl'd.chikotsukino wrote: whats an integer?
-
- Regular
- Posts: 58
- Joined: Sun May 31, 2009 8:28 pm
- Projects: Angels
- Contact:
Re: Persistent Data Question
oh yay thank you
i always miss commas >_<
thanks for all your help everyone ^-^
i always miss commas >_<
thanks for all your help everyone ^-^
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot]