Jump to content

Need an actor's factions


Recommended Posts

I'm trying to use GetFactions to obtain an actor's list of factions. I'm having trouble with the casting.

 

I'm using an MCM defined hotkey to provide secondary behavior on various object types using GetCurrentCrosshairRef. Mainly to avoid issues with OnCrosshairRefChange event. Tho what I'm trying to do here is a new idea and so don't have any older code to adapt from.

 

This part passes through just fine:

			Ref = Game.GetCurrentCrosshairRef()
			If 	Ref != None
				If 	(Ref.GetBaseObject() as Form).GetType() == 43

I'm having trouble casting the current Ref into the necessary Actor for GetFactions.

Ref.GetBaseObject() as Actor is yielding Error: Cannot call GetFactions() on a None object, aborting function call

Since what I want to do may end up being a long block, I'm sending it to a custom function. i.e.

Function SomeFunction(Actor TheActor)
Faction[] ActorFactions = TheActor.GetFactions(-128,127)
;other stuff
EndFunction

Any suggestions on the proper casting?

Link to comment
Share on other sites

  • Recently Browsing   0 members

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