Write your constants into some module_name_h.fos
#define ONE_THING (0)
#define TWO_THING (1)
#define THREE_THING (2)
// also write your IMPORT here
#ifdef _MODULE_NAME
import void superFuncDoingSuperStuff() from "module_name.fos";
#endif
write your module abstraction into some module_name.fos
#include "module_name_h.fos" // to have our previous declaration available
string@[] meh = {
"one_thing",
"two_thing",
"three_thing"
};
void superFuncDoingSuperStuff()
{
Log("Sorry for my lazyness.\n" + meh[THREE_THING] );
}
Now to use your module just add this to scripts.cfg
@ server module module_name
and to use it through your scripts
into client_main.fos as example
#define _MODULE_NAME
#include "module_name_h.fos" // so the IMPORTS works here
// through some client_main.fos's function
#ifdef _MODULE_NAME // checks the availability
superFuncDoingSuperStuff(); // use if available
#endif
You can also use __CLIENT/__SERVER constants
#ifdef __SERVER
// server side
#endif
#ifdef __CLIENT
// client side
#endif
That's all.