I might just be fudging something up here, but my testing of Character:CreateNearPlayer seems to differ from how it was mentioned in the 1.2.1.3 patchnotes where it was added:
I assume I need a Character object (from Character.Create) to call this function from, a Player object (from Game.getLocalPlayer()), and a boolean. But in practice, it seems like the script is expecting an address for a string variable:
My code below, where AVATAR_DBR is a string of a creature dbr.
local player = Game.GetLocalPlayer()
local avatar = Character.Create(AVATAR_DBR)
avatar.CreateNearPlayer(player, true)
Second issue I’m encountering with this script call is that the script interpreter seems to hang from the above position of suggesting alternate overloads; which is to say, my script never succeeds or fails. This results in a near-guaranteed crash (note: may need subsequent script calls to trigger crash? My script runs when Korvaak_03 is killed but there is a second Crate script that runs when his corpse is removed from world, to spawn the exit portal) when exiting to the main menu. See the absence of the successful or failed script calls below:
I have tested the above in both the public
playtest
branch and the spooky-praet
branch of the game to the same results.