🎉 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!

Shared script Discard + ReBuild fails to pick up script-syntaxerror

Started by
1 comment, last by WitchLord 6 years, 1 month ago

So I have two scripts that are loaded into two different modules. Module A and Module B.

Each module defines a single shared script-class. Now when i start the application, create each module and build them everything is a success, but if i change the script-code with random letters to cause an error and then force a rebuild of the script (so i know it should fail as I myself inserted a compile-syntax error). I check the string buffer of the contents and its all there but when module->Build() it returns 0 aka a success. This only happens when i shared defined in all my classes for script-classes.

Any ideas anyone?

 

More Info: If the script class has a function called

void Stop()

{

}

 

if I remove one of the curly brance to force a recompile, then it works with shared class instantiantion.

But if I force something like this

void Stop()

{

adadadkf[kgfaflaff;

}

 

Where that "adadadkf[kgfaflaff;" is clearly a syntax error then the build() call wont yell at me for some reason. 

Note: If i relaunch the application for the first time the script is called and that garabage is defined then it will yell at me

but once the script is compiled, it stopped picking up syntax-error inside functions.

 

Do i need to rebuild as scripts that are shared or something?

Any ideas?

Advertisement

shared entities (functions, classes, etc) are not re-compiled if they already exist in a previously compiled module. That is why the syntax error you introduced to test this isn't identified.

To recompile the shared entities, you need to make sure you've discarded all the modules which declared the entities, and also freed any objects that may be referring to the code. Only after that the shared entities are released and removed from the engine.

 

You may also want to pick up the latest revision of AngelScript from the SVN as I recently fixed a bug that kept the shared entities around in the engine longer than needed.

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