Level Editor loads the level xml wrongly.

#1
I supposed that the order of attributes of an element in an xml file doesn't matter. So, "<Rotation x="-7.536443E-15" y="0.7071068" z="-2.304046E-07" w="0.7071068" />" and "<Rotation w="0.7071068" x="-7.536443E-15" y="0.7071068" z="-2.304046E-07" />" should have the same meaning.
However, in the Level Editor, order of attributes will affect the level loading.
I made a simple map, which contains only one object:
QQ截图20181225004611.png

The blv file is as follows:
<Level>
<LevelSettings EditorVersion="0.8" UseVoting="False" CurtainMode="False" AllowExcessPlayers="True" HidePlayerLabels="False" AllowCopyMachine="True" allowModMachines="True" Environment="Barren">
<DisableFire Enabled="False" Locked="False" />
<DisableExplosions Enabled="False" Locked="False" />
<DisableProjectiles Enabled="False" Locked="False" />
<ZeroG Enabled="False" Locked="False" />
<InfiniteAmmo Enabled="False" Locked="False" />
<Invincibility Enabled="False" Locked="False" />
<ExplosiveCannonballs Enabled="False" Locked="False" />
<DisableBounds Enabled="False" Locked="False" />
</LevelSettings>
<CustomData>
<StringArray key="requiredMods" />
</CustomData>
<Objects>
<Object ID="7005946375957456989" Prefab="9028">
<Position x="-0.992" y="0.992" z="-7.996" />
<Rotation x="-7.536443E-15" y="0.7071068" z="-2.304046E-07" w="0.7071068" />
<Scale x="4" y="4" z="4" />
<Data>
<Boolean key="bmt-lel-enable-physics">False</Boolean>
</Data>
</Object>
</Objects>
</Level>

And then, just by changing one line, from "<Rotation x="-7.536443E-15" y="0.7071068" z="-2.304046E-07" w="0.7071068" />" to "<Rotation w="0.7071068" x="-7.536443E-15" y="0.7071068" z="-2.304046E-07" />", the loaded map changed:
QQ截图20181225004630.png

I wish it to be fixed.
 

ITR

l̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ֍̫̜̥̭͖̱̟̟͉͙̜̰ͅl̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ
Staff member
#2
checked the decompiled code, seems like it currently just parses the elements LTR, so the leftmost one is x, the second is y, the third z, the fourth w

Is there any specific reason you need them to be proper tag-based?
 
#3
I am using python to help me make some level creations, And it's when I saw the output level messed up I found this bug. Fortunately, the python's xml.etree.Element will output attributes in alphabet order. So I can temporarily change "w" to "zw" to make it in the fourth place.
But there are also other people who are making some external map tools, like the pixel art tool, maybe deformation generation tool in the future. And they probably all assume that attributes are proper tag-based. Maybe the language they use, C++, Java or so, doesn't output attributes in alphabet order. If so, they will be faced with a big problem.
Also, some modders may also add new kind of elements or tag to levels. Correct parser will make this game more expansible.
 
Top