I propose a formatting standard for variables as well. Basically, naming conventions that make it easier to know what variables are.
Precede constant names with a 'c'
Precede global names with a 'g'
Constants and globals would have their type attached followed by an underscore before their actual name.
Example: const int ci_DummyInteger
Local variables have no precedence for convenience purposes.
Local variables should only be at most 1-3 alphabets long, to help distinct them from constants or globals.
Use pascal-case for naming conventions. (Or was it camel case? I can't remember. The one where first letter is always upper case)
Depending on the type of variable, always name with the following. (Trying to be minimalist)
int i
fixed f
string s
text txt
unit u
playergroup g
sound snd
trigger t
unitgroup ug
Multiple instances of the same type would of course be catered for either by using arrays or having i i2 etc. I personally find i,i2,...,in easier to track than using an array though.
Theres more but i can't remember them all. These of course would be combined with 'c' or 'g' if they are constants or globals.
Struct names should always suffixed with 'Info'
For example struct PlayerInfo
When declaring the size of the struct, always precede 's_' before the struct name for easier recognition at a later time.
PlayerInfo[ci_PlayerCount] s_pi;
When designing functions. Have the parameters follow the convention where possible. Alternatively add a comment above the function denoting what each of the types actually represent. For example, 'i' might be the player number.
I propose a formatting standard for variables as well. Basically, naming conventions that make it easier to know what variables are.
Depending on the type of variable, always name with the following. (Trying to be minimalist)
Multiple instances of the same type would of course be catered for either by using arrays or having i i2 etc. I personally find i,i2,...,in easier to track than using an array though.
Theres more but i can't remember them all. These of course would be combined with 'c' or 'g' if they are constants or globals.
When designing functions. Have the parameters follow the convention where possible. Alternatively add a comment above the function denoting what each of the types actually represent. For example, 'i' might be the player number.