OSP Code SP [WB] Custom Player Party Name

Users who are viewing this thread

One of the seemingly unanswered (perhaps EatRC has it?)--yet strikingly simple--suggestions from the King's Court is to give the player control over the name that is displayed for their party on the world map. This bit of code will add an option to the Camp Action menu much akin to the Rename Kingdom option. Within this, the player can set the name for their party that will be displayed on the world map. There is also an option that will allow the player to revert their party name back to matching the name of their character. The change to the party name will be instantaneous and will remain fixed despite character name changes with a simple change to a script, as outlined below.

Without further ado, the code:

Add this any where in module_presentations. The end, before the final ] works just fine.
Code:
  ("set_party_name",0,mesh_load_window,[
     (ti_on_presentation_load,
       [(set_fixed_point_multiplier, 1000),
        (str_store_string, s1, "@What will your party be known as?"),
        (create_text_overlay, reg1, s1, tf_center_justify),
        (position_set_x, pos1, 500),
        (position_set_y, pos1, 500),
        (overlay_set_position, reg1, pos1),
        (overlay_set_text, reg1, s1),
        (create_simple_text_box_overlay, "$g_presentation_obj_name_kingdom_1"),
        (position_set_x, pos1, 400),
        (position_set_y, pos1, 400),
        (overlay_set_position, "$g_presentation_obj_name_kingdom_1", pos1),        
        (str_store_party_name, s7, "p_main_party"),
        (overlay_set_text, "$g_presentation_obj_name_kingdom_1", s7),
        
        (create_button_overlay, "$g_presentation_obj_name_kingdom_2", "@By the name entered above."),
        (position_set_x, pos1, 500),
        (position_set_y, pos1, 300),
        (overlay_set_position, "$g_presentation_obj_name_kingdom_2", pos1),
          
        (str_store_troop_name, s5, "trp_player"),
        (create_button_overlay, reg1, "@Simply by my name: {s5}."),
        (position_set_x, pos1, 500),
        (position_set_y, pos1, 275),
        (overlay_set_position, reg1, pos1),  
          
        (presentation_set_duration, 999999),
        ]),
      (ti_on_presentation_event_state_change,
       [(store_trigger_param_1, ":object"),
        (try_begin),
          (eq, ":object", "$g_presentation_obj_name_kingdom_1"),
          (str_store_string, s7, s0),
        (else_try),
          (eq, ":object", "$g_presentation_obj_name_kingdom_2"),
          (party_set_name, "p_main_party", s7),
          (party_set_slot, 0, 1, 1),
          (presentation_set_duration, 0),
        (else_try),
          (store_add, ":overlay", "$g_presentation_obj_name_kingdom_2", 1),
          (eq, ":overlay", ":object"),
          (party_set_name, "p_main_party", s5),
          (party_set_slot, 0, 1, 0),
          (presentation_set_duration, 0),
        (try_end),
        ]),
      ]),   
Add this within the "camp_action" menu, before or after "action_rename_kingdom".
Code:
   ("action_change_party_name",
       [(troop_slot_ge, "trp_player", slot_troop_renown, 300)], #My opinion is that it should be renown-dependent...
       "Change your party's name.",
       [(start_presentation, "prsnt_set_party_name")]
       ),
Insert 3 lines, as marked, into this one Native script below. Or don't, but the player's party name will change with changes to the character name then.
Code:
  #script_game_reset_player_party_name:
  # This script is called from the game engine when the player name is changed.
  # INPUT: none
  # OUTPUT: none
  ("game_reset_player_party_name",
    [(try_begin),                             ##ADD THIS LINE
     (party_slot_eq, 0, 1, 0),                ##ADD THIS LINE
     (str_store_troop_name, s5, "trp_player"),
     (party_set_name, "p_main_party", s5),
     (try_end),                               ##ADD THIS LINE
     ]),
 
Well thank you, Very Great for My Mod :grin:
But in this code
Code:
   
       ("action_change_party_name",
       [(troop_slot_ge, "trp_player", slot_troop_renown, 300)], #My opinion is that it should be renown-dependent...
       "Change your party's name.",
       [(start_presentation, "prsnt_set_party_name")]
       ),
So... If we want to get the This Option, The Player must be at Renown 300 or Higher, Like that?
If i want to delete that 300, and slot_troop_renown code, so the lower renown can change their name of party?

Edit: Don't Reply it, I had change that 300 to 50 because i think 300 Renown is to Hard
 
Thanks a lot Caba'drin, I am adding this little gem to Rigale, giving credits of course. Take care.
 
Back
Top Bottom