Module constants, character backgrounds number

Users who are viewing this thread

In module constants in the character backgrounds you have the tag with a number next to it like this

cb_noble = 1
cb_merchant = 2
cb_guard = 3
cb_forester = 4
cb_nomad = 5
cb_thief = 6
cb_priest = 7

cb2_page = 0
cb2_apprentice = 1
cb2_urchin  = 2
cb2_steppe_child = 3
cb2_merchants_helper = 4

cb3_poacher = 3
cb3_craftsman = 4
cb3_peddler = 5
cb3_troubadour = 7
cb3_squire = 8
cb3_lady_in_waiting = 9
cb3_student = 10

Does anyone know what the numbers mean? They don't at first glance seem to have obvious meaning. If I added more is the number of the first one important?
 
All values in the module system are converted to an integer on compilation (see the module syntax thread on indexing, and slots for further discussion) and the module_constants file simply declares what integer should be used for certain values.

When the code says cb_noble, it actually is replaced with the number 1. So when you check if a character's background is cb_noble, you are asking if that variable is equal to 1. If the character's background variable equaled 3, then they would be cb_guard, or a warrior.

If you wish to add new character backgrounds, just make sure the integer you assign is not duplicated by the list below, or the engine will be unable to distinguish between the options.
 
Zerilius said:
They are just constants which are used in module_game_menus in the initial character creation.

That is what I have been working on. I have added about 150 new creation options and despite python compiling fine the game gets an RGL error at "load game settings" and prevents the module from loading. I am trying to figure out why and wondering if this is it.

Caba'drin said:
All values in the module system are converted to an integer on compilation (see the module syntax thread on indexing, and slots for further discussion) and the module_constants file simply declares what integer should be used for certain values.

When the code says cb_noble, it actually is replaced with the number 1. So when you check if a character's background is cb_noble, you are asking if that variable is equal to 1. If the character's background variable equaled 3, then they would be cb_guard, or a warrior.

If you wish to add new character backgrounds, just make sure the integer you assign is not duplicated by the list below, or the engine will be unable to distinguish between the options.

Thanks for clarification, it makes sense now. So basically as long as each number is different in each batch of classes it doesn't matter what the number is and so long as each number is different in their sets there is no way this is the cause of my error.

Back to the drawing board
 
Back
Top Bottom