Jump to content

[script] Print out Actor Name?


h4n4

Recommended Posts

Hey. I wanan print out the actors name (or targets name or what ever) but i cant find out how? can someone post a quick example?

 

i have a small script ( asumed the syntax from my prior work with jscript...) that give me "akTarget is [" and "akCaster is [" i asume these are arrays or something?^^

Event OnEffectStart(Actor akTarget, Actor akCaster)
 
  Debug.Notification("akTarget is "+akTarget)
  Debug.Notification("akCaster is "+akCaster)
 
EndEvent

is there something like akTarget.Name? i looked in http://www.creationkit.com/Actor_Script but no luck

 

edit: ".getName" is SKSE only? isnt there a vanilla thing?

Edited by h4n4
Link to comment
Share on other sites

ActorRef.GetActorBase().GetName(), it requires SKSE.

thx. No nonSKSE solution? :/ i dont need it that badly and i would not want to add an SKSE requirement to my mod just for that^^

Edited by h4n4
Link to comment
Share on other sites

I haven't tried it yet but I think without SKSE, I guess you can use message+text replacement+quest alias to print the name, probably not worth it to create a quest for it since you dont need it that badly.

Link to comment
Share on other sites

I haven't tried it yet but I think without SKSE, I guess you can use message+text replacement+quest alias to print the name, probably not worth it to create a quest for it since you dont need it that badly.

no not going to happen i think^^

Link to comment
Share on other sites

You don't need to make an SKSE requirement. The following will work to determine if SKSE is present and use the name otherwise it will fall back and use the ID #

Int SKSEVersion = 0
Event OnEffectStart(Actor akTarget, Actor akCaster)
  SKSEVersion = SKSE.GetVersion() ;this line will cause a harmless error in the papyrus log if SKSE not present
  If SKSEVersion > 0
    ;SKSE is present
    Debug.Notification("akTarget is "+akTarget.GetActorBase().GetName())
    Debug.Notification("akCaster is "+akCaster.GetActorBase().GetName())
  Else
    ;SKSE not present
    Debug.Notification("akTarget is "+akTarget)
    Debug.Notification("akCaster is "+akCaster)
  EndIf
EndEvent
Link to comment
Share on other sites

  • Recently Browsing   0 members

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