Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(2 edits)

something like this?

# store this file as e.g. loadcorrections.rpy in the game/ directory
# I only user the special label after_load (https://www.renpy.org/doc/html/label.html#special-labels) for the examples
# as this one in nicely encapsulated with a specific trigger condition: it is run once when a saved game is loaded
# add it to the existing after_load in script.rpy:161 with e.g. "call variable_check_examples"
# some of the examples will introduce variables prefixed with gry__, they will pollute the saves you are using to play
# around but should not break anything, even after removing the script from your dev build
# this PoC is based on itch's public version 0.2.3.14
label variable_check_examples:
    # simple example, as minimalistic as possible, to show the usage
    # it uses one of the early variables in the game, try it with loading a game safed before and after 'label s2e1satevtexts' happened
    if hasattr(renpy.store, 'sfpts'):
        "You texted with Saffryn and she gave you [sfpts] stars."
    else:
        "Not even played until the first evening? Or ignored all texts?"
    # more conplex, using again the variable above
    # assumption: later on you need to know which texts from Saffryn the player read 
    # but you cannot decide this directly as the text trigger variable (sftxt) is reused (set to true again in 'label s2e2eve')
    # here you can combine the state of more than one variable to pinpoint the save game progress
    # you added the missing variables to the normal game flow scripts ("default gry__sf_1st_text_read = False", in the fitting label "$ gry__sf_1st_text_read = True")
    # but you need to fix it in existing saves, too
    if not hasattr(renpy.store, 'sftxt'):
        "S2E1/S2E1.rpy:570, do nothing"
    else:
        "at least reached the texting label of the first evening"
        if hasattr(renpy.store, 'sfpts'):
            "the first text from Saffryn was not ignored"
            "setting the correct value for the tracking variable gry__sf_1st_text_read"
            $ gry__sf_1st_text_read = True
    # assumption: you need to know if the player tried to enter the book nine times and the actual script reads now (S2E1/S2E1.rpy starting at 484):
    ##
    #    "Text Gillie":
    #        default gry__little_shit_barely_missed = False
    #        if s2retries == 9:
    #            $ gry__little_shit_barely_missed = True
    #        #Aurum ponders for a minute while sitting on the chair he was just thrown into..again.
    #        scene s2e1read19
    #        stop music fadeout 3.0
    #        "This isn't working... but I have a feeling that I'm not really in any mortal danger with her."
    ##
    if not hasattr(renpy.store, 'gry__little_shit_barely_missed'): # just to be sure that the variable _is_ set
        default gry__little_shit_barely_missed = False
    if s2retries == 9: # this variable is always set, already initialised with 'default s2retries = 2'
        $ gry__little_shit_barely_missed = True
    # and one more, here you had for whatever reason to retcon even more and the player has to decide if something happened
    # again fixed in the fixed release within the game flow but you need to set the correct values in existing saves
    # to nag the player only once and only in unpatched save games you need to add another tracking variable.
    # I used 'label s2e2firstpatrol' as example, in the corrected release you have something like
    ##
    #    s "We trust you can remain professional."
    #    s "You can, can't you?"
    #    # retcon starts
    #    default gry__mc_professional = False
    #    menu:
    #        "Yes":
    #            $ gry__mc_professional = True
    #            $ gry__mc_professional_loadcorrection_tracker = True # note: no default!
    #        "I'll try my best":
    #            $ gry__mc_professional = False # redundant actually, but whatever
    #            $ gry__mc_professional_loadcorrection_tracker = True # note: no default!
    #    # retcon ends, remainder of the original scene
    #    # [..]
    #    $ mainquest = 4
    #    # [..]
    ##
    # now you'll only have to ask the player once in after_load
    if mainquest >= 4 and not hasattr(renpy.store, 'gry__mc_professional_loadcorrection_tracker'):
        "Serafina asked you if you can remain professional around half-naked security members."
        menu:
            "You replied"
            "Yes":
                $ gry__mc_professional = True
                $ gry__mc_professional_loadcorrection_tracker = True
            "I'll try my best":
                $ gry__mc_professional = False
                $ gry__mc_professional_loadcorrection_tracker = True
    return

These are informative, but I probably should have explained myself. 

I have a label called update0 and another called update1. update0 is run as the game starts and update1 is called in after_load.


The first section checks for DLC characters and activates them on the map screen if the file exists in the user's machine.

The second section is supposed to update the maximum amount of scenes each girl has so that the map screen knows when to grey out the icons.

I DID just realize that the _met variables aren't in update1 and I wonder if I shouldn't just package it all into the same update label and just call it again on after_load. but the suggestion was, let's say I added a new character, Lydia, who would then wait to be unlocked. That comes with all new variables. So in the example I was given, using the exact syntax the user gave me, this is what I would have:


However, I also noticed me a lil something:


By deleting the S, "global" turns purple. I have no idea what that means lol, or even if either of these will work. 

