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

Modules

Started by
0 comments, last by WitchLord 17 years, 6 months ago
Is it possible to call functions in other modules? I'm trying to setup a system where I have a "menu"-module, a "game"-module and a "init"-module, and the script should be able to move from one executing module to another, like menu -> game. They are basically game states. How can I do this? Any good solutions? Any better ideas of a system? Thanks in advance for any input. And thanks for a great script library!
Advertisement
Yes, you can call functions from other modules. To do that you need to import the function you want to call. The application must also be implemented to do the proper binding of the imported functions after building the modules.

The script will have something like this:

import void ImportedFunction(int param) from "module2";void Function(){  ImportedFunction(42);}


And the application will have something like this:

engine->Build("module1");engine->Build("module2");engine->BindAllImportedFunctions("module1");engine->BindAllImportedFunctions("module2");

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