Papyrus version if IsActor?

Post » Fri Aug 29, 2014 12:11 am

Does this exist? It seems to be a http://www.creationkit.com/IsActor, but not a Papyrus one. I know I could use Magic Effects to test this, most likely, but I'd rather not.

This is my script:

Scriptname testbanditscript extends objectreferenceMessage Property SummonConfirmation Auto {0 is cancel, 1 is confirm}GlobalVariable Property SummonFollowerKey Auto {To choose a follower to summon}GlobalVariable Property AllowAnyNPC Auto{Disabled by default. If true, allow to choose any NPC for summon. For custom follower framework followers.}Faction Property CurrentFollowerFaction Auto {CurrentFollowerFaction}ReferenceAlias Property FollowerToSummon Auto{Empty property to reference the follower to summon}Event OnKeyDown(int keyCode)	If KeyCode == SummonFollowerKey.GetValueInt()		If AllowAnyNPC.GetValueInt() == 0 && (Game.GetCurrentCrosshairRef() as Actor).IsInFaction(CurrentFollowerFaction) 			Int Button = SummonConfirmation.Show()			While SummonConfirmation				If Button == 1					;confirm					FollowerToSummon.Clear()					FollowerToSummon.ForceRefTo(Game.GetCurrentCrosshairRef() as Actor) 				EndIf			EndWhile		ElseIf AllowAnyNPC.GetValueInt() == 1; this is what we're looking at	EndIfEndEvent

You can ignore most everything, and the fact that it clearly wouldn't compile, but the ElseIf is what I want to focus on. Is there a way to check that Game.GetCurrentCrosshairRef IS indeed an actor without using the IsInFaction command, or any other thing that could limit the functionality of the second If? Essentially, I want the second If to do this:

ElseIf AllowAnyNPC.GetValueInt() == 1 && (Game.GetCurrentCrosshairRef() as Actor).IsActor == 1

EDIT: Wow, it's one of those things where I THINK I figure it out right after. Would this work?

ElseIf AllowAnyNPC.GetValueInt() == 1 && (Game.GetCurrentCrosshairRef() as Actor).GetActorBase().Getsix == 1 || (Game.GetCurrentCrosshairRef() as Actor).GetActorBase().Getsix == 0 || (Game.GetCurrentCrosshairRef() as Actor).GetActorBase().Getsix == -1
User avatar
Joey Bel
 
Posts: 3487
Joined: Sun Jan 07, 2007 9:44 am

Post » Thu Aug 28, 2014 5:51 pm

HasKeyword == ActorTypeNPC

Or in case if you search for other actor instances, there's also ActorTypeCreature, ActorTypeAnimal and ActorTypeChild I remember.

User avatar
Emmi Coolahan
 
Posts: 3335
Joined: Wed Jan 24, 2007 9:14 pm

Post » Fri Aug 29, 2014 12:16 am

Oh. Wow. :facepalm: Thanks :smile:.

User avatar
Elisha KIng
 
Posts: 3285
Joined: Sat Aug 18, 2007 12:18 am


Return to V - Skyrim