🎉 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!
Build() and AddScriptSection()
In the tutorial the function AddScriptSection() and Build() are wrapped together in one sample function. Is this always ok (i.e. I add code from 4 files and thus call Build() 4 times), or should I generally add all my scripts and then call Build as a final step?
What scripting language is this? Are you using C, C++, C# etc...? Could you provide a little more information please?
But generally, I guess it depends on how the script system works. If it needs a build after each script section is added, then yes, keep them together, else just call build at the end of the script generation.
But generally, I guess it depends on how the script system works. If it needs a build after each script section is added, then yes, keep them together, else just call build at the end of the script generation.
Well, I use AngelScript on top of C++.
I guess the question boils down to wether Build() will compile everything ever added with AddScriptSection(), or only the stuff added after the last call to Build().
(I suspect the later, but I was not entirely sure after taking a look in the documention)
EDIT:
After playing around a bit, I figured out this:
If you want to have several scripts, the only right way to do this is by
calling AddScriptSection() a number of times and then Build() once.
Correct?
[Edited by - B_old on March 22, 2006 8:33:35 AM]
I guess the question boils down to wether Build() will compile everything ever added with AddScriptSection(), or only the stuff added after the last call to Build().
(I suspect the later, but I was not entirely sure after taking a look in the documention)
EDIT:
After playing around a bit, I figured out this:
If you want to have several scripts, the only right way to do this is by
calling AddScriptSection() a number of times and then Build() once.
Correct?
[Edited by - B_old on March 22, 2006 8:33:35 AM]
Correct. The Build() call compiles everything added to that module since the last Build() call (or since the creation of the engine).
When the Build() completes AngelScript will forget all the script codes that were built, i.e. free the memory if AngelScript made a copy, or simply clear the pointer if no copy was made.
When the Build() completes AngelScript will forget all the script codes that were built, i.e. free the memory if AngelScript made a copy, or simply clear the pointer if no copy was made.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement