I have purchased BVM yesterday, and it's totally awesome. I am making some test to implement it into my game engine, so I can code the behaviour of my entities using scripts :)
I have some question about it tho:
I want my engine to do the following: When the engine runtime (the EXE) is executed, it loads all the .bbm modules it finds on its resource paths (by default, the EXE's folder, but you can define more paths), and then executes the main script (the same name as the EXE, but .bbm extension).
I can load a world in that script with the function csWorld_Load("world.b3d"). The world can contain some entities. For example, it would contain an entity named "info_player_start". In that case, one of the scripts loaded at bootup should contain a function called "info_player_start".
On the main loop of the main script, I call the function csFrame(), which wraps UpdateWorld, RenderWorld, Flip, and updates the entities.
To update the entities, i search on all the modules loaded for a function with the name of the entity. If that function is found, then i set that function as the entry point and call it. The problem is that BVM_Run() gives a "Memory Access Violation". Would you please Koriolis show me an example on how to do this? It's basically execute one script, which calls a function from another script and then continues executing.
It's maybe because i have both the main script and the entities scripts in the same contexts?
I have some question about it tho:
I want my engine to do the following: When the engine runtime (the EXE) is executed, it loads all the .bbm modules it finds on its resource paths (by default, the EXE's folder, but you can define more paths), and then executes the main script (the same name as the EXE, but .bbm extension).
I can load a world in that script with the function csWorld_Load("world.b3d"). The world can contain some entities. For example, it would contain an entity named "info_player_start". In that case, one of the scripts loaded at bootup should contain a function called "info_player_start".
On the main loop of the main script, I call the function csFrame(), which wraps UpdateWorld, RenderWorld, Flip, and updates the entities.
To update the entities, i search on all the modules loaded for a function with the name of the entity. If that function is found, then i set that function as the entry point and call it. The problem is that BVM_Run() gives a "Memory Access Violation". Would you please Koriolis show me an example on how to do this? It's basically execute one script, which calls a function from another script and then continues executing.
It's maybe because i have both the main script and the entities scripts in the same contexts?