Request for script builder add-on

Started by
3 comments, last by Solokiller 8 years, 2 months ago

Would it be possible to change CScriptBuilder::LoadScriptSection so that the fopen call is handled by a virtual function? Our game engine uses a file system where a file can be located in one of several paths, so one path could end up pointing at another one. Being able to override this code would make it much easier to handle this case.

Advertisement

Sure. I'll consider it for a future release.

Feel free to customize the add-ons. :) They are just provided to give a starting point to the application developers, but they are not required to be used as-is, or even at all.

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

I know :) I'm trying to minimize the amount of changes made to the add-ons so they'll always be up-to-date without having to change things too much. I figure it would also help others.

Come to think of it. Overloading just the fopen call is probably not so useful.

The CScriptBuilder already allows you to override how files are found by setting the IncludeCallback. You can use this to determine the correct file name, or even load a section from memory in case you're using some kind of virtual file system.

I'm thinking that instead of overloading the fopen call, I'll add a new method AddSection(const char *sectionName). By default, this method will simply call the AddSectionFromFile, but if the IncludeCallback is set it will invoke that to allow custom lookup of the file.

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

That sounds like a good idea.

This topic is closed to new replies.

Advertisement