[Feature Request] Improve the built-in XML to Lua converter #251
MrThatKid
started this conversation in
03 - Feature Requests
Replies: 2 comments
-
it could scan the code for |
Beta Was this translation helpful? Give feedback.
0 replies
-
So, I found that oITG allows |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is your feature request related to a problem? Please describe.
So, the XML to lua converter already does quite a bit of work when I'm doing modfile ports, but often I run into several annoyances when dealing with the resulting output. For example, cmd is considered deprecated (It's used when dealing with commands that only do tweens, not lua functions), and I've been spending a lot of time removing it from previous things, replacing it with lua functions. Other annoyances involve replacing the optional_actor function it creates with lua ternary, potentially dealing with how it incorrectly converted a position, or dealing with the fact that XML layers are sorted by alphabetical first, and then top-to-bottom if the layers are named the same, and the converter doesn't know this.
Describe the solution you'd like
So, something I'd like is to have the XML to Lua converter fixed up to address these annoyances.
For cmd, it would have to generate a lua function that calls the actor functions correctly.
For optional_actor (Which replaces the "Condition" attribute in XML), it would turn that into
condition and actual_actor or Def.Actor{}
.For positions, it could do the offsetting it usually does (Which only happens if it finds anything that's not a lua variable or SCREEN variable) but instead of doing
SCREEN_CENTER_X + (combination of -320 and the first number it sees)
, it could doSCREEN_CENTER_X - 320 + (entirety of what was passed in to position)
.For the layer ordering, maybe it could be possible to sort the layers internally, then write them back so it's output in the "correct" order?
Obviously, I haven't thought of everything that could be done to make the converter better, so if anyone comes up with ideas, put it down here.
Beta Was this translation helpful? Give feedback.
All reactions