Change playername/Crowns

Users who are viewing this thread

Darwin

Watchin' your language...
Section Moderator
Hello @all,

I'm working on a new feature for my (german) mod: crowns(is this correct?, my english isn't that good; earl, baron...are ment)
I want to change the playername if the player buys a crown(Peter;buys crown->Earl Peter) but i don't know how :cry: please help

at the moment in the module_game_menus.py the following is written:

Code:
##crowns##
      ("camp_buy_crown",
       [(this_or_next|party_slot_eq, "p_town_1", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_town_2", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_town_3", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_town_4", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_town_5", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_town_6", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_town_7", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_town_8", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_town_9", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_town_10", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_town_11", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_town_12", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_town_13", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_town_14", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_town_15", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_town_16", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_town_17", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_town_18", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_castle_1", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_castle_2", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_castle_3", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_castle_4", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_castle_5", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_castle_6", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_castle_7", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_castle_8", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_castle_9", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_castle_10", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_castle_11", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_castle_12", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_castle_13", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_castle_14", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_castle_15", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_castle_16", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_castle_17", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_castle_18", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_castle_19", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_castle_20", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_castle_21", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_castle_22", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_castle_23", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_castle_24", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_castle_25", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_castle_26", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_castle_27", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_castle_28", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_castle_29", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_castle_30", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_castle_31", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_castle_32", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_castle_33", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_castle_34", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_castle_35", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_castle_36", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_castle_37", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_castle_38", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_castle_39", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_castle_40", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_1", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_2", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_3", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_4", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_5", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_6", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_7", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_8", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_9", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_10", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_11", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_12", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_13", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_14", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_15", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_16", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_17", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_18", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_19", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_20", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_21", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_22", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_23", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_24", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_25", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_26", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_27", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_28", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_29", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_30", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_31", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_32", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_33", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_34", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_35", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_36", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_37", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_38", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_39", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_40", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_41", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_42", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_43", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_44", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_45", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_46", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_47", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_48", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_49", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_50", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_51", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_52", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_53", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_54", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_55", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_56", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_57", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_58", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_59", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_60", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_61", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_62", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_63", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_64", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_65", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_66", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_67", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_68", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_69", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_70", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_71", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_72", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_73", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_74", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_75", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_76", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_77", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_78", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_79", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_80", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_81", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_82", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_83", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_84", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_85", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_86", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_87", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_88", slot_town_lord, "trp_player"),
        (this_or_next|party_slot_eq, "p_village_89", slot_town_lord, "trp_player"),
        (party_slot_eq, "p_village_90", slot_town_lord, "trp_player"),
        ],
       "Kauft einen neuen Titel.",
       [(jump_to_menu, "mnu_crown"),
       ],
       ),
##crowns##

Code:
##crowns##------------------------------------------------------------------------------
  ("crown,0,
   "Waehlt den Titel, den ihr erwerben moechtet.",
   "none",
   [],
   [
   ("crown1",[(eq, "$character_gender", tf_male)],"Herzog (200000 Dinare)",
    [(display_message, "@Ihr bestecht den Schreiber des Koenigs"),
     (display_message, "@und erhaltet den Titel Herzog!"),
     (troop_remove_gold, "trp_player",200000),
     (call_script, "script_game_reset_player_party_name_caption1"),
     (call_script, "script_change_player_honor", 30),
     (troop_raise_attribute, "trp_player",ca_intelligence,10),
     (troop_raise_attribute, "trp_player",ca_charisma,10),
     (troop_raise_attribute, "trp_player",ca_strength,10),
     (troop_raise_attribute, "trp_player",ca_agility,10),
     (troop_raise_skill, "trp_player","skl_trade",4),
     (troop_raise_skill, "trp_player","skl_riding",4),
     (troop_raise_skill, "trp_player","skl_ironflesh",4),
     (troop_raise_skill, "trp_player","skl_looting",4),
     (troop_raise_skill, "trp_player","skl_pathfinding",4),
     (troop_raise_skill, "trp_player","skl_surgery",4),
     (troop_raise_skill, "trp_player","skl_spotting",4),
     (troop_raise_skill, "trp_player","skl_spotting",4),
     (troop_raise_skill, "trp_player","skl_engineer",4),
     (troop_raise_skill, "trp_player","skl_persuasion",4),
     (troop_raise_skill, "trp_player","skl_inventory_management",4),
     (troop_raise_skill, "trp_player","skl_tactics",4),
     (troop_raise_skill, "trp_player","skl_trainer",4),
     (troop_raise_skill, "trp_player","skl_tracking",4),
     (troop_raise_skill, "trp_player","skl_wound_treatment",4),
     (troop_raise_skill, "trp_player","skl_first_aid",4),
     (troop_raise_skill, "trp_player","skl_leadership",4),
     (troop_raise_skill, "trp_player","skl_prisoner_management",4),
     (troop_raise_skill, "trp_player","skl_horse_archery",4),
     (troop_raise_skill, "trp_player","skl_athletics",2),
     (troop_raise_skill, "trp_player","skl_shield",4),
     (troop_raise_skill, "trp_player","skl_power_draw",4),
     (troop_raise_skill, "trp_player","skl_power_throw",4),
     (troop_raise_skill, "trp_player","skl_power_strike",4),
     (troop_raise_skill, "trp_player","skl_weapon_master",4),
     (call_script, "script_change_troop_renown", "trp_player" ,500),
     (call_script, "script_change_player_relation_with_troop","trp_kingdom_1_lord", 50),
     (call_script, "script_change_player_relation_with_troop","trp_kingdom_2_lord", 50),
     (call_script, "script_change_player_relation_with_troop","trp_kingdom_3_lord", 50),
     (call_script, "script_change_player_relation_with_troop","trp_kingdom_4_lord", 50),
     (call_script, "script_change_player_relation_with_troop","trp_kingdom_5_lord", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_1_1", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_1_2", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_1_3", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_1_4", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_1_5", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_1_6", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_1_7", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_1_8", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_1_9", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_1_10", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_1_11", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_1_12", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_1_13", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_1_14", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_1_15", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_1_16", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_1_17", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_1_18", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_1_19", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_1_20", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_2_1", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_2_2", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_2_3", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_2_4", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_2_5", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_2_6", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_2_7", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_2_8", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_2_9", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_2_10", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_2_11", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_2_12", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_2_13", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_2_14", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_2_15", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_2_16", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_2_17", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_2_18", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_2_19", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_2_20", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_3_1", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_3_2", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_3_3", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_3_4", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_3_5", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_3_6", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_3_7", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_3_8", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_3_9", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_3_10", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_3_11", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_3_12", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_3_13", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_3_14", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_3_15", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_3_16", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_3_17", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_3_18", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_3_19", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_3_20", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_4_1", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_4_2", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_4_3", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_4_4", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_4_5", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_4_6", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_4_7", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_4_8", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_4_9", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_4_10", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_4_11", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_4_12", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_4_13", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_4_14", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_4_15", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_4_16", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_4_17", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_4_18", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_4_19", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_4_20", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_5_1", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_5_2", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_5_3", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_5_4", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_5_5", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_5_6", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_5_7", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_5_8", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_5_9", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_5_10", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_5_11", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_5_12", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_5_13", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_5_14", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_5_15", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_5_16", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_5_17", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_5_18", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_5_19", 50),
     (call_script, "script_change_player_relation_with_troop","trp_knight_5_20", 50),
     (call_script, "script_change_player_relation_with_troop","trp_kingdom_1_pretender", 50),
     (call_script, "script_change_player_relation_with_troop","trp_kingdom_2_pretender", 50),
     (call_script, "script_change_player_relation_with_troop","trp_kingdom_3_pretender", 50),
     (call_script, "script_change_player_relation_with_troop","trp_kingdom_4_pretender", 50),
     (call_script, "script_change_player_relation_with_troop","trp_kingdom_5_pretender", 50),
     (jump_to_menu, "mnu_camp_action"),
     ]
    ),
[color=blue]...[/color]

module_scripts.py:
Code:
##crowns##----------------------------------------------------------
  ("game_reset_player_party_name_crown1",
    [(str_store_troop_name, "trp_player", "str_crown1"),
     (party_set_name, "p_main_party", "str_crown1"),
     ]),
...

and module_strings.py:
Code:
#crowns##------------------------------------------------
  ("crown1", "Herzog {playername}"),
...

thx for help :D
 
you Germans and your translating.. if you didn't do so much of it, your English would be a lot better now ;)

You should take a cue from us Dutch people :D:D

Anyway.. seriously:

I'm not sure if you can change the playername directly. You can change the name of a party, but not of a troop.

The word, by the way, is 'Title' and Earls, Barons and Dukes and such are 'Nobles'
 
MartinF said:
...
I'm not sure if you can change the playername directly. You can change the name of a party, but not of a troop.
...

He's not changing the name of the troop, check his script.  That would work for when others address the player's party.  Sucks that you cannot rename a troop name...  would be nice for my mod...  It's just a string, what's the big deal?
 
MartinF said:
The word, by the way, is 'Title' and Earls, Barons and Dukes and such are 'Nobles'

****...

MartinF said:
I'm not sure if you can change the playername directly. You can change the name of a party, but not of a troop.

changing the partyname works and theoretical you can change the name of a troop:

Code:
(str_store_troop_name, "trp_player", "str_crown1"),

but this doesn't work :(
 
incidentally, you can slim down your code A LOT

You're using individual checks and assignments for everything, which is both a lot of work and a lot of unnecessary code.

In programming, loops are usually used for this type of thing. MNB module system is no different.

So instead of checking each individual town and castle to see if the player is a lord somewhere, you can do

(assign, ":continue", 0),
(try_for_range, ":cur_center", centers_begin, centers_end),
(eq, ":continue", 0), #so that it stops once we've found a center where the player is the lord
(party_slot_eq, ":cur_center", slot_town_lord, "trp_player"),
(assign, ":continue", 1),
(try_end),
(eq, ":continue", 1), #if the player is a lord somewhere, the conditions block of the menu will return as true and show, if not, it won't.

The centers_begin and center_end are defined in module_constants.py. If you want to only run the check if the player owns a castle or town, you can use walled_centers_begin and _end. Alternatively you can make your own range if you want. The point is, you don't need to call each one individually.

":cur_center" is the counter. The variable will change for each run of the loop. So the first time, it will have the value of "centers_begin", which is probably p_town_1 and as such, the check will be (party_slot_eq, "p_town_1", slot_town_lord, "trp_player"),

For the second run, it will be p_town_2 and so on until it reaches the final value. Now here's the one catch with this. The final value WILL NOT BE TESTED. So if you say (try_for_range, ":i", 1, 10), it will run 1, 2, 3, 4, 5, 6, 7, 8, 9 and then stop. So you need to always define the last thing you want to test plus 1. In the constants, this has already been done, so the thing that is defined as "centers_end" is actually the item that is one past the last center. Hope that makes sense to you.

The same with the knights and lords, you can run through them the same way, using another constant: kingdom_heroes

So you do the same thing:

(try_for_range, ":cur_hero", kingdom_heroes_begin, kingdom_heroes_end),
  (call_script, "script_change_player_relation_with_troop",":cur_hero", 50),
(try_end),

This is an extremely important concept in programming because it will save you an insane amount of time and is much more flexible.

@jik.. the OP question was "I want to change the playername if the player buys a crown(Peter;buys crown->Earl Peter) but i don't know how :cry: please help"

So even though it wasn't in the code, I assume that he wanted to change the name, since that was the question :)

And Darwin: as for the str_store_troop_name, I think you're confused there. What it's used for is to store the troop name in a string, not the other way around.

So (string_store_troop_name, s1, "trp_player"), will give you 'George' in s1 which you can then use to say:
(display_message, "@Hi, my name is {s1}"),

which would print "Hi, my name is George" in a message at the bottom left of the screen.
 
Tis true Marin, but I was going by what he coded.

If you really want to slim down the code, You should only be able to buy a crown when you complete a task (such as taking a castle/town).  That way you don't have to check if the player owns a town and wants to buy a crown.  That or set a flag (troop_slot) at the time you take your first town so that you only have to check one value when you buy the crown.
 
MartinF said:
(assign, ":continue", 0),
(try_for_range, ":cur_center", centers_begin, centers_end),
(eq, ":continue", 0), #so that it stops once we've found a center where the player is the lord
(party_slot_eq, ":cur_center", slot_town_lord, "trp_player"),
(assign, ":continue", 1),
(try_end),
(eq, ":continue", 1), #if the player is a lord somewhere, the conditions block of the menu will return as true and show, if not, it won't.
FYI - That doesn't actually stop the loop.  if continue = 1 on the first try, it will still loop over every single center in the game.
To truly stop the loop, the only way you can in MS is:

Code:
(assign, ":found", centers_end),
(try_for_range, ":cur_center", centers_begin, ":found"),
 (party_slot_eq, ":cur_center", slot_town_lord, "trp_player"),
 (assign, ":found", ":cur_center"), # this really does stop the loop from continuing to waste time...
(try_end),
(neq ":found", centers_end), 
#we only execute this line and beyond if the player is in fact the lord of at least one location

Hopefully I'm being helpful and not pedantic :P
 
Mordachai said:
MartinF said:
(assign, ":continue", 0),
(try_for_range, ":cur_center", centers_begin, centers_end),
(eq, ":continue", 0), #so that it stops once we've found a center where the player is the lord
(party_slot_eq, ":cur_center", slot_town_lord, "trp_player"),
(assign, ":continue", 1),
(try_end),
(eq, ":continue", 1), #if the player is a lord somewhere, the conditions block of the menu will return as true and show, if not, it won't.
FYI - That doesn't actually stop the loop.  if continue = 1 on the first try, it will still loop over every single center in the game.


heh.. yeah of course. Stupid of me. But it will at least lessen the load on the cpu by not checking the slot, although that's hardly an issue with MNB while on the map or in a menu. It's interesting that you can change the range once the loop has started. I would've thought that since you can't change the counter variable during the loop, you also can't mess with the loop in that way. Especially in this case since you're effectively declaring the end to be the second to last counter value that was already checked (since it's end minus 1).

Anyway the rest is still true :D

And like I said, the playername is no go, unfortunately, there's no way to change it. Another problem is that there's nothing stopping the player naming himself 'Earl George' anyway, so that's hardly going to make it worth paying money for.

BUT.. changing the party name, that might be worth it (apart from the relation bonus). So now your party is called 'Earl George's Party' or something like that which is cool since it's obviously a title and it's different from the player's name.

If you want to really go all out, you can make npcs use the title. It'll be a bit of work because you'll have to code it into all the dialog where you want to use it, but it would be possible to set a slot on the player once he receives his title slot_troop_title or something like that. If it's bigger than 0, the dialog can be different altogether, or it can use [title] [playername] instead of just [playername]. It's a lot of work for a bit of fluff but hey, god is in the details :)
 
And like I said, the playername is no go, unfortunately, there's no way to change it. Another problem is that there's nothing stopping the player naming himself 'Earl George' anyway, so that's hardly going to make it worth paying money for.

damn :(,anyway the partyname can change, although thx for help
 
It's been asked a few times, but we need additions to operations.py to allow for some simple tuple field access, like areas of the items tuples.  It would also be nice if it were possible to change any of the name strings, since they are just name strings.  Of course, this means that they would need to release a new module system purhapse...  But it does suck that you can access and edit party names, but not troop names.
 
Back
Top Bottom