(10-27-2010 12:02 PM)Esenthel Wrote: Also what I want here is to generally simplify the process of creating games, and by that I mean, resource files management, importing resources, sharing it across multiple computers between multiple developers, writing codes, writing visual scripts, deploying, make this more automated, through some tool(s)/editors to make things much easier/faster.
This. Do all of this. It all sounds very good.
(10-27-2010 12:02 PM)Esenthel Wrote: Automatic packaging the game to pak and deleting files which aren't needed is great, but the problem is how to detect which files are used and which aren't. (for example accessing a resource from file name string S+"sound/attack/"+Random(5)+".wav" or through some other method makes things complicated)
Good point. Wasn't sure if this would even be possible, just through something crazy out there. It would be cool if this was somehow possible, but, if not, I'm sure most developers would be capable of removing non-used files on their own.
(10-27-2010 12:02 PM)Esenthel Wrote: Integrating the EE with visual studio, so you can write c++ in editor, and somehow autocompile scripts, to dll's, is nice idea, but it's not portable, I'd like to keep the engine cross-platform.
Didn't think about that. You could look into using a scripting language like Lua for this purpose I believe.
However, the way my so-called "script" editor (more like an event sequence handler like Zervox said) worked was similar to the way you create custom obj types to use in WE, using enums. The functions themselves were written inside of Visual Studio like a regular function, then I used a switch statement to assign the correct function to a function pointer depending on which action was selected (FRY_FUSE, PLAY, UNLOCK in the screenshot above), and finally called them when needed based on which event was selected (ON_SUCCESS, ON_ACTIVATE, ON_TELEPORT).
Overall, this worked okay for me but could definitely be much improved. Perhaps something like this could be done:
Code:
World.setObjEvt(OBJ_DOOR, ON_ACTIVATE, openOrClose);
OBJ_DOOR is one of the types in obj_type.enum, ON_ACTIVATE is one of the events you created in something like obj_evt.enum, and openOrClose is function you've created that either opens or closes the door depending on whether it is already opened or closed.
You would have to somehow define when ON_ACTIVATE is called, so that you might require the need for another function to be created as well or something. So maybe something like:
Code:
World.setObjEvt(OBJ_DOOR, ON_ACTIVATE, onDoorActivate, openOrClose);
onDoorActivate would be a function you've created that tests to see if you are facing the door, within a certain distance, and have pressed the 'E' key. If all is true, then it would automatically called the openOrClose function and the door would open/close.
However, having typed all this I realize that
this idea isn't good enough. It wouldn't provide the ability to assign multiple functions to be called on a single event or the ability to target other objects, which are both necessary. So you can pretty much just scrap most of what I said above. I'll just leave it there in case it sparks some other better ideas for how this could be accomplished.