Nov 12, 2011

My last gripe was over how GM handles creation events, so now I'm stuck rewriting scripts I'd already had written up long ago. However, there is some shiny ray of hope out of all this.

There is a little-known feature in GM where right-clicking on an object in the room while holding down the CTRL key will bring up a menu. One of the options is a Creation Code for that object. This isn't the same as the Create Event, but actually runs before the object's scripts are even processed. In other words, anything entered here will be executed before anything else in the room. So the order of processing goes something like:

    1. Object Creation Code
    2. Object Create event
    3. Object Game Start event
    4. Room Creation Code
    5. Object Room Start event

The last two, 4 and 5, may be in the wrong order since I haven't tested them yet, but 1 through 3 are in the proper order according to the help file.

Anyway, this is all good news for the engine because many of the excess variables I had for such things as Bone Pillar direction and map indices for doors or stairs are no longer necessary. Furthermore, while simplifying some of the preexisting scripts, I think I've figured out how to re-implement my old room transitions which I had deleted due to certain infuriating bugs. So we shall see in the near future how all this pans out.

No comments:

Post a Comment

©TheouAegis Productions™. Powered by Blogger.