For what is dsb_set_charname?

This forum is for the Lua scriptable clone of DM/CSB called Dungeon Strikes Back by Sophia. Use DSB to build your own highly customised games.

Moderator: Sophia

Forum rules
Please read the Forum rules and policies before posting.
Post Reply
User avatar
Qwerty
Apprentice
Posts: 55
Joined: Sun Aug 30, 2009 6:21 am

For what is dsb_set_charname?

Post by Qwerty »

Sophia wrote:Added dsb_set_charname(char, text) and dsb_set_chartitle(char, text) for dynamically changing character names
I know that function of dsb_get_charname is to get Character's name, but I don't know what are these functions and How to handle its?
Could you tell me some explanation or example?
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: For what is dsb_set_charname?

Post by Sophia »

It sets the character's name.
For example dsb_set_charname(char, "MOPHUS") will change the name of whatever character to "MOPHUS".

This will retroactively fix the naming bug in DSB 0.47 and before. ;)

Code: Select all

for ppos=0,3 do
   local char = dsb_ppos_char(ppos)
   if (char) then
      if (dsb_get_charname(char) == "HISSSS") then
         dsb_set_charname(char, "HISSSSA")
      end
   end
end
User avatar
Qwerty
Apprentice
Posts: 55
Joined: Sun Aug 30, 2009 6:21 am

Re: For what is dsb_set_charname?

Post by Qwerty »

Ah, I understand!
Thank you for explanation.
Post Reply