🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

[AS] Sections and Modules

Started by
2 comments, last by WitchLord 15 years, 11 months ago
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/
Advertisement
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
If you say "pls", because it is shorter than "please", I will say "no", because it is shorter than "yes"
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.

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