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
AERenoir
Veteran
Posts: 320
Joined: Fri May 27, 2011 8:23 pm
Contact:

Re: Encyclopaedia / Bestiary Framework

#61 Post by AERenoir »

Thabks, I will try that.

User avatar
isak grozny
Regular
Posts: 46
Joined: Mon Apr 11, 2016 10:17 am
Projects: The Bitter Drop [Modern Fantasy][Gay Romance][BxB]
itch: grrozny
Location: Edinburgh, UK
Contact:

Re: Encyclopaedia / Bestiary Framework

#62 Post by isak grozny »

Right now, I just have one issue–when I bring up the entry screen via a hyperlink that appears on a say or nvl screen, Return() progresses the story to the next bit. I want it to return to the same dialogue line the entry screen was called from. How do I achieve that?

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

Re: Encyclopaedia / Bestiary Framework

#63 Post by Human Bolt Diary »

Off the top of my head, remove the Return action from the button that closes the encyclopaedia and just hide the screen. If that fails, provide a minimal example for what you're doing and I'll see what I can figure out.

Nyanshua
Newbie
Posts: 4
Joined: Thu Nov 08, 2018 6:14 am
Deviantart: RaquelLoli
Contact:

Re: Encyclopaedia / Bestiary Framework

#64 Post by Nyanshua »

Hi !

Your framework is really great and work like a charm on my project ! However I have some questions, if you do not mind.

- Then we make an entry, and update it after, is it possible to make a tag "update!", like the "new!" one then the player unlock an entry ?
- Is it possible to make a dropdown list with the subject label ? (like the screenshot below)

https://i.goopics.net/PyW8d.png
https://i.goopics.net/4grXP.png

And that's all !

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

Re: Encyclopaedia / Bestiary Framework

#65 Post by Human Bolt Diary »

Nyanshua wrote: Tue Feb 12, 2019 9:02 am Hi !

Your framework is really great and work like a charm on my project ! However I have some questions, if you do not mind.

- Then we make an entry, and update it after, is it possible to make a tag "update!", like the "new!" one then the player unlock an entry ?
- Is it possible to make a dropdown list with the subject label ? (like the screenshot below)

https://i.goopics.net/PyW8d.png
https://i.goopics.net/4grXP.png

And that's all !
If you mean a tag that says "update!" instead of "new!", you can add an attribute to each of your EncEntries and use that to control the GUI.

Code: Select all

foobar = EncEntry(...)
foobar.updated = False

Code: Select all

"Lorem ipsum"
$ foobar.updated = True
and then in the entry_button screen, add:

Code: Select all

if entry.updated:
    text "Update!"
You can sort by subject to get a similar screen to what you want. If you want an actual dropdown, you'll have to code a custom dropdown interface. Once you have that, it's easy enough to populate each dropdown with only entries that match each subject.

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

Re: Encyclopaedia / Bestiary Framework

#66 Post by Human Bolt Diary »

v2.2 of the Encyclopaedia Framework has been released. Download is available at: https://github.com/jsfehler/renpy-encyc ... a/releases

The following changes were made:

- Sort actions now use the get_selected method
- encyclopaedia_list screen no longer sorts by number on exit
- Sorting buttons on encyclopaedia_list screen implicitly inherit their style
- encyclopaedia_button style now has a selected background colour set

User avatar
ameliori
Veteran
Posts: 201
Joined: Sun Apr 06, 2014 9:20 am
Completed: Who is Mike?, Cupid
Projects: The Black Beast [Fairytale]
Organization: FERVENT
Tumblr: ameliori
itch: fervent
Contact:

Re: Encyclopaedia / Bestiary Framework

#67 Post by ameliori »

I'm not sure if anybody has asked this already, but is there a way to make the bestiary conform to a save file? When I use the global encyclopedia, the unlocked entries are already unlocked whenever I start a new game. The only way to lock them again would be to delete the persistent file.

On the other hand, when I use local encyclopedia, restarting the game wipes out the unlocked entries. Even if I save my progress, the unlocked entries disappear when I restart the game. I would like the unlocked entries to stay locked when starting a new game, but be visible using a save file.

Is it possible?
ameliori
TwitterPatreon

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

Re: Encyclopaedia / Bestiary Framework

#68 Post by Human Bolt Diary »

ameliori wrote: Tue Mar 12, 2019 10:37 pm I'm not sure if anybody has asked this already, but is there a way to make the bestiary conform to a save file? When I use the global encyclopedia, the unlocked entries are already unlocked whenever I start a new game. The only way to lock them again would be to delete the persistent file.

On the other hand, when I use local encyclopedia, restarting the game wipes out the unlocked entries. Even if I save my progress, the unlocked entries disappear when I restart the game. I would like the unlocked entries to stay locked when starting a new game, but be visible using a save file.

Is it possible?
I can't reproduce this issue. As long as an encyclopaedia is created after the start label, its state is saved in the save file like any other object. Can you post a minimal example of a script where this issue occurs?

Nyanshua
Newbie
Posts: 4
Joined: Thu Nov 08, 2018 6:14 am
Deviantart: RaquelLoli
Contact:

Re: Encyclopaedia / Bestiary Framework

#69 Post by Nyanshua »

Thank you very much for your reply! It's helped me a lot. : )

User avatar
XxrenxX
Veteran
Posts: 267
Joined: Tue Oct 02, 2012 2:40 am
Projects: Chasing
Deviantart: bara-ettie
Location: Canada
Contact:

Re: Encyclopaedia / Bestiary Framework

#70 Post by XxrenxX »

