Radioactivelad Posted May 30, 2017 Posted May 30, 2017 I have some events in my Quest where I want to have some Easter Egg dialogue based on the player's name. Nothing really more than what Codsworth does.But. however it works with Codsworth doesn't actually seem to be visible in the CK, so I can't find any examples of how to do it. For the first instance, I have an Initially Disabled Trigger that the player has to walk through which sets up an alternate Scene with modified dialogue. My goal was to script the Trigger so that when the cell loads, it checks what the player's name is, and either stays disabled or enables, allowing the easter egg to occur. F4SE seems to have a Getname function, but I can't seem to get it to do anything. Any advice?
TheDungeonDweller Posted May 31, 2017 Posted May 31, 2017 (edited) GetName normally doesn't work for Forms that don't have a name in the name column in the CK. The Player character does not have a CK defined name for obvious reasons. In order to use GetName on the player and actors, you need to call it on the base object. PlayerRef.GetBaseObject().GetName()Just tested, this works.You can make it a little performance friendly by calling GetBaseObject() on the PlayerRef property, instead of on Game.GetPlayer(). Whichever you prefer. Edited May 31, 2017 by TheDungeonDweller
g2mXagent Posted October 20, 2018 Posted October 20, 2018 On 5/31/2017 at 3:18 PM, TheDungeonDweller said: GetName normally doesn't work for Forms that don't have a name in the name column in the CK. The Player character does not have a CK defined name for obvious reasons. In order to use GetName on the player and actors, you need to call it on the base object. PlayerRef.GetBaseObject().GetName()Just tested, this works. You can make it a little performance friendly by calling GetBaseObject() on the PlayerRef property, instead of on Game.GetPlayer(). Whichever you prefer. GetName() is F4SE function.
Recommended Posts