Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
Joined: Sep 2017
T
apprentice
OP Offline
apprentice
T
Joined: Sep 2017
As title: Is this possible? I'm trying to generate a random name from a list of names in a script, and then change my character's name to that. But I store the chosen string in a variable, how do I use that variable in the story script?

Joined: Jun 2013
old hand
Offline
old hand
Joined: Jun 2013
One of the GetVarString or GetVarFixedString queries will probably do it.

You'd still need an event of some sort though because I don't think Osiris can react on a VarString being set. So just add in a globalflag or an object flag.


But Can you actually rename characters via story script? It wouldn't surprise me if you could I've just never tried.

Is there some particular reason you did the randomization in charscript? I think you'd be better off doing all of it in Osiris if you can. You can easily add the random names to a database, each with a number. Run a Random query to find the number to match the DB entries.

Joined: Sep 2017
T
apprentice
OP Offline
apprentice
T
Joined: Sep 2017
So I got it working! Kinda...

The script generates a random name, and I can pass it to my Story script via GetVarString.

I'm doing it as follows:
Code
IF
RegionStarted("LevelName")
AND
GetVarString(CHARACTERGUID, "Name", _Name)
THEN
CharacterSetCustomName(CHARACTERGUID, _Name)


Problem is? it only works once. If I try to reload my mod it instantly crashes the editor and I can never load my mod again.

But...why? Can anyone explain why this is?

Last edited by Toomuchbob; 03/10/17 03:36 AM.

Moderated by  Larian_KVN 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.5