MartinF
Squire
When modding, you tend to have to test a lot. Which means running MNB, starting a new game and then you have to go through the whole spiel of character creation. Then, depending on what you want to test, you have to scour the map for bandits, etc.
While more experienced modders probably have tools in their mod to deal with easy testing, I thought I'd help those starting out by posting a few small tools they can add to their testmod to make life a lot easier.
First. Quick character creation.
This will let you skip all of the steps of the character creation and put you on the map within 20 mouseclicks (and one key stroke.. I have a lot of characters named 'a' ).
in module_game_menus.py, at the very start are the male/female questions that start character creation. Change to the following by copy/pasting the blue part. Now when you start a new game, the middle option will be 'Quick Character' and this will skip all the questions and go straight to the character window. You'll only have to spend 4 stat points (put these in str), no skill points and like 5 weapon proficiency points.
Second. Camp menu for modding tools
Now I use a special camp menu that lets me access some functions that make life a lot easier.
In module_game_menus.py, search for "You set up camp". This will show you the following menu:
Underneath that are a load of menu options. We're going to add one to that, like so (blue text is new):
Now if you press the 'camp' button, the top menu option will be "Go to the modding menu". Of course for that to work, we have to make the menu! So scroll to the bottom of your module_game_menus.py and just before the final bracket add:
My comments in the code explain what all the bits and pieces do and how you can change them to suit your needs. I've used all this many times without problems. The only thing that seems to give the occasional problem is the spawn_near_party. If nothing shows up, just try again. And move a little bit since they often spawn right underneath your party.
These are the basic tools. They don't really affect the module much and are easily removed/disabled by commenting out the new bits.
Hope that helps you out when you're modding! Remember that you can easily adapt these to do what you want.
I got some of these ideas from the custom settlements mod, so thanks go out to them for the basis of this.
While more experienced modders probably have tools in their mod to deal with easy testing, I thought I'd help those starting out by posting a few small tools they can add to their testmod to make life a lot easier.
First. Quick character creation.
This will let you skip all of the steps of the character creation and put you on the map within 20 mouseclicks (and one key stroke.. I have a lot of characters named 'a' ).
in module_game_menus.py, at the very start are the male/female questions that start character creation. Change to the following by copy/pasting the blue part. Now when you start a new game, the middle option will be 'Quick Character' and this will skip all the questions and go straight to the character window. You'll only have to spend 4 stat points (put these in str), no skill points and like 5 weapon proficiency points.
("start_male",[],"Male",
[
(troop_set_type,"trp_player",0),
(assign,"$character_gender",tf_male),
(jump_to_menu,"mnu_start_character_1"),
]
),
############## MF for testing start ####################
("start_mod",[(eq,1,1),],"Quick Character (for mod testing)",
[
(troop_set_type,"trp_player",0),
(assign,"$character_gender",tf_male),
(troop_raise_attribute, "trp_player",ca_intelligence,-4), #so you dont need to wait time picking extra skills
(change_screen_return, 0),
]
),
############## MF for testing end ####################
("start_female",[],"Female",
[
(troop_set_type,"trp_player",1),
(assign,"$character_gender",tf_female),
(jump_to_menu,"mnu_start_character_1")
]
),
Second. Camp menu for modding tools
Now I use a special camp menu that lets me access some functions that make life a lot easier.
In module_game_menus.py, search for "You set up camp". This will show you the following menu:
Code:
("camp",mnf_scale_picture,
"You set up camp. What do you want to do?",
"none",
[
(assign, "$g_player_icon_state", pis_normal),
(set_background_mesh, "mesh_pic_camp"),
],
[
Underneath that are a load of menu options. We're going to add one to that, like so (blue text is new):
("camp",mnf_scale_picture,
"You set up camp. What do you want to do?",
"none",
[
(assign, "$g_player_icon_state", pis_normal),
(set_background_mesh, "mesh_pic_camp"),
],
[
("camp_modding",[],"Go to the modding menu.",
[(jump_to_menu, "mnu_camp_modding"),
]
),
("camp_action_1",[(eq,"$cheat_mode",1)],"Cheat: Walk around.",
[(set_jump_mission,"mt_ai_training"),
Now if you press the 'camp' button, the top menu option will be "Go to the modding menu". Of course for that to work, we have to make the menu! So scroll to the bottom of your module_game_menus.py and just before the final bracket add:
Code:
############## MF for testing start ####################
("camp_modding",0,
"Select an option:",
"none",
[
],
[
("camp_mod_1",
[],"Increase player's renown.",
[(str_store_string, s1, "@Player renown is increased by 100. "),
(call_script, "script_change_troop_renown", "trp_player" ,100),
(jump_to_menu, "mnu_camp_modding"),
]
),
### MF - change attributes and skills below, or add weapon proficiencies with (troop_raise_proficiency, "trp_player", wpt_). See header.troops.py for options
("camp_mod_2",
[],
"Raise player's attributes and skills.",
[
(troop_raise_attribute, "trp_player",ca_intelligence,20),
(troop_raise_attribute, "trp_player",ca_strength,20),
(troop_raise_skill, "trp_player",skl_riding,10),
(troop_raise_skill, "trp_player",skl_spotting,10),
(troop_raise_skill, "trp_player",skl_pathfinding,10),
(troop_raise_skill, "trp_player",skl_trainer,10),
(troop_raise_skill, "trp_player",skl_leadership,10),
(troop_raise_skill, "trp_player",skl_trade,10),
(troop_raise_skill, "trp_player",skl_prisoner_management,10),
(display_message, "@Skills and attributes raised."),
]
),
### MF - Change items below to anything you want to test out, look in items.py for item_id
("camp_mod_3",
[],
"Add gear and gold to player.",
[
(troop_add_gold, "trp_player", 100000),
(troop_add_item, "trp_player","itm_courser",imod_spirited),
(troop_add_item, "trp_player","itm_heraldic_mail_with_surcoat",0),
(troop_add_item, "trp_player","itm_tab_shield_small_round_c",0),
(troop_add_item, "trp_player","itm_jousting_lance",0),
(troop_add_item, "trp_player","itm_splinted_leather_greaves",0),
(troop_add_item, "trp_player","itm_great_sword",imod_balanced),
(troop_add_item, "trp_player","itm_great_helmet",imod_masterwork),
(troop_equip_items, "trp_player"),
(troop_add_item, "trp_player","itm_chicken",0),
(troop_add_item, "trp_player","itm_chicken",0),
(troop_add_item, "trp_player","itm_chicken",0),
(display_message, "@Items added to player inventory."),
]
),
### MF - Add any units you want to test with below, look in troop.py for the troop_id
("camp_mod_4",
[],
"Add units to player party.",
[
(party_add_members, "p_main_party", "trp_swadian_knight", 10),
(party_add_members, "p_main_party", "trp_swadian_recruit", 10),
(display_message, "@Party members added."),
]
),
### MF - Spawn any party you want near your party. Look in party_templates.py for pt_id
("camp_mod_5",
[],
"Spawn a party nearby",
[
(spawn_around_party, "p_main_party", "pt_looters"),
(display_message, "@Party spawned nearby."),
]
),
("camp_mod_6",[],"Back to camp menu.",
[(jump_to_menu, "mnu_camp"),
]
),
]
),
############## MF for testing end ####################
My comments in the code explain what all the bits and pieces do and how you can change them to suit your needs. I've used all this many times without problems. The only thing that seems to give the occasional problem is the spawn_near_party. If nothing shows up, just try again. And move a little bit since they often spawn right underneath your party.
These are the basic tools. They don't really affect the module much and are easily removed/disabled by commenting out the new bits.
Hope that helps you out when you're modding! Remember that you can easily adapt these to do what you want.
I got some of these ideas from the custom settlements mod, so thanks go out to them for the basis of this.
Last edited by a moderator: