Jump to content
  • Advertisement
Sign in to follow this  
bilgekaan

angelcode script

This topic is 5456 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

Advertisement
There is no special function for it but you can do it by writing a script section declaring the global constants.

Example:


// Add a script section with the constants that the script should know about
const char constants =
"const int c_int = 1;"
"const int c_int2 = 2;";
engine->AddScriptSection(ModuleName, "constants", constants, strlen(constants));

// Add the normal script in another section
engine->AddScriptSection(ModuleName, "script", script, strlen(script));

// Build the script
engine->Build(ModuleName);





I may add a way to register enums and constants directly using methods, but I'm not so sure it will be easier than the solution above.

Regards,
Andreas

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!