Jump to content

issue with F4se GetName to acquire actor name


DJD2010

Recommended Posts

Hi.

 

I'm trying to acquire the current Combat Target's name, and it's not working.

 

Here's how I wrote the code:

string name
Actor target

target = Game.GetPlayer().GetCombatTarget()
name = target.GetActorBase().GetName()
Debug.Notification("Actor name is: "+name)

Every time the message appears, it just says "Actor name is: " and that's it.

 

I don't really care of what exactly is the actor's name, I just want it to be assigned because I want to know the length of it. Some other part of the code changes depending on the length of the actor's name.

 

Can someone help please?

Link to comment
Share on other sites

Try putting "as string" at the end of "name = target.GetActorBase().GetName()"

The GetName() function already returns a String, but yeah I did try that and it didnât work.

 

Someone on Reddit pointed out that the GetName() function probably doesnât like or canât deal with leveled actors, in this case something like a âFeral Ghoulâ is a leveled actor.

 

The thing is, I have no idea how to acquire a leveled actorâs name dynamically and store it in a string variable.

Is there no syntax of any sort that would allow me to do that?

Link to comment
Share on other sites

>Someone on Reddit  :huh:Â

lol hey man. xD

 

Now this issue is really getting to me. Iâll try to see if there are any workarounds that donât invlonve papyrus, but if there arenât any... I honestly donât know what I should do about this. :/

Link to comment
Share on other sites

So yeah... tried to do some workarounds that dont require papyrus.. that didnt work.. :|

 

If anyone has any ideas on how to acquire a leveled actorâs name, Iâd be grateful to know how.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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