It's actually pretty neat as I managed to pretty much emulate my internal API using scripted functions; so to load a texture it's as simple as calling: tex_load_texture( [filename] ); and you get back a TextureId. This can then be fed into sprite creation - spr_create( [textureId], [width], [height] ); and finally the sprites can be assigned to entities - ent = ent_create( [ent_type_id], [sprite_id], [position] );.
So what I've got now is a program that launches, loads up a script and jumps straight into the scripted 'main' function as a thread. This scripted function then calls the various load textures and sprite setup functions and finally creates some entities based on the sprites. It's all working very nicely and things are displaying as they should. I can even reposition them and change their sprites all from script - not bad, eh?
What I need to do now is to add the 'think' functions to the entities; where previously they were C function pointers they now have to be GMScript functions. I'll keep the current setup but add in a 'script think' method that calls a user specified scripted function - this lets me export specific 'set' think actions from C (fly straight, etc) instead of having to script such basic motions. Another task is to figure out how to allow for entity specific data - I'm thinking of setting up a 'properties' method on the scripted object that lets me assign anything to it - this pretty much allows me to use entities as I was before :)
So where's all this going? Well for one I have a very quick system for throwing out 2d sprite-based games. It's a prototype right now and I'm still going to need to wire up all the collision stuff, perhaps using a similar system to the one I used before. Entity types are currently user-specified by a single int, but I'm contemplating making it so they need to be registered with the engine, meaning you can refer to them by name - this would allow me to then start firing out the class-based event handling I did before.
I've got a big idea based on this prototype; it's tied in with the idea from my previous entry - but I'm not going to talk about it until I've done a little more on the prototype. Suffice to say, Hydra is going to be scripted :)