I want to make Dynamic Scenes with Procedural Dialog.
How I will do it is a While loop in a renpy label, it will have a Turn Order on who gets to act this loop/turn, so you get a natural back and forth, as well as callbacks for character reactions within the loop.
On Player's Turn he gets to act with some actions.
The Dialog Constructor of the string will be in its own python function.
It will probably be a nightmare for the rollback system so that is probably going to be disabled.
The conversation will eventually End either when things are logically resolved or when a certain number of turns are reached, with some possible leeway to forcefully resolved things in the last turns.
Said like this, it looks like an over complicated way to do something simple. Can you provide some algorithm in pseudo-code to give a better idea about what you mean ?
[...] how do I am triply sure that the data I need is saved.
Why do you want Ren'py to not save something ?
For "global" data, as long as you declared them correctly, by using the
default
statement, there's just absolutely no reasons for Ren'py to not save them. As for "local" data, they are saved anyway.
How do I force Renpy to save some data at a specific time?
Like said in the
You must be registered to see the links
page of the documentation, by using
You must be registered to see the links
. But why do you want to do this ?
Either the game is running, and the data don't need to be saved, or the player choose to quit the game, and surely have a reason to not have saved before doing it.
You can still force a save on quit with
You must be registered to see the links
, or
You must be registered to see the links
, but whatever the kind of game, I never saw the interest of such feature in games where you can save at anytime. If the player have to suddenly quit without having the time to save, then it's his fault ; you don't play a game, especially an adult one, at a time where it would mean troubles if you're caught.
If you fear a crash, then you can rely on the auto save feature by changing
You must be registered to see the links
,
You must be registered to see the links
,
You must be registered to see the links
, and
You must be registered to see the links
. But if you really fear a crash, you should correct your code for it to not crash, not try to limit the consequences for the player.
Other then that what other kind of issues I might encounter or things to keep in mind?
What other kind of issues you might encounter ? Well you clearly want to make your game not by using Ren'py, but by going against it, so there's a tons of possible issues that you or your future players will surely encounter.
The most obvious one is that, basically speaking, when you load a saved file, you're just using an external source to perform a massive rollback. Therefore, whatever you fear that could happen during a rollback, could also happen when the player will load a save.
There's a solution behind most of the rollback issues, but to find them you firstly need to read the documentation and make personal tests to understand what you've read.
The only unsolvable issue I encountered is when the rollback stack end being way shorter than it should, this being due to the way Ren'py handle interactions ; in short there's the right number of rollback entries, but one step back use many of them. But as annoying as can be this issue, it's an insignificant one.
In the end, and like I already said in this thread, start by learning Ren'py, and learning it like it really is, not like others use it. You'll see that, most of the time, there's no need to rely on over complicated code design to do what you want to achieve.
A game like
Super Powered is a dynamic sandbox game, and still use really few Python ; and almost only to store the data. It's not a pleasant code to read, nor to works with, and there's many issues, both with the code and with its design, but it achieve to do with Ren'py's language what many tried and failed to achieve with a tons of Python.
Ren'py is not another way to write Python. It's a full engine that come with its own language, amazing possibilities, and that natively offer full dynamism. You should rely on Python only when you can't do it with Ren'py's language, not just when you don't know that Ren'py can do it.
I've looked at the code of most of the games made with Ren'py and available here. Except games made by professional studios, so that are released only in their final version, I never found a game relying massively on Python that haven't been abandoned or have small updates only every now and then.
And there's a reason for this. The devs end overwhelmed by their code, not understanding it anymore and not finding their way through the mess they created. Would they had used Ren'py and not worked against it, that their game would be still alive or updated more often. This just because the code would be clear and the way to pass to the next step easy to see.
Amazing things can be done with Ren'py, like old school 3D (
Sakura Dungeon), RPG Maker-like map (
Planet Stronghole 2), interesting and intuitive combat system (both games), and much more ; and all this could have been done with less Python, but well. But to do it, even in the way they did it, you first need to know and understand Ren'py.