Help with game menus (and slavery)

Users who are viewing this thread

I'm messing around with game_menus.py and trying to add a new "Slave Management" feature to villages where the slaves can produce goods and denars for the player, but I'm getting lots of errors when I compile it.

I placed the mnu_manage_slaves at the very end of game_menus.py, right after the code where diplomacy checks village prosperity - see below.


##diplomacy end+

#### Calradia 1000 Begin
("manage_slaves",[],"Manage Slaves"),


#### Calradia 1000 End
]

and I placed the code for managing slaves in villages between going to the village center and recruiting volunteers.


("recruit_volunteers",
[
(call_script, "script_cf_village_recruit_volunteers_cond"),
]
,"Recruit Volunteers.",
[
(try_begin),
(call_script, "script_cf_enter_center_location_bandit_check"),
(else_try),
(jump_to_menu, "mnu_recruit_volunteers"),
(try_end),
]),
#### Calradia 1000 Begin
("Manage Slaves.",
[
(assign, "$g_next_menu", "mnu_manage_slaves"),
(jump_to_menu, "mnu_manage_slaves"),
]),
#### Calradia 1000 End
("village_center",[(neg|party_slot_eq, "$current_town", slot_village_state, svs_looted),
(neg|party_slot_eq, "$current_town", slot_village_state, svs_being_raided),
(neg|party_slot_ge, "$current_town", slot_village_infested_by_bandits, 1),]
,"Go to the village center.",

To noone's surprise the game crashes when I try to launch it because the code is messed up and I don't really have a good idea of what I'm doing. Help would be much appreciated!

I've ironed out most of the problems by myself, however there is still one small module system issue that I need help with, it says that there is a game_menu error. Take a look:

Initializing...
Compiling all global variables...
Error in game menu:
('manage_slaves', [], 'Manage Slaves', [('go_back', [], 'Go Back', [(2060, 'mnu_village')])])
Exporting strings...
Exporting skills...
Exporting tracks...
Exporting animations...
Exporting meshes...
Exporting sounds...
Exporting skins...
Exporting map icons...
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Exporting faction data...
Exporting item data...
Exporting scene data...
Exporting troops data
Exporting particle data...
Exporting scene props...
Exporting tableau materials data...
Exporting presentations...
Error: Unable to find object:trp_swadian_knight
ERROR: Illegal Identifier:trp_swadian_knight
Error: Unable to find object:trp_vaegir_knight
ERROR: Illegal Identifier:trp_vaegir_knight
Exporting party_template data...
Exporting parties
Exporting quest data...
Exporting info_page data...
Exporting scripts...
Error: Unable to find object:trp_swadian_knight
ERROR: Illegal Identifier:trp_swadian_knight
Error: Unable to find object:trp_vaegir_knight
ERROR: Illegal Identifier:trp_vaegir_knight
Error: Unable to find object:trp_swadian_man_at_arms
ERROR: Illegal Identifier:trp_swadian_man_at_arms
Error: Unable to find object:trp_swadian_knight
ERROR: Illegal Identifier:trp_swadian_knight
Error: Unable to find object:trp_vaegir_horseman
ERROR: Illegal Identifier:trp_vaegir_horseman
Error: Unable to find object:trp_vaegir_knight
ERROR: Illegal Identifier:trp_vaegir_knight
Exporting mission_template data...
Exporting game menus data...
Error: Unable to find object:trp_swadian_knight
ERROR: Illegal Identifier:trp_swadian_knight
Error: Unable to find object:trp_vaegir_knight
ERROR: Illegal Identifier:trp_vaegir_knight
Traceback (most recent call last):
File "process_game_menus.py", line 47, in <module>
save_game_menus(variables,variable_uses,tag_uses,quick_strings)
File "process_game_menus.py", line 26, in save_game_menus
ofile.write("menu_%s %d %s %s"%(game_menu[0],game_menu[1],string.replace(game_menu[2]," ","_"),game_menu[3]))
TypeError: %d format: a number is required, not list
exporting simple triggers...
exporting triggers...
exporting dialogs...
Checking global variable usages...
Imported 56 global variables for saved-game compatability that are not used.
Exporting postfx_params...

______________________________

Script processing has ended.
Press any key to exit. . .
 
Last edited:
Solution
("manage_slaves",0,
"Manage Slaves",
"none",
[],
[
("go_back",[],"Go Back",
[
(jump_to_menu, "mnu_village"),
]),
]
),


Sorry for bad formating I'm on phone but since this is a new main menu it should look like this.
("Manage Slaves.",
[
(assign, "$g_next_menu", "mnu_manage_slaves"),
(jump_to_menu, "mnu_manage_slaves"),

]),

That's the condition block
Look how other menus are made...

("managing_slaves",[], "Manage Slaves.",
[
(jump_to_menu, "mnu_manage_slaves"),
]),
 
Last edited by a moderator:
Upvote 0
("Manage Slaves.",
[
(assign, "$g_next_menu", "mnu_manage_slaves"),
(jump_to_menu, "mnu_manage_slaves"),

]),

That's the condition block
Look how other menus are made...

("managing_slaves",[], "Manage Slaves.",
[
(jump_to_menu, "mnu_manage_slaves"),
]),

I'm not sure I understand. I already have something similar in place for the villages:

#### Calradia 1000 Begin
("manage_slaves_village.",
[
(neg|party_slot_eq, "$current_town", slot_village_state, svs_looted),
(neg|party_slot_eq, "$current_town", slot_village_state, svs_being_raided),
(neg|party_slot_ge, "$current_town", slot_village_infested_by_bandits, 1),
]
,"Manage the Slaves.",
[
(assign, "$g_next_menu", "mnu_manage_slaves"),
(jump_to_menu, "mnu_manage_slaves"),
]),
#### Calradia 1000 End
I'm probably misinterpreting what you're trying to tell me, but the issue is with this line of code (as far as the module system says):

("manage_slaves",[],"Manage Slaves",
[
("go_back",[],"Go Back",
[
(jump_to_menu, "mnu_village"),
]),
]
),

This is supposed to be the menu that you jump to after clicking the option in the village, currently the only thing you can select is "Go Back" but it's creating errors in the module system. Sorry if I misunderstood what you said, this is an advanced level of coding for me :razz:
 
Upvote 0
("manage_slaves",0,
"Manage Slaves",
"none",
[],
[
("go_back",[],"Go Back",
[
(jump_to_menu, "mnu_village"),
]),
]
),


Sorry for bad formating I'm on phone but since this is a new main menu it should look like this.
 
Upvote 0
Solution
Back
Top Bottom