Jump to content

Recommended Posts

Posted (edited)

I know that in the OnActivate block you can use getActionRef to determine who activated the effect, but how do i figure out who equipped an object? i want to keep npc's from activating my scripts in my spelltome mod.

scn SpellTome0001

short HasReadOnce

begin onActivate 
activate
if getActionRef == player
if HasReadOnce == 0
	message "Knowledge Gained"
	startquest QSpellTome0001
	set HasReadOnce to 1
       endif
endIf
end

begin onEquip  ;'[edit] i tried begin onEquip player and it compiles but it doesnt work in game'
;if getActionRef == player<--------need a working code equivalent here preferably non-OBSE
if HasReadOnce == 0
	message "Knowledge Gained"
	startquest QSpellTome0001
	set HasReadOnce to 1
endIf
endif
end

Edited by shadowsyllvet
Posted
If it compiles as "begin onequip player" then it should only run when the player is the equipping ref. To make a check twice is redundant and a waste of processing power.
Posted
begin onEquip player compiles but an in game test has shown that it did not work. I sat in the chorrol mages guild till some npc tripped the book and activated the quest for me
Posted

"GetContainer" should work, because it will return the actor who is carrying the item. It's impossible for anyone to equip an item without carrying it, so it will work for you.

 

But theuseless was right. "Begin OnEquip Player" will make the script only run when the player equips the item. If you use it correctly, it should work perfectly.

Posted
i was using onEquip player and i saved the esp launched the game and tested it. it failed. so i back burner'd it for a while launched the game and miraculously it worked... go figure...
  • Recently Browsing   0 members

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