MQO parsing notes

Just some regex I found useful when working with MQO files. I may write a script to do it automatically, but it's probably safer to just do it manually.

TeaTime's Love Death series has objects with "#" symbol followed by numbers, followed by trailing whitespace. SB3U does not allow whitespace in the names, so will have problems using Quick XX with them. Note that these use notepad++, so your pattern or replacement string may be different.

Though in general, any trailing whitespace is undesirable

Pattern ("[^\s]*)\s*"
Replace with: \1"

Subscripts also cause problems with Quick XX because SB3U parses the subscript as the position that the mesh should be inserted, and not a mesh name. Examples: room[0] and room[1] would be meshes for the same mesh called "room", but I treat it as two different meshes. You will still need to keep the subscripts to distinguish between room0 and room 1, so I do

Pattern: \[(\d.*)\]"
Replace with: \1"


When you adjust hex values for each mesh manually, and then realize that you need to replace the meshes again for whatever reason, if you were to replace the meshes without setting a base position, you will lose all your changes. Hence, you should replace the existing mesh in each frame (if you are using Quick XX, they will all be position 0). You will have to modify the MQO to append [0] to every object. This regex does that:

Pattern: (Object ".*\d*)"
Replace with: \1[0]"

No comments:

Post a Comment