Well a while ago Josh reluctantly agreed to allow me to add this in to ENIGMA after a lot of persuading and I've only just re-remembered and got round to it.
What I've done is add a map as a 'fallback' for when you reference an instance variable that's not declared in the object struct. This means you can for example now work with this code:
//(in say obj_0):
obj_1.foo = 5; obj_1.buffer = 99; show_message(string(obj_1.foo)); In ENIGMA if you don't use the variable foo anywhere in the object obj_1 then the variable will not have been declared. So in ENIGMA when you try to reference the foo variable for an obj_1 instance, there is no object member variable to access. Before ENIGMA was just assigning to a dummy variable, so that code would have shown 99 (as that was the last variable referenced). But with my change it will now add a map of the value 5 to "foo" local to the obj_1 instance, so you can reference to it properly as you would with any normal variable. Like I said this is like a fallback backup for when people don't declare variables in an object like they should do and it's obviously a lot less efficient so you should still always try to declare your variables properly.
You will find that this will improve the compatibility with Game Maker games quite a lot, I was constantly running into this incompatibility with games I tested. But I've not exactly tested much, so I'm posting here in case anybody can see any problems this winds up causing.
|