Jump to content

[LE] Display caster and target in notification - get actor name papyrus


kodaxmax

Recommended Posts

EDIT: worked it out;
function doEffect()
	PickEffect()
	PickSourceTarget()
	
	;have source actor cast spell at targetActor
	currentSpell.Cast(sourceActor, targetActor)

	string sourceActorName = sourceActor.GetBaseObject().GetName()
	string targetActorName = targetActor.GetBaseObject().GetName()

	;notify the player who cast what on who
	debug.notification(sourceActorName + " cast " + currentSpell.GetName() + " at " + targetActorName)
	
	
endfunction
I have a script that forces and npc or the player to cast a spell at another random npc or player. I wish bothe the target and caster to be displayed in a notification.
Eg; "Grelod cast Unrelenting force at Lydia"

 

Currently this displays the spell name perfectly, but returns nothing for the actor/ object names (sourceActor and Target Actor)
function doEffect()
	PickEffect()
	PickSourceTarget()
	
	;have source actor cast spell at targetActor
	currentSpell.Cast(sourceActor, targetActor)

	objectReference casterActorObject = sourceActor
	objectReference targetActorObject = targetActor

	;notify the player who cast what on who
	debug.notification(casterActorObject.getname() + " cast " + currentSpell.GetName() + " at " +  targetActorObject.getName() )
	
	
endfunction

Link to comment
Share on other sites

  • Recently Browsing   0 members

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