enigma-dev/enigma-dev — pull request #777 by sorlok (2014-07-15 22:44:10+00:00)
Title: Timelines internal to objects (fixes object+timeline+script)

As noted here:
https://github.com/enigma-dev/enigma-dev/issues/776
...timelines need to be part of the object_* inheritance chain. This was suggested by Robert originally, but I opted (wrongly) to just do it globally.

This test case demonstrates why timelines need object access:
https://drive.google.com/file/d/0B1P7NepPcOslTU9JU3ZHdXNuODQ

If an object *instance* triggers a timeline which calls (in one of its moments) a script, that timeline must be folded into the object's function declarations; otherwise, the global timeline instance is wrapped with a self{} and it applies to all instances of that object (when it should just apply to one). The sample linked above will create 6 timeline objects that print "1", and then (in the room's instance creation code) give one of those instances a timeline that, in moment 10, changes the printed number to "7". This behavior was confirmed in GM:S, and fixes a related audio bug in Iji (GM5). Without this patch, "7" is shown for all objects.

This adds a lot of generated code for objects, but note that this only applies if you actually use timelines, and furthermore it only adds code for timelines that a given object uses (with a global backup option, similar to scripts).