I am not sure that I followOnishion wrote:That line of code, in which LC1 and LC2 are both standard LCs with a bunch of condition switches, will run fine, as you intended. It goes through the test routine with flying colors. If, however, I comment out the "LC2" line, and un-comment the other segment, adding condition switches into this final LC, then the resume function (and only the resume function) stops working. So basically the system works fine with a standalone animated image, it works fine if that image is a part of an LC with condition switches, and works fine if the first LC with switches is inside of another LC without switches, but if the first LC is part of another LC with switches, something seems to break. The other functions still work, just not the resume function.
![Sad :(](./images/smilies/icon_sad.gif)
We have a great deal of control here so I imagine that most things can be fixed, I'd appreciate an example just last you provided last time of the setup that fails to resume pause. You can use Solids or Texts instead of your images as Ren'Py should treat them all the same.Onishion wrote:Again, if this can't be easily fixed, I'll figure out some workaround to just not use layered LCs like that, or not use Condition Switches like that in the final LC.
This is easier to answer. As I've said before, this code (while being a little bit different), should work exactly the same as the original ConditionSwitch. I used it's design as it was vastly superior to my "list" idea (in fact it is very easy to implement my list idea using the CS's logic as well as dozens of other setups).Onishion wrote:Ok, after a great deal of trial and error, I've located the problem circumstance, but don't yet have a solution to it. The problem comes up when I am trying to use the surrounding LC with condition switches. Here is a simplified example:
How much would absolutely need to be different between the two, and how much would carry over?Code: Select all
Anyway, as I was playing around with this to troubleshoot it, I'm trying to figure out how best to manipulate it in actual practice. "a" is a variable you added, is it the same variable for all instances of this function, or is it unique to each? Like if I wanted to have two separate "DisplayableSwitcher" animations running at the same time, off of different controlling variables, what would I be changing? Like would this work: [code] image test_case = DisplayableSwitcher(displayable={"MyAniTag": "TestAnimatedImage"}, conditions=( ("VariableIJustCameUpWith == 0", ("MyAniTag", )), ("VariableIJustCameUpWith == 1", ("MyAniTag", "reset")), ("VariableIJustCameUpWith == 2", ("MyAniTag", "pause")), ("VariableIJustCameUpWith == 'yellow'", ("MyAniTag", "show_paused")), ("VariableIJustCameUpWith == 'orange'", ("MyAniTag", "resume")), ("True", ("default", )))) image test_case2 = DisplayableSwitcher(displayable={"MyAniTag": "TestAnimatedImage"}, conditions=( ("VariableIJustCameUpWith == 0", ("MyAniTag", )), ("VariableIJustCameUpWith == 1", ("MyAniTag", "reset")), ("VariableIJustCameUpWith == 2", ("MyAniTag", "pause")), ("VariableIJustCameUpWith == 'yellow'", ("MyAniTag", "show_paused")), ("VariableIJustCameUpWith == 'orange'", ("MyAniTag", "resume")), ("True", ("default", ))))
Ren'Py's "gameflow" works off "interactions". On every interaction, whatever the condition you came up with, will be evaluated and applied. They go from first to last (top to bottom). In your examples they would all "carry over", although that may not be the correct term. Better put: They would both be evaluated to cause the effect bound to them. You could have two displayable do different thing off the same condition as well.
Just like with the CS, you can put any conditions there, like:
"(some_var >= 1324 and player.name == 'Stan', 'apple' in player.inverntory) or screw_it_all_to_hell_its_game_over_anyway" will work as well. I think you can even throw callables in there, although I haven't tried that yet.