[AS] Sections and Modules
Hi there.
Angelscript is fantastic. I really like it. Compared to Lua and Python embedding I had a running sample in notime.
But I have a question :D.
Modules are like DLL or Libs they say - so you have plenty scripts in one module normally.
Sections are not used - they are just for debugging.
So between these 2 statements comes my Problem.
In my ScriptAPI I want every Script to have a "int main()" in it. So I never have to care which functions the Script has, I just call the main and the Script runs. When it does not want to be run anymore, it just returns -1 in the main-method and its removed from my script-stack.
Now this can be achieved by just adding every script to a different module.
Is this true or did I oversee something? How do you manage the EntryPoints of your Scripts?
Sorry for asking, I just never used Scripting Languages seriously before in my own Programs (besides from implementing an easy Language for loading stuff).
Thanks for all the Help!
Nico
If you say "pls", because it is shorter than "please", I will say "no", because it is shorter than "yes"
http://nightlight2d.de/
http://nightlight2d.de/
This is how I've done it. This used to be one of the biggest features that AS lacked; namely, an easy way to share modules without sharing global data. He might have fixed it by now.
Thanks for your reply.
This is indeed a missing feature.
Greets
This is indeed a missing feature.
Greets
If you say "pls", because it is shorter than "please", I will say "no", because it is shorter than "yes"
http://nightlight2d.de/
http://nightlight2d.de/
I still haven't had the time to implement cloning of modules (which will properly share bytecode to avoid extra memory consumption).
Until then you can run multiple instances of the same scripts if you design your script interface to use script classes instead of global functions.
Until then you can run multiple instances of the same scripts if you design your script interface to use script classes instead of global functions.
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement