DJD2010 Posted August 8, 2019 Share Posted August 8, 2019 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 nameActor 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 More sharing options...
cenarius451 Posted August 8, 2019 Share Posted August 8, 2019 Try putting "as string" at the end of "name = target.GetActorBase().GetName()" Link to comment Share on other sites More sharing options...
DJD2010 Posted August 8, 2019 Author Share Posted August 8, 2019 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 More sharing options...
SKKmods Posted August 8, 2019 Share Posted August 8, 2019 >Someone on Reddit :huh: Link to comment Share on other sites More sharing options...
DJD2010 Posted August 8, 2019 Author Share Posted August 8, 2019 >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 More sharing options...
DJD2010 Posted August 9, 2019 Author Share Posted August 9, 2019 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 More sharing options...
Magicockerel Posted August 9, 2019 Share Posted August 9, 2019 GetDisplayName() is what you're looking for, given that it works with ObjectReferences rather than Forms. I can't remember off the top of my head whether it works with levelled actors, but it might. Link to comment Share on other sites More sharing options...
DJD2010 Posted August 10, 2019 Author Share Posted August 10, 2019 GetDisplayName() is what you're looking for, given that it works with ObjectReferences rather than Forms. I can't remember off the top of my head whether it works with levelled actors, but it might.That worked! Thanks. :) Link to comment Share on other sites More sharing options...
Recommended Posts