Jump to content

  • Log In with Google      Sign In   
  • Create Account

- - - - -

Dynamically load scripts on-demand


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 3DModelerMan   Members   -  Reputation: 1001

Like
0Likes
Like

Posted 11 October 2013 - 07:57 AM

I'm trying to write the scripting system for my engine, and I would like to be able to load scripts on-demand. However, the only way I know of to load scripts is to use the module's AddScriptSection method and then calling the module's Build method after that. Is there any way to just build one script and add it to the module?



Sponsor:

#2 Andreas Jonsson   Moderators   -  Reputation: 3336

Like
1Likes
Like

Posted 11 October 2013 - 12:49 PM

It's not (yet) possible to incrementally add scripts sections to an existing module without recompiling the whole thing.

 

However, instead of adding the scripts to an existing module, why not design your engine to use different modules for different scripts? You can then load and compile the modules on-demand like you want. Individual modules can also be discarded without affecting the other ones.

 

You can study the game sample in the SDK for an idea on how this might work.


AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

#3 3DModelerMan   Members   -  Reputation: 1001

Like
0Likes
Like

Posted 11 October 2013 - 02:31 PM

I might try that out. Will adding a module per script result in significant overhead?



#4 Andreas Jonsson   Moderators   -  Reputation: 3336

Like
1Likes
Like

Posted 11 October 2013 - 03:18 PM

No, you will not have much more overhead than if you compile everything in a single module.


AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS