Add GetCharacterName() to retrieve an NPC's name as defined in its dialogue script, if it exists. Otherwise it will just return the same output as GetTag().
This commit is contained in:
parent
45c1cc8c08
commit
b28e5cb917
4 changed files with 28 additions and 0 deletions
|
|
@ -814,6 +814,19 @@ DEFINE_ACTION_FUNCTION_NATIVE(AActor, GetTag, GetTag)
|
|||
ACTION_RETURN_STRING(res);
|
||||
}
|
||||
|
||||
static void GetCharacterName(AActor *self, FString *result)
|
||||
{
|
||||
*result = self->GetCharacterName();
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION_NATIVE(AActor, GetCharacterName, GetCharacterName)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(AActor);
|
||||
FString res;
|
||||
GetCharacterName(self, &res);
|
||||
ACTION_RETURN_STRING(res);
|
||||
}
|
||||
|
||||
static void SetTag(AActor *self, const FString &def)
|
||||
{
|
||||
if (def.IsEmpty()) self->Tag = nullptr;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue