Jump to content
  • Advertisement
Sign in to follow this  
NicoG

[AS] Sections and Modules

This topic is 3794 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!