How can I allow the player to rename someone who never joins their team?

From OHRRPGCE-Wiki
Jump to navigation Jump to search

Heroes can be renamed with simple plotscripting, but what if you want to allow the player to rename a character who is never actually a part of the party?

The best way to do this is to store the character's name in a string.

# In this example, we take the NPCs name and store it in a string supplied as the first argument.
# This command is compatible with PC, Console, and Android.

plotscript, rename npc, string for name, begin
  if (running on desktop) then (
    # If the game is running on PC
    input string (string for name)
  ) else (                         
    # If the game is running on Console/Android
    input string with virtual keyboard (string for name)
  )
end

Done! Run the script with the string you want to use for the NPC's name (ex: "rename npc (20)"), then use it in textboxes with "${S#}" where "#" is the argument you supplied for the script. (ex: "Hello, my name is ${S20}!")

See Also[edit]