Jump to content

[LE] Scripting: GetUniqueActor


Deathfouton

Recommended Posts

I'm currently working on a script that will be attached to the player, which involves giving something to your follower. It needs to be able to read the followers inventory. The current code I've been trying to use has been something around the lines of

ScriptName testscript extends ObjectReference

Actor Property PlayerREF Auto
Faction Property PotentialFollowerFaction Auto
Int overflow = 0

Event OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer)
	If akDestContainer.GetActorOwner()
		If akDestContainer.GetActorOwner().IsUnique()
A			If akDestContainer.GetActorOwner().GetUniqueActor().GetFactionRank(PotentialFollowerFaction)
B				If akDestContainer.GetActorOwner().GetUniqueActor().GetFactionRank(PotentialFollowerFaction) >= 0
					Debug.MessageBox("Yippee!")
				EndIf
			EndIf
		EndIf
	EndIf
EndEvent

I'm getting "GetUniqueActor is not a function or does not exist" on both lines A & B, but it is a function listed in the CK wiki and is used off ActorBase like the way I'm currently using it.

I'd love any help I can get. I'm very new to CK and scripting with CK, knowing different possible options, etc. If there's an easier form of this (I don't want to have to manually attach this to each follower, because then any mod followers don't work either, and compatibility is greatly restricted)

Link to comment
Share on other sites

You are looking at the Fallout 4 wiki. It has newer functions that do not exist in Skyrim. GetUniqueActor() is one such function.

 

Here is the Skyrim scripting reference: http://www.creationkit.com/index.php?title=Category:Papyrus

 

If you look at the URL on any CK wiki page and it has Fallout4 within it, then it is specific to Fallout 4. If the URL does not have Fallout4, then it is currently for Skyrim (this may or may not change as Bethesda creates more games that use the Creation Kit).

Link to comment
Share on other sites

I can't follow the original code. Is akdestcontainer the follower themself or a container owned by the follower? If it is the follower themself then there is no need to go through those extra steps. (akDestContainer as actor).getFactionRank() will give you the same result.
Link to comment
Share on other sites

  • Recently Browsing   0 members

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