Jump to content

Follower Script


lucasjose501

Recommended Posts

Is there any way of setting up a script to detect if a follower is using some item?

 

Because, I need a Ref to use the command: "ref.GetEquippedObject id"

I could use the references of each follower, but I want to make the script compatible with all followers, including other mods ... any suggestions? Or I have to use variable for each follower and create compatibility patches for other mods?

 

 

Explaining my problem here:

 


My mod, Daughters of Ares, change the armor for a converted, to be compatible with the body of the android, so other NPCs not stay with the body of android too, but if I give my armor to my follower, he will have the android body, then I want to revert the script.
Detail: I do not want to add script in each armor, to avoid bugs and incompatibilities.

http://i.imgur.com/6W95YYPl.jpg

 

 

Link to comment
Share on other sites

Try this:

 

1. Create a new Quest, set Script Processing Delay to 0.1 and tick Start Game Enabled.

 

2. Create a new Script, from the Script Type dropbox select Quest, and use the following code:

scn	DOACheckFollowersScript

short	bCheckFollowers
ref	rActor
ref	rItem

begin MenuMode

	if bCheckFollowers == 0
		set bCheckFollowers to 1
	endif

end

begin GameMode

	if bCheckFollowers
		set bCheckFollowers to 0
		set rActor to GetFirstRef 200 2 0
		Label 1
		if IsFormValid rActor
			if rActor.GetPlayerTeammate
				set rItem to rActor.GetEquippedObject ID
				if rItem == [Some item 1]
					[Do stuff]
				elseif rItem == [Some item 2]
					[Do stuff]
				elseif rItem == [Some item 3]
					[Do stuff]
				endif
			endif
			set rActor to GetNextRef
			GoTo 1
		endif
	endif

end

Every time you exit dialogue/container/companion-wheel menu, this will scan for nearby actors. When it finds an actor who is a follower, it will check which item is equipped in slot ID of that follower and do stuff.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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