Code: Select all

Exception: Required parameter enc has no value.
Get error when testing the zip of it as well. Haven't edited anything within the original files.

If possible is there a simpler version of this code? I'm using it because I can't find anything else but I only want one list sorted with the newest unlock (scrollable) at the top and then a simple screen to show selected entry. I have no use for most of this code as I only want a screen similar to the notes function in a cell-phone, just not editable by the player.

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

Re: Encyclopaedia / Bestiary Framework

#71 Post by Human Bolt Diary »

Most likely, you're calling a screen that takes an argument, but have not provided an argument. As per the documentation, calling the screen requires passing an Encyclopaedia object to it.
XxrenxX wrote: Thu May 16, 2019 4:05 pm

Code: Select all

Exception: Required parameter enc has no value.
Get error when testing the zip of it as well. Haven't edited anything within the original files.

If possible is there a simpler version of this code? I'm using it because I can't find anything else but I only want one list sorted with the newest unlock (scrollable) at the top and then a simple screen to show selected entry. I have no use for most of this code as I only want a screen similar to the notes function in a cell-phone, just not editable by the player.

User avatar
XxrenxX
Veteran
Posts: 267
Joined: Tue Oct 02, 2012 2:40 am
Projects: Chasing
Deviantart: bara-ettie
Location: Canada
Contact:

Re: Encyclopaedia / Bestiary Framework

#72 Post by XxrenxX »

Human Bolt Diary wrote: Sat May 18, 2019 12:51 pm Most likely, you're calling a screen that takes an argument, but have not provided an argument. As per the documentation, calling the screen requires passing an Encyclopaedia object to it.
XxrenxX wrote: Thu May 16, 2019 4:05 pm

Code: Select all

Exception: Required parameter enc has no value.
Get error when testing the zip of it as well. Haven't edited anything within the original files.

If possible is there a simpler version of this code? I'm using it because I can't find anything else but I only want one list sorted with the newest unlock (scrollable) at the top and then a simple screen to show selected entry. I have no use for most of this code as I only want a screen similar to the notes function in a cell-phone, just not editable by the player.
That was my first thought and I had assumed I had fixed said issue but I have the issue when testing the original files test version as well as my own so I am unsure if it's just a simple argument not provided issue.

Ayael
Regular
Posts: 82
Joined: Fri Apr 07, 2017 2:17 pm
Projects: Imperial Grace (on going), Autumn Spirit, Ballads at Midnight
Contact:

Re: Encyclopaedia / Bestiary Framework

#73 Post by Ayael »

Hello, for all the people who had trouble with the documentation (which is great but a bit confusing sometime). Here are an example !

- First of all, you need to create a new encyclopedia, and at least 1 entry to it :

Code: Select all

init python:
    your_new_encyclopaedia = Encyclopaedia() #The encyclopedia is name "your_new_encyclopaedia"

    about_zeus = EncEntry( #My entry is named "about_zeus".
        parent=your_new_encyclopaedia, #The "about_zeus" entry, is inside the "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,
    )
Then to go on it your need to create a button to it. I choose to do it global (look the documentation to see the difference), so in my main menu I did :

Code: Select all

textbutton _("Encyclopédie") action ShowMenu("encyclopaedia_list", your_new_encyclopaedia )
Witch mean : I want to show the encyclopedia_list screen (witch is the default screen they created), and open the encyclopedia I created.

I struggle a lot to understand it, I hope it will help ! Please look the documentation to see all the details you can add on this amazing feature !
Last edited by Ayael on Sun Oct 27, 2019 4:45 pm, edited 1 time in total.
Image Image

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

Re: Encyclopaedia / Bestiary Framework

#74 Post by Human Bolt Diary »

I've released version 2.3. The Encyclopaedia now takes the optional argument `tint_locked_image`. If set to False, EncEntries without a specified locked_image will not use a tinted version of the image, instead just using the image.

This is mainly for times when a Displayable is used for the image and no locked_image is provided. Image Manipulators can't handle Displayables, so the tinting attempt would cause a crash. When/If Transforms support color manipulation, I'll switch over to that completely.

Ayael
Regular
Posts: 82
Joined: Fri Apr 07, 2017 2:17 pm
Projects: Imperial Grace (on going), Autumn Spirit, Ballads at Midnight
Contact:

Re: Encyclopaedia / Bestiary Framework

#75 Post by Ayael »

Human Bolt Diary wrote: Sun Sep 29, 2019 9:45 pm I've released version 2.3. The Encyclopaedia now takes the optional argument `tint_locked_image`. If set to False, EncEntries without a specified locked_image will not use a tinted version of the image, instead just using the image.

This is mainly for times when a Displayable is used for the image and no locked_image is provided. Image Manipulators can't handle Displayables, so the tinting attempt would cause a crash. When/If Transforms support color manipulation, I'll switch over to that completely.
Wow, I didn't expect this to be updated anymore ! First of all, Human Bolt Diary, let me thank you a lot for your huge work on this framework, it's amazing ! Truly it goes beyond my dreams !

Second, I was wandering why I don't have the "new!" displaying when I have a new sub_entry unlocking ! I did some modification on the screens so I probably broke something, but I can't find which part of the screen code is handling this >.<

Also, on your documentation, you don't explain how we can declare image we want to use inside the entry, even so there is on the code two screen, one without, and one for the entry with images so I guess it's possible ?
Last edited by Ayael on Sat Nov 02, 2019 7:30 am, edited 1 time in total.
Image Image

Post Reply

Who is online

Users browsing this forum: No registered users