There is a little trick one can find in a sample of the SDK in regards to parameter indices inside BBs. Ever had the case where you were writing a BB and suddenly you wanted to insert i.e a InputParameter? If your code is more complex you maybe just add it at the end to prevent changing all the Input-Parameter queries.
If you use ENUMs instead, you can easily reorder and insert new paramters. For example
// Input Params
enum
{
PARAM_CHARACTER = 0,
PARAM_SKIN,
PARAM_ANIM,
PARAM_AMBIENT,
PARAM_FACE,
PARAM_CLOTHES,
PARAM_HAIR,
PARAM_BRAIN,
PARAM_STATE
};// Settings/Local Params
enum
{
PARAM_CONSIDER_AMBIENT = 0,
PARAM_CONSIDER_PLAYER
};[….]
// example usage
CKCharacter* charc = (CKCharacter*) beh->GetInputParameterObject(PARAM_CHARACTER);
(etc …)
Any reordering is now not braking the code anymore. Inserting now only needs changes in two places: enums and proto-definition.
Very nice idea! Thanks to whoever it had.