Jump to content

Script - equipping item makes specific NPC follow the equipping actor


zelazko

Recommended Posts

begin DuraSlaveBracerScript


If HasItemEquipped "DuraSlaveBracer" "dura gra-bol"-> AiFollow 0 0 0 0 0


endif
end

I have this attached to item "DuraSlaveBracer". It still won't make Dura to follow NPC which gets the item. I made sure via dialogue result that the NPC gets this item equipped.

Equip, "DuraSlaveBracer"

I can even see NPC equips this item but dura does not want to follow the equipping NPC. Before the script activates dura follows player.

 

When I gave her command in the dialogue result

"dura gra-bol"->AIWander 1000 0 0 60 10 10 10 10 0 0 0

This AI would overtake. If I didn't use above AIWander the she would still continue follow player. I can't use NPC ID as dialogue is Race based to transfer dura follow AI.

 

Never mind I decided to ditch this as this too difficult to me and use on cell change "NPCID"->PositionCell, 0, 400, 0, 0, "CELLID, CELLID"

 

Edited by zelazko
Link to comment
Share on other sites

you could try something like this:

begin DuraSlaveBracerScript

short state
float t1

if ( MenuMode )
	return
endif

if ( t1 < 2 ) ; do the HasItemEquipped test only on a few seconds delay
	set t1 to ( t1 + GetSecondsPassed )
	return
endif
set t1 to 0 ; reset the timer

if ( "dura gra-bol"->HasItemEquipped "DuraSlaveBracer" )
	if ( state == 0 )
		set state to 1
		"dura gra-bol"->AiFollow player 0 0 0 0 0
	endif
	return
endif

if ( state )
	set state to 0
	"dura gra-bol"->AiWander 128 12 7 40 30 20 10 0 0 0 0 0
endif

end

if you want to script you should study Morrowind Scripting For Dummies

Link to comment
Share on other sites

  • Recently Browsing   0 members

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