Jump to content

NPC Gender


FlashyJoer

Recommended Posts

Is anyone aware of why spawned settler NPCs that are visibly female have a getsex() value of 0 (man), instead of 1 (woman)? All of the NPC Actors in the CK clearly show the Female checkbox as ticked (default Actors) but their value shows as male in game... yet named NPCs with the checked Female flag do return a 1 value for GetSex()... stumped.

 

Thoughts or exact knowledge you can share?

Link to comment
Share on other sites

So that doesnt work... tried instead to obtain closest with a Ref Alias, as shown in the screenshot with the following code, where RSE_PartInCrime is a global var in my MCM to determine the preferred gender for companion. But of course, it always returns Target Gender Not Found, even though I am standing NEXT to a female NPC... unless I am near a named NPC like Piper and then it reports female found. Im stumped... am I doing something wrong, is there a reason the gender is not working on basic npcs? Id appreciate the input... pulling hair out and starting to look like Homer S now... :tongue:

 

ReferenceAlias Property ClosestREF auto <--- screenshot shows how ref is set.

 

Actor Closest = ClosestREF.GetReference() as Actor

Int GenderChk = Closest.GetActorBase().GetSex()

If GenderChk == RSE_PartInCrime.getvalueint()

Debug.Notification("NPC is female")

Else

Debug.Notification("Target Gender not found")

Endif

 

Furthermore, if I take out my test code above and try this instead:

 

Actor Closest = ClosestREF.GetReference() as Actor

Debug.Notification("Name of Target :"+ClosestREF.GetLeveledActorBase().GetName())

 

The result is always empty - just the 'Name of Target:" shows...

Edited by joerqc
Link to comment
Share on other sites

I found the problem and Ill be happy to share. :smile:

 

I found the if I use GetActorBase() on spawned NPCs, ie: generated from a level list, I get empty results. BUT, if I use GetLeveledActorBase().GetSex() or .GetName(), I actually get the real result. :smile: The only one that doesnt work on leveled actors is race, cuz according to the wiki, race is not used on level list spawns. At least not in a way we can query in papyrus...

Edited by joerqc
Link to comment
Share on other sites

  • 1 month later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...