Open saluk opened 2 months ago
Another example would be if we want to add quotes around arguments to get rid of the weird spacing rules that sometimes apply and sometimes don't.
setvar text "This is some text"
We would have to: accept text that isn't quoted, you just can't have spaces in it (bash style)
joinvar line1 Bob says to me "Wow, this is quite a trip $myname !"
Would convert to this:
joinvar line1 Bob says to me '"Wow,' this is quite a trip $myname '!"'
(Obviously, were the author to want to write this in the updated version with quoting, they could write it a little better:)
joinvar line1 'Bob says to me "Wow, this is quite a trip ' $myname '!"'
Another example: {p} inside of text is affected by the {spd} value. It's a little unintuitive, a pause should have a consistent length. A complicated fix would be to alter the math on import:
"{spd0.5}Some text{p60}Some more text"
... could convert to
"{spd0.5}Some text{p120}Some more text"
This has 2 downsides. One, is that we have to parse the text character by character to determine the speed at the time. Two, it's ambiguous when looking at it that the text has been modified. Not all of the examples in this issue are clear in this way, however this is the most hidden.
We could introduce a backwards compatible pause function or an argument to the pause function, replacing all previous usages with the backwards compatible version. Something like:
{spd0.5}Some text{spdpause 60}Some more text"
Also worth pointing out the "conversion" doesn't necessarily have to happen in a way that's nice for humans to read, or even well documented.
Where commands rely on different default behavior, we can make them more consistent. To support old scripts, they can be updated by replacing the commands with versions that use the new logic but with explicit behavior instead of default values. For example:
fade name=blah vs delete name=blah
In PyWright, delete will delete the topmost object with the name, while fade will delete all of the objects with the name. This is confusing and leads to bugs. It's also very hard in PyWright to know if you have deleted all of the objects with the given name, because you would have to call delete each time (there is no way to delete all of them).
GodotWright could add the arguments name_top and name_all to distinguish these behaviors.
A conversion tool, or when loading code known to be from a pywright game (and not designed in godotwright), could modify existing calls like this:
would become: