Jump to content

Need help with spell tome script please


Recommended Posts

I am making spell tomes for a new mod much like how Skyrim works, and the best way I can think to do this is through a simple script. I applied and tested it but there is a problem - as a worldspace placement it works fine, the player activates the book and it adds the spell then disables, but when activated in the inventory (after buying or looting) it just opens as if it's being read and the script doesn't work.

Can someone tell me what commands I need to add for both instances to work? I'm very much a noob with scripting and not sure exactly how to structure it, I thought maybe 'MenuMode' would be in there as an elseif but I might be wrong.

This is an example of what I have

Scriptname I5KSpellTomeScriptAbsorbAttribAgility1Novice


Begin OnActivate

	Player.AddSpell StandardAbsorbAttribAgility1Novice
	disable

End 

EDIT: I changed the script a bit so that it can be read while adding the spell, then disables when the player exits the menu. Still only works when the book is placed as a world object though.

Scriptname I5KSpellTomeScriptAbsorbAttribAgility1Novice

Begin OnActivate
	if isActionRef player == 1
		Player.AddSpell StandardAbsorbAttribAgility1Novice
	endif
	Activate
	disable
End

EDIT 2: Ugh! I even found a good example of someone who did the same thing, I adopted it and tried it and it still won't run when used through the inventory screen:

Scriptname I5KSpellTomeScriptAbsorbAttribAgility1Novice

short doOnce

begin onactivate
	if doOnce == 0
		Activate
		playsound SPLMysticismCast
		player.addspell StandardAbsorbAttribAgility1Novice
		set doOnce to 1
	endif
end

:wallbash:

Edited by Ironman5000
Link to comment
Share on other sites

  • 5 months later...
  • Recently Browsing   0 members

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