Re: [Ohrrpgce] [ohrrpgce/ohrrpgce] Text box Instead run script conditionals don't properly skip the text box (Issue #1252)
One unrelated thing I noticed is that before conversion to text slices, the first line (or two?) of a textbox appears at the same time as the box, while afterwards it seems to appear one tick later. I don't know which is preferable. The modern is probably better for people trying to modify the box fade-in with a script.(I suspect original versions Sword of Jade depend on the old behavior in its intro where it stacks text on top of the textbox. -- Reply to this email directly or view it on GitHub: https://github.com/ohrrpgce/ohrrpgce/issues/1252#issuecomment-1504455075 You are receiving this because you are subscribed to this thread. Message ID: ___ Ohrrpgce mailing list ohrrpgce@lists.motherhamster.org http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
Re: [Ohrrpgce] [ohrrpgce/ohrrpgce] Text box Instead run script conditionals don't properly skip the text box (Issue #1252)
Well this is already an incompatibility between different versions. We should fix this (I want to add an actual "Trigger script" conditional) but not without a backcompat bit, it would probably break a huge number of games because it's easy to stumble upon, and before ypsiliform "Instead: run script" acted much like a "Trigger script" conditional so probably people thought it was a feature not a bug. We don't need to emulate every aspect of it (such as the incorrect value returned by `current textbox`). Really we should also have a second backcompat bit emulate the old pre-ypsiliform behaviour. (Probably werewaffle rather than xocolatl.) I created a test game using werewaffle+ ([tbtest.zip](https://github.com/ohrrpgce/ohrrpgce/files/11206401/tbtest.zip)). It's set up to open TB 1 from the NPC. r2206 didn't change the behaviour the way I expected, but it did change something. In werewaffle+ (2008, before modernisation of the textbox code, including r2206): -- If TB 1 is triggered from an NPC, TB 1 shows as normal, then TB 2 *also* shows and `insteadscript` runs, and when TB 2 is advanced, conditionals such as "gain $" are evaluated and After TB 3/`afterscript` run! However, conditionals meant to happen when TB 2 is displayed, such as setting tags, aren't run, and its choicebox and appearance settings (e.g. box position and backdrop) are ignored, it uses TB 1's appearance. This is because in werewaffle, text and conditionals were loaded before 'Instead' was checked, then it loaded appearance (into `sayenh()`), updated choicebox, set tags, etc. If `insteadscript` runs `advance text box`, the result is the same as today except that TB 2 shows for one tick (because the script is only run the next tick), using TB 1's appearance settings. If TB 2 is triggered directly from an NPC, the behaviour seems the same as today, including when `advance text box` is called. In xocolatl+2 (2009), after r2206: -- Everything seems to be the same as werewaffle, except now TB 2 appears with its proper appearance settings and with its choicebox. In ypsiliform+3 (2010), which converted text boxes to slices: -- Everything seems the same as today, with TB 2 no longer showing when it has an Instead script condition. -- Reply to this email directly or view it on GitHub: https://github.com/ohrrpgce/ohrrpgce/issues/1252#issuecomment-1504436957 You are receiving this because you are subscribed to this thread. Message ID: ___ Ohrrpgce mailing list ohrrpgce@lists.motherhamster.org http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
Re: [Ohrrpgce] [ohrrpgce/ohrrpgce] Text box Instead run script conditionals don't properly skip the text box (Issue #1252)
I can confirm that the intention was always for instead scripts to completely skip the text box. The behavior was supposed to be the same as an instead text box. If a text box has an "instead" box or script that is always run, then one of the other settings are supposed to matter. Does this bug seem like something that might break any existing games of we fix it? Do we have any known cases of game authors relying on the buggy behavior? 😞 -- Reply to this email directly or view it on GitHub: https://github.com/ohrrpgce/ohrrpgce/issues/1252#issuecomment-1504351422 You are receiving this because you are subscribed to this thread. Message ID: ___ Ohrrpgce mailing list ohrrpgce@lists.motherhamster.org http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
[Ohrrpgce] [ohrrpgce/ohrrpgce] Text box Instead run script conditionals don't properly skip the text box (Issue #1252)
The problem is that in `loadsay`, if an Instead condition runs a script instead of the box, then the rest of `loadsay` is skipped, so the box isn't displayed, `txt.id` isn't set to the new ID, and `txt.showing` isn't set. But all the textbox data is actually loaded into `txt`, and `txt.id` and `txt.showing` keep their previous values, meaning the previous textbox if any doesn't actually close! And `advance_text_box` doesn't quit if there's no text box actually showing. If you trigger a textbox from an NPC Consider: Text box 1: After: ALWAYS show Text box 2 Text box 2: Instead: ALWAYS run script `insteadscript` After: ALWAYS run script 'afterscript' or show Text box 3 If TB 2 is triggered directly from an NPC, then just `insteadscript` runs, and the box doesn't display as expected. But if `insteadscript` runs `advance text box` then all the conditionals that happen when advance run, including running `afterscript` or shows TB 3! (A menu set to "Advance text box when menu closes" will apparently have the same effect, since that also calls `advance_text_box` unconditionally.) If TB 1 is triggered from an NPC, TB 1 shows as normal, and when advanced `insteadscript` runs immediately, but TB 1 remains displayed! Pressing F1 at this point shows that the current `txt.id` is still 1, but all the data is from TB 2. Pressing Enter a second time then runs `afterscript` or shows TB 3. If `insteadscript` runs `advance text box` then that just skips needing to press Enter twice. If it runs `show text box` then that overwrite the phantom textbox data and everything is normal. * But wait! Are Instead scripts actually meant to skip the text box? r2206 (5ab153601) in 2008, xocolatl, introduced `txt.id`, and it looks like it changed the behaviour, because before then the equivalent of `txt.id` *was* still set even if the textbox was skipped by an Instead script. Currently testing... -- Reply to this email directly or view it on GitHub: https://github.com/ohrrpgce/ohrrpgce/issues/1252 You are receiving this because you are subscribed to this thread. Message ID: ___ Ohrrpgce mailing list ohrrpgce@lists.motherhamster.org http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org