How do I enter names through strings?

From OHRRPGCE-Wiki
Jump to navigation Jump to search

You can change a hero's name in a plotscript using strings. Here are a few simple examples:

# Change the name of a hero named Vladislaus in CUSTOM to Vlad the Impaler
$0="Vlad the Impaler"
set hero name(0,find hero(hero:Vladislaus))
# Change the name of the leader to Elvis
$5="Elvis"
set hero name(5,find hero(rank in caterpillar(me)))

And here is a more advanced example:

# Prefix "Super" to the name of all four active heroes
variable(hero)
for(hero,0,3), do, begin
  $0="Super "
  get hero name(1,hero)
  0 $= 1
  set hero name(0,hero)
end

Remember that the get hero name and set hero name commands use the position of the hero in the party, not the hero's name or walkabout position.

See Also[edit]