Care to hop in my Discord and chat with me there? 

(1 edit)
The second section is supposed to update the maximum amount of scenes each girl has so that the map screen knows when to grey out the icons.

this is not really needed, it would be imo better to set those centrally as constants (the value is unchangeable in a game play and only updated with new releases).


set them all in wca_fix.rpy and remove from update0 and update

    #maxquest
    define aoibheann_maxquest = 0
    define amano_maxquest = 0
    define ambriel_maxquest = 0
    define ashira_maxquest = 0
    define ashley_maxquest = 0
    define mouse_maxquest = 4
    define blossom_maxquest = 2
    define cecilia_maxquest = 0
    define lydia_maxquest = 0
    define druthari_maxquest = 2
    define dwel_maxquest = 0
    define ember_maxquest = 0
    define eshtel_maxquest = 0
    define eyleth_maxquest = 0
    define galka_maxquest = 1
    define gillie_maxquest = 0
    define harai_maxquest = 0
    define harpy_maxquest = 0
    define jade_maxquest = 2
    define kageshini_maxquest = 0
    define kanako_maxquest = 1
    define krin_maxquest = 0
    define lirum_maxquest = 0
    define maika_maxquest = 0
    define mayyah_maxquest = 2
    define clements_maxquest = 0
    define nemlyn_maxquest = 0
    define nichiri_maxquest = 0
    define nook_maxquest = 1
    define phoebe_maxquest = 0
    define river_maxquest = 0
    define rukah_maxquest = 2
    define saarya_maxquest = 0
    define saffryn_maxquest = 0
    define serafina_maxquest = 2
    define senia_maxquest = 0
    define tilai_maxquest = 3
    define venrae_maxquest = 0
    define wither_maxquest = 1
    define yuka_maxquest = 0
    define zira_maxquest = 0
    define fia_maxquest = 0
    define inphyy_maxquest = 0
    define homura_maxquest = 0
    define hilda_maxquest = 0
    define padget_maxquest = 0
    define cerros_maxquest = 0
    define ibti_maxquest = 0
    define petra_maxquest = 1
    define shoo_maxquest = 0
    define mimic_maxquest = 0

I DID just realize that the _met variables aren't in update1 and I wonder if I shouldn't just package it all into the same update label and just call it again on after_load. but the suggestion was, let's say I added a new character, Lydia, who would then wait to be unlocked. That comes with all new variables. So in the example I was given, using the exact syntax the user gave me, this is what I would have

it will not really be possible to introduce DLC chars w/o *any* changes in the base game, for the free time map you *will* need to use at least the _met and _maxquest variables in character_book.rpy


therefore it makes sense to set them always to default values (i.e. "not met") in a global file, for the _met variables again wca_fix.rpy and remove them from update0 and update1 - the only missing ones are

    default lydia_met = 0
    default hilda_met = 0
    default mimic_met = 0

update0 is unused now, all the variable setter are superfluous (already done with sensible "default" and "define" values) and can be deleted

you only have to set the initial _met values in wca_fix to the actually needed one (e.g. barirmouserd_met was set in update0+1 to "1" instead of "0" - so it needs to be changed to "default barirmouserd_met = 1" in the wca_fix file

By deleting the S, "global" turns purple. I have no idea what that means lol, or even if either of these will work.

cannot really give you much insight into this one, globals() is part of python (https://www.programiz.com/python-programming/methods/built-in/globals) and global also a python keyword (the reason why your editor highlights it)

I know though that hasattr() [also pure python] works

replacing

if "lydia_met" not in globals():

with

if not hasattr(renpy.store, 'lydia_met'):

does what you want (or at least how I understood your question)

save game compatibility

you're very very close, only 2 variables are still not handled.

add to wca_fix.rpy, will be correctly set in update1 (loaded game) or start (new game)

    default season1 = False

and as part of label update1

<pre>
    if not hasattr(renpy.store, 'time'): # this can only happen in save games created before the new map was introduced
        $ time = "weekend"
Care to hop in my Discord and chat with me there?

depends, hwo much policing is going on in your community at the moment? some time in season 1 you had a variable issue and wrote about it on itch. I posted a possible approach in your discord and got a few moments later a DM by a, afaik, normal member with the content "delete this NOW, Victor does not want the char name disclosed" (or at least very similar)

That was an overzealous fan, and they were sternly talked to. If a mod needs to delete something, they'll delete something and give you a polite explanation. Normal members are not to take mod duty into their own hands and should be reported for doing so. 

Now, regarding the code... I THINK I see most of what you're going for but I built the DLC system to check to see if a DLC file was present and loadable before adding the character to the map. I fear setting their _met variable to 0 as a default will hamper things later on when I put the unlock code into the main story (for those characters that require it) but I haven't fully written and released a DLC character yet so I have no idea if changing the code will screw things up lol