OSP Code SP Expanding cheat menu

Users who are viewing this thread

k61824

Veteran
As the name suggests this adds to the function of the cheat menu in Native so I can actually test other things I may have been building.  Therefore, it requires your cheatmenu command to make these appear.  (Of course whether you would like to abuse that to whatever you might fancy is a completely separate issue.)

part 1a:  forcing truce and increase faction relations (Encounter with faction leader)


Add this into module_dialogue.py

Code:
  [anyone|plyr,"lord_suggest_action", [(faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),],
   "{!}CHEAT: Make peace with me.", "lord_pretalk",[
     (call_script, "script_diplomacy_start_peace_between_kingdoms", "$g_talk_troop_faction", "$players_kingdom", 1),
      	 (store_relation, ":players_kingdom_relation", "$g_talk_troop_faction", "$players_kingdom"),
	 
     (try_begin),
       (this_or_next|eq, "$players_kingdom", 0),
		(ge, ":players_kingdom_relation", 0),
       (call_script, "script_set_player_relation_with_faction", "$g_talk_troop_faction", 0),
     (else_try),
       (call_script, "script_diplomacy_start_peace_between_kingdoms", "$g_talk_troop_faction", "$players_kingdom", 1),
     (try_end),]],
  [anyone|plyr,"lord_suggest_action", [(faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),],
   "{!}CHEAT: Make your faction like me.", "lord_pretalk",[
     (store_relation, ":players_kingdom_relation", "$g_talk_troop_faction", "$players_kingdom"),
     (val_add,":players_kingdom_relation",20),
     (val_min,":players_kingdom_relation",100),
     (call_script, "script_set_player_relation_with_faction", "$g_talk_troop_faction", ":players_kingdom_relation"),
     ]],

part 1b:  forcing truce between AI factions
in module_game_menus.py, under "faction_orders" , add the following choice:
Code:
      ("faction_orders_peace", [],"{!}Force truce with other AI kingdoms.",
       [
         (try_for_range, ":faction", npc_kingdoms_begin, npc_kingdoms_end),
		(neg|eq,":faction","$g_cheat_selected_faction"),
		(call_script, "script_diplomacy_start_peace_between_kingdoms", ":faction", "$g_cheat_selected_faction", 1),
	 (try_end),
         (jump_to_menu, "mnu_faction_orders"),
        ]
       ),

This one will force a truce between the selected faction with all other AI factions (you got the dialogue to force truce with you.)
 
part 2:  making women (single/married) like you (you can already make AI lords like you, so it is not as creepy as it sounds.  Besides, raising relation with a woman married with someone else is really challenging at times.)

Add the following in module_dialogs.py
Code:
[anyone|plyr,"lady_talk", [(ge, "$cheat_mode", 1),],
   "{!}CHEAT: Like me.", "lady_pretalk",[(call_script,"script_change_player_relation_with_troop","$g_talk_troop",20)]],
 
Part 3a:  Girl(s) you are courting dating someone else and not telling you to stop the guys?  Stop this from happening with a button breaking the ties with suitors!

Add the following in module_dialogs.py

Code:
  [anyone|plyr,"lady_talk", [(ge, "$cheat_mode", 1),(troop_slot_eq, "$g_talk_troop", slot_troop_spouse, -1),],
   "{!}CHEAT: Break ties with other suitors.", "lady_pretalk",[
	(try_for_range, ":active_npc", active_npcs_begin, active_npcs_end),
		(try_for_range, ":love_interest_slot", slot_troop_love_interest_1, slot_troop_love_interests_end),
			(troop_slot_eq, ":active_npc", ":love_interest_slot", "$g_talk_troop"),
			(call_script, "script_courtship_event_lady_break_relation_with_suitor", "$g_talk_troop", ":active_npc"),
		(try_end),
	(try_end),
]],

Part 3b:  Girl(s) you are courting betrothed and the groom is not you, and she refuses to elope even she likes you (or at least you think she likes you, right?)?  Stop this from happening by marrying the girl!

Add the following in module_dialogs.py

Code:
[anyone|plyr,"lady_betrothed", [(eq, "$cheat_mode", 1),],
    "CHEAT:  Wed me.","lady_pretalk",[(call_script, "script_courtship_event_bride_marry_groom", "$g_talk_troop", "trp_player", 0),]],
(edit the last parameter for the call script to 1 if you still prefer to elope)

Part 3c:  Stuck in a betrothal because the AI lord needs delay your wedding to do whatever?  Now your cheat dialog can hurry up and finish wedding right there!

Code:
  [anyone|plyr, "lord_wedding_reschedule", [(ge, "$cheat_mode", 1),(quest_get_slot, "$g_player_bride", "qst_wed_betrothed", slot_quest_target_troop),],
   "CHEAT:  Let's finish the wedding right now.", "wedding_ceremony_bride_vow",
   [
   ]],

If you are the extreme type, finish it right when he give you the quest with the following code (it will be buried along with other cheat dialogs you'll normally find):
(EDIT:  Vow is skipped for now because of a bug that will cause you to encounter the lord in battle if I keep the vow when you use it on the field.)
Code:
  [anyone|plyr,"lord_suggest_action", [	(neq, "$talk_context", tc_siege_commander),
					(ge, "$cheat_mode", 1),(check_quest_active, "qst_wed_betrothed"),
					(quest_slot_eq, "qst_wed_betrothed", slot_quest_giver_troop, "$g_talk_troop"),
					(quest_get_slot, "$g_player_bride", "qst_wed_betrothed", slot_quest_target_troop),],
   "CHEAT:  Finish the wedding with my betrothed.", "lord_pretalk",[
        (call_script, "script_courtship_event_bride_marry_groom", "$g_player_bride", "trp_player", 0), #parameters from dialog
	(call_script, "script_get_kingdom_lady_social_determinants", "$g_player_bride"),
	(str_store_troop_name, s3, "$g_player_bride"),
	
    (try_begin),
		(neq, reg0, "trp_player"),
		(str_store_string, s11, "str_error__player_not_logged_as_groom"),
	(else_try),
		(str_store_party_name, s11, reg1),
		(troop_set_slot, "$g_player_bride", slot_troop_cur_center, reg1),
	(try_end),
   ]],
 
part 4a:  manipulating prosperity/relations with town/villages

In module_game_menus.py,  insert the following
(EDIT:  You might want to group these into a submenu in case you want all the options for the town; the max number of options for any menu is 16)
Code:
      ("town_prosperity_add",
      [ (eq, "$cheat_mode", 1),
	(this_or_next|party_slot_eq,"$current_town",slot_party_type, spt_town),
	  (party_slot_eq,"$current_town",slot_party_type, spt_village),
      ],
      "{!}CHEAT: increase prosperity.",
      [(call_script, "script_change_center_prosperity", "$current_town", 10),
      ]),
      ("town_prosperity_less",
      [ (eq, "$cheat_mode", 1),
	(this_or_next|party_slot_eq,"$current_town",slot_party_type, spt_town),
	  (party_slot_eq,"$current_town",slot_party_type, spt_village),
      ],
      "{!}CHEAT: decrease prosperity.",
      [(call_script, "script_change_center_prosperity", "$current_town", -10),
      ]),

      ("town_relation_add",
      [ (eq, "$cheat_mode", 1),
	(this_or_next|party_slot_eq,"$current_town",slot_party_type, spt_town),
	  (party_slot_eq,"$current_town",slot_party_type, spt_village),
      ],
      "{!}CHEAT: increase relations with the folks.",
      [(call_script, "script_change_player_relation_with_center", "$current_town", 10),
      ]),
      ("town_relation_less",
      [ (eq, "$cheat_mode", 1),
	(this_or_next|party_slot_eq,"$current_town",slot_party_type, spt_town),
	  (party_slot_eq,"$current_town",slot_party_type, spt_village),
      ],
      "{!}CHEAT: decrease relations with the folks.",
      [(call_script, "script_change_player_relation_with_center", "$current_town", -10),
      ]),


For villages,  put it in the menu "village" among the choices
For towns, put it in the menu "town" among the choices


part 4b:  unloot the village

In module_game_menus.py,  insert the following
Code:
      ("unloot",
      [ (eq, "$cheat_mode", 1),
	(party_slot_eq,"$current_town",slot_party_type, spt_village),
        (party_slot_eq, "$current_town", slot_village_state, svs_looted),
      ],
      "{!}CHEAT: unloot the village.",
      [(party_set_slot, "$current_town", slot_village_state, svs_normal),
      ]),
into the menu "village" among the choices
 
part 5: commerce
Ever getting annoyed because you need to wait a week to check item spawning changes?  now you don't have to!  Force the equipment merchants to respawn everywhere by inserting the following code
Code:
      ("force_refresh_equip",[(ge,"$cheat_mode",1),(party_slot_ge, "$current_town", slot_town_horse_merchant, 1),(party_slot_ge, "$current_town", slot_town_weaponsmith, 1),(party_slot_ge, "$current_town", slot_town_armorer, 1)],
       "Cheat: Refresh Equipment merchant inventories everywhere.",
       [(call_script,"script_refresh_center_armories"),
	(call_script,"script_refresh_center_weaponsmiths"),
	(call_script,"script_refresh_center_stables"),
        ]),
into "town_trade" as one of the option entry in module_game_menus.py
 
part 6: your party morale.

To add a cheat to increase morale, drop this code
Code:
      ("camp_cheat_7",[],"{!}Increase morale for player party.",
       [
	 (party_get_morale, ":morale", "p_main_party"),
	 (val_add,":morale",10),
	 (party_set_morale, "p_main_party", ":morale"),
        ]
       ),

into "camp_cheat" as one of the options in module_game_menus.py
 
These are great, but I believe there's a typo in your "unloot" menu (highlighted in bold):

      ("unloot",
      [ (eq, "$cheat_mode", 1),
(party_slot_eq,"$current_town",slot_party_type, spt_village),
        (party_slot_eq, "$current_town", slot_village_state, svs_looted),svs_normal
      ],
      "{!}CHEAT: unloot the village.",
      [(party_set_slot, "$current_town", slot_village_state, svs_normal),
      ]),



There's another typo and unnecessary bracket here: 

[anyone|plyr,"lord_suggest_action", [ (neq, "$talk_context", tc_siege_commander)],
(ge, "$cheat_mode", 1),(check_quest_active, "qst_wed_betrothed"),
(quest_slot_eq, "qst_wed_betrothed", slot_quest_giver_troop, "$g_talk_troop"),],
  ["CHEAT:  Finish the wedding with my betrothed.", "wedding_ceremony_bride_vow",
  ]],



And another -- This:

  [anyone|plyr,"lord_suggest_action", [ (neq, "$talk_context", tc_siege_commander)],
(ge, "$cheat_mode", 1),(check_quest_active, "qst_wed_betrothed"),
(quest_slot_eq, "qst_wed_betrothed", slot_quest_giver_troop, "$g_talk_troop"),],
  ["CHEAT:  Finish the wedding with my betrothed.", "wedding_ceremony_bride_vow",
  ]],

should look like this (misplaced brackets):

  [anyone|plyr,"lord_suggest_action", [ (neq, "$talk_context", tc_siege_commander)],
(ge, "$cheat_mode", 1),(check_quest_active, "qst_wed_betrothed"),
(quest_slot_eq, "qst_wed_betrothed", slot_quest_giver_troop, "$g_talk_troop"),],
  "CHEAT:  Finish the wedding with my betrothed.", "wedding_ceremony_bride_vow",
  []],
 
Thank you for the corrections for them (the square bracket after tc_siege_commander is the extra one, as the condition requires the quest to be active).  More checking revealed a bug with respect to outdoor encounter with the lord in question so I made some changes to it as well.
 
Totenkopf900 said:
fallentrojan said:
Incredible. This works on native only or mods too?

If you have the mod source code you may be able to put this on the mod.

Unbelievable. I didn't think anyone would reply at first, since this is an olf post.
This is great.

Anyway, forgive my noobness, but I actually know next to nothing about editing module. All this time I've only ever used txt ediror using morgh editor. Do i need to use morgh editor as well to do this? Would you be so kind as to sort of walk me through it? Thanks a lot in advance
 
To use those codes that the OP posted you need the module system, you can download the latest one is the Taleworlds site.I recommend checking the Documentation and Tutorial board, lots of stuff there.
 
Totenkopf900 said:
To use those codes that the OP posted you need the module system, you can download the latest one is the Taleworlds site.I recommend checking the Documentation and Tutorial board, lots of stuff there.

Ahh, okay, more noob question, so I just gotta download that from taleworld and then follow instructions on this page? It doesn't matter what mod I'm using?
 
kraggrim said:
To increase the range of the cheat menu backup your menus.txt file then open it and find this section:

menu_cheat_find_item 0 {!}Current_item_range:_{reg5}_to_{reg6} none 4 2133 2 72057594037927941 144115188075856184 2120 3 72057594037927942 144115188075856184 96 2110 2 72057594037927942 288230376151712346 2106 2 72057594037927942 1 3
mno_cheat_find_item_next_range  0  {!}Move_to_next_item_range.  6 2105 2 144115188075856184 96 4 0 30 2 144115188075856184 288230376151712346 2133 2 144115188075856184 0 3 0 2060 1 864691128455135257  .  mno_cheat_find_item_choose_this  0  {!}Choose_from_this_range.  9 1532 1 360287970189639684 2120 3 1224979098644774912 144115188075856184 96 2110 2 1224979098644774912 288230376151712346 2121 3 1224979098644774913 1224979098644774912 144115188075856184 6 3 1224979098644774914 0 1224979098644774913 2120 3 1224979098644774915 144115188075856184 1224979098644774914 1535 3 360287970189639684 1224979098644774915 1 3 0 2042 1 360287970189639684  .  mno_camp_action_4  0  {!}Back_to_camp_menu.  1 2060 1 864691128455135255  .

Increase these bolded numbers by 1 for every item you've added. Never tried it with that many items though. This is for Native, the numbers will be a bit different for whatever mod you you're altering, but you should be able to work it out and apply the same process.
 
fallentrojan said:
Totenkopf900 said:
To use those codes that the OP posted you need the module system, you can download the latest one is the Taleworlds site.I recommend checking the Documentation and Tutorial board, lots of stuff there.

Ahh, okay, more noob question, so I just gotta download that from taleworld and then follow instructions on this page? It doesn't matter what mod I'm using?

No man, the mod system is in that site is for the Native module, to mod other mods you need their source code and most of them are not open to public, some mods that you can modify are Floris, Diplomacy, 1257 A.D, and a few others, check this https://forums.taleworlds.com/index.php/topic,377920.0.html
 
Back
Top Bottom