Encyclopaedia / Bestiary Framework

A place for Ren'Py tutorials and reusable Ren'Py code.
Forum rules
Do not post questions here!

This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
Message
Author
User avatar
Katy133
Miko-Class Veteran
Posts: 575
Joined: Sat Nov 16, 2013 1:21 pm
Completed: The Heart of Tales, [redacted] Life, Must Love Jaws, A Tune at the End of the World, Three Guys That Paint, The Journey of Ignorance, Portal 2.5.
Projects: The Butler Detective
Tumblr: katy-133
Deviantart: Katy133
itch: katy133
Location: Canada
Contact:

Re: Encyclopaedia / Bestiary Framework

#31 Post by Katy133 » Wed Dec 06, 2017 9:25 pm

Thank you so much for this framework!

I'm not sure if you've seen this already, or whether it can help you adjust the framework, but PyTom recently made a post about making a Codex/Wiki screen using Ren'Py's new GUI. The tutorial and coding can be found here.
ImageImage

My Website, which lists my visual novels.
Become a patron on my Patreon!

Human Bolt Diary
Regular
Posts: 79
Joined: Fri Oct 11, 2013 12:46 am
Contact:

Re: Encyclopaedia / Bestiary Framework

#32 Post by Human Bolt Diary » Sun Dec 10, 2017 10:11 am

Katy133 wrote:
Wed Dec 06, 2017 9:25 pm
Thank you so much for this framework!

I'm not sure if you've seen this already, or whether it can help you adjust the framework, but PyTom recently made a post about making a Codex/Wiki screen using Ren'Py's new GUI. The tutorial and coding can be found here.
There's no plans for Wiki-esque links in the 2.0 release, but I can definitely look into it in the future. From that article, I think it's definitely doable.

User avatar
AERenoir
Veteran
Posts: 288
Joined: Fri May 27, 2011 8:23 pm
Contact:

Re: Encyclopaedia / Bestiary Framework

#33 Post by AERenoir » Sun Mar 11, 2018 6:11 pm

Just tried to install this, but I got this error:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/encyclopaedia_screens.rpy", line 313, in script
    style encyclopaedia_scrollbar is scrollbar:
  File "game/encyclopaedia_screens.rpy", line 314, in <module>
    base_bar Frame(Solid(color_dark_orange), gui.scrollbar_borders, tile=gui.scrollbar_tile)
AttributeError: 'StoreModule' object has no attribute 'scrollbar_borders'
What went wrong? My Engine is Renpy 6.99.14

Human Bolt Diary
Regular
Posts: 79
Joined: Fri Oct 11, 2013 12:46 am
Contact:

Re: Encyclopaedia / Bestiary Framework

#34 Post by Human Bolt Diary » Sun Mar 11, 2018 10:44 pm

I can't reproduce this with a fresh project on 6.99.14.1. Have you made any customizations to the default gui.rpy file?
Can you provide a minimum example game where the error occurs?
AERenoir wrote:
Sun Mar 11, 2018 6:11 pm
Just tried to install this, but I got this error:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/encyclopaedia_screens.rpy", line 313, in script
    style encyclopaedia_scrollbar is scrollbar:
  File "game/encyclopaedia_screens.rpy", line 314, in <module>
    base_bar Frame(Solid(color_dark_orange), gui.scrollbar_borders, tile=gui.scrollbar_tile)
AttributeError: 'StoreModule' object has no attribute 'scrollbar_borders'
What went wrong? My Engine is Renpy 6.99.14

User avatar
AERenoir
Veteran
Posts: 288
Joined: Fri May 27, 2011 8:23 pm
Contact:

Re: Encyclopaedia / Bestiary Framework

#35 Post by AERenoir » Mon Mar 12, 2018 5:12 am

Aaah, OK! Silly me. I accidentally typed something into the gui.rpy when I was scrolling through the codes, and saved the file.

ocimpean
Newbie
Posts: 24
Joined: Tue Aug 27, 2013 9:13 pm
Location: Florida
Contact:

Re: Encyclopaedia / Bestiary Framework

#36 Post by ocimpean » Thu Aug 09, 2018 1:06 am

I have the same error like the one above:
File "game/encyclopaedia_screens.rpy", line 313, in script
style encyclopaedia_scrollbar is scrollbar:
File "game/encyclopaedia_screens.rpy", line 314, in <module>

Brand new project, Renpy 6.9.14 & 7.0. just imported the files.

Human Bolt Diary
Regular
Posts: 79
Joined: Fri Oct 11, 2013 12:46 am
Contact:

Re: Encyclopaedia / Bestiary Framework

#37 Post by Human Bolt Diary » Thu Aug 09, 2018 8:51 pm

If you have same error, then I have to ask the same question: Have you made any customizations to the default gui.rpy file?

ocimpean
Newbie
Posts: 24
Joined: Tue Aug 27, 2013 9:13 pm
Location: Florida
Contact:

Re: Encyclopaedia / Bestiary Framework

#38 Post by ocimpean » Fri Aug 10, 2018 9:32 pm

No, I have not made any customization of gui.rpy, I started a brand new project in v.6.99.14 and import files. It gave me errors so I started a new project in v.7.01 and imported the files just to test it and got same errors. Probably is something I am doing wrong, but I can not figure it out.

Human Bolt Diary
Regular
Posts: 79
Joined: Fri Oct 11, 2013 12:46 am
Contact:

Re: Encyclopaedia / Bestiary Framework

#39 Post by Human Bolt Diary » Sat Aug 11, 2018 4:59 pm

ocimpean wrote:
Fri Aug 10, 2018 9:32 pm
No, I have not made any customization of gui.rpy, I started a brand new project in v.6.99.14 and import files. It gave me errors so I started a new project in v.7.01 and imported the files just to test it and got same errors. Probably is something I am doing wrong, but I can not figure it out.
Can you post an example game where this error occurs?

ocimpean
Newbie
Posts: 24
Joined: Tue Aug 27, 2013 9:13 pm
Location: Florida
Contact:

Re: Encyclopaedia / Bestiary Framework

#40 Post by ocimpean » Sat Aug 11, 2018 6:45 pm

Here It is right from the start.
...............................................

I'm sorry, but an uncaught exception occurred.

While running game code:
File "game/encyclopaedia_screens.rpy", line 313, in script
style encyclopaedia_scrollbar is scrollbar:
File "game/encyclopaedia_screens.rpy", line 314, in <module>
base_bar Frame(Solid(color_dark_orange), gui.scrollbar_borders, tile=gui.scrollbar_tile)
AttributeError: 'StoreModule' object has no attribute 'scrollbar_borders'

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

Full traceback:
File "game/encyclopaedia_screens.rpy", line 313, in script
style encyclopaedia_scrollbar is scrollbar:
File "C:\Users\Ovidiu\Downloads\renpy-7.0.0-sdk\renpy\ast.py", line 2410, in execute
self.apply()
File "C:\Users\Ovidiu\Downloads\renpy-7.0.0-sdk\renpy\ast.py", line 2393, in apply
value = renpy.python.py_eval(expr)
File "C:\Users\Ovidiu\Downloads\renpy-7.0.0-sdk\renpy\python.py", line 1943, in py_eval
return py_eval_bytecode(code, globals, locals)
File "C:\Users\Ovidiu\Downloads\renpy-7.0.0-sdk\renpy\python.py", line 1936, in py_eval_bytecode
return eval(bytecode, globals, locals)
File "game/encyclopaedia_screens.rpy", line 314, in <module>
base_bar Frame(Solid(color_dark_orange), gui.scrollbar_borders, tile=gui.scrollbar_tile)
AttributeError: 'StoreModule' object has no attribute 'scrollbar_borders'

Windows-8-6.2.9200
Ren'Py 7.0.0.196
Encyclopedia_test 0.0
Sat Aug 11 07:37:55 2018
.....................................
#Script.rpy

init python:
your_new_encyclopaedia = Encyclopaedia()




python:
your_new_encyclopaedia = Encyclopaedia()



about_zeus = EncEntry(
parent=your_new_encyclopaedia,
name="Zeus",
text=[
"Zeus is the sky and thunder god in ancient Greek religion, who ruled as king of the gods of Mount Olympus."
" His name is cognate with the first element of his Roman equivalent Jupiter."
" His mythologies and powers are similar, though not identical, to those of Indo-European deities such as Indra, Jupiter, Perun, Thor, and Odin."
],
viewed_persistent=True,
)



label start:
"..."
"...test."

Human Bolt Diary
Regular
Posts: 79
Joined: Fri Oct 11, 2013 12:46 am
Contact:

Re: Encyclopaedia / Bestiary Framework

#41 Post by Human Bolt Diary » Sat Aug 11, 2018 8:36 pm

I need an actual example game that crashes, all files and directories. I have no other way to reproduce the exact conditions in your environment that lead to the crash.

ocimpean
Newbie
Posts: 24
Joined: Tue Aug 27, 2013 9:13 pm
Location: Florida
Contact:

Re: Encyclopaedia / Bestiary Framework

#42 Post by ocimpean » Sun Aug 12, 2018 12:16 pm

I archived whole project here as you requested.
Attachments
Encyclopedia_test.zip
Whole project here.
(471.39 KiB) Downloaded 9 times

Human Bolt Diary
Regular
Posts: 79
Joined: Fri Oct 11, 2013 12:46 am
Contact:

Re: Encyclopaedia / Bestiary Framework

#43 Post by Human Bolt Diary » Sun Aug 12, 2018 1:40 pm

gui.rpy isn't present, this is why you're getting that error. gui.rpy is a default file when creating a new Ren'Py project, so most likely you created the project on an old version of Ren'Py before the new gui was introduced, and haven't updated the project to use the new gui.

What happens when you create a new project from the launcher? Is gui.rpy present in the created files?

If you don't want to use the new gui as the base, you'll have to edit the styles to use whatever values you prefer.

ocimpean
Newbie
Posts: 24
Joined: Tue Aug 27, 2013 9:13 pm
Location: Florida
Contact:

Re: Encyclopaedia / Bestiary Framework

#44 Post by ocimpean » Mon Aug 13, 2018 6:49 pm

You are, of course, 100% right. Now that you mention it, I got hit by a flash of recollection, the project was started in 6.9, and it gave errors. So instead of making a new one in 7.0, probably next I just open the old one in 7.
Thank you for helping me figure it out.

User avatar
AERenoir
Veteran
Posts: 288
Joined: Fri May 27, 2011 8:23 pm
Contact:

Re: Encyclopaedia / Bestiary Framework

#45 Post by AERenoir » Tue Sep 11, 2018 5:51 am

After creating entries I tried to make a button to open the Encyplopedia.

I inserted the Encyclopedia button at the start menu. The documentation says it needs two arguments, but I'm not sure what the format is supposed to be.
I wrote it like this, and it's obviously wrong:

Code: Select all

 textbutton _("Encyclopedia") action ShowMenu("encyclopaedia_list",Encyclopaedia)
The sample entry, as copy-pasted from the documentation

Code: Select all

init python:
    your_new_encyclopaedia = Encyclopaedia()




python:
    your_new_encyclopaedia = Encyclopaedia()

        
        
    about_zeus = EncEntry(
    parent=your_new_encyclopaedia,
    name="Zeus",
    text=[
        "Zeus is the sky and thunder god in ancient Greek religion, who ruled as king of the gods of Mount Olympus."
        " His name is cognate with the first element of his Roman equivalent Jupiter."
        " His mythologies and powers are similar, though not identical, to those of Indo-European deities such as Indra, Jupiter, Perun, Thor, and Odin."
    ],
    viewed_persistent=True,
)
       
        

Post Reply

Who is online

Users browsing this forum: notbugme