Ill post again.
Heres a little suggestion for standards.
NOTE TO PROGRAMMERS: THESE ARE NOT OFFICIAL STANDARDS JUST A SUGGESTION
layout:
layout should be as follows:
UDTS
CONSTANTS
GENERAL FUNCTIONS
ADDITIONAL FUNCTIONS
INTERNAL FUNCTIONS
Prefixing:
this is very important, you should use the following prefixes:
UDTs: ModuleName_UDTName
Constants: C_MODULENAME_CONSTANTNAME
Functions (general and additional): ModuleName_Functionname
Functions (internal): ModuleName_Intern_Functionname
Function types:
So I dont confuse anyone, these are the 3 function types:
General functions:
Most Modules should use these functions, They are as follows:
ModuleName_Start() - Allocates arrays and initialises module
ModuleName_Update() - Updates the module
ModuleName_End() - Deallocates arrays and zeros variables
ModuleName_Dump() (optional) - Incase of crash, make the module write everything to a dump file to help debugging
ModuleName_GetFunctions() (optional) - Adds all the function names, parameter info and pointers to an array for a scripting engine.
Additional functions: these are just ordinary functions that do stuff which can be called by other modules.
Internal functions: these are functions that will only be executed by the module. Only required if you have a future C++ port planned.
Indenting and Commenting:
I think the best way to code is in blocks. Like this:
Basics:
//Do something
CallFunction()
Setvariable=0
//Do something else
CallAnotherFunction()
Setanothervariable=0
loops:
//Loop
do
//Do something
Callfunction()
loop
repeating the same action multiple times:
//Set variables
//Health
health=100
//Ammo
ammo=10
Sorry its a bit rushed, but from experience i think thats the best way to make modules. if you have any questions then please ask. If you want an example, then please ask.