Jump to content

[LE] Power Won't add to Player onRead()


Recommended Posts

Hey all,

 

I created a Power by using the base for the Wood Elf ability that calls animals to help you, then added in an extra ability to it to protect you from 50% of fire damage for 3 minutes. The problem, of course, is that it will not teach me the power when I read the book. Here's what I'm dealing with.

 

Scriptname RedEagleBlessingAddScript extends ActiveMagicEffect
Actor Property PlayerRef Auto
Spell Property VoiceofRedEagle Auto
Event OnRead()
Game.GetPlayer().AddSpell(VoiceofRedEagle)
EndEvent
Then for actor property I select PlayerRef and for Spell property I select the spell/power I listed above. Any help?
Link to comment
Share on other sites

If you are going to have an Actor property pointing to the player, use it. Either change it to use PlayerRef instead of Game.GetPlayer() or drop the Actor property all together. But that will not solve your problem.

 

Make sure you are testing on a new game or one where the book that you've modified has not been loaded.

 

You may also wish to try the OnEquip event instead of OnRead. Especially if the book is already within the player inventory.

Link to comment
Share on other sites

Your problem is that you are extending an ActiveMagicEffect script, which doesn't have the OnRead() event. Papyrus therefore thinks you're creating a custom event, but no game system will ever call it, so your code doesn't get executed. If this script is on the books themselves, it should extend ObjectReference instead of ActiveMagicEffect. If it's on an alias pointing to a specific book, it should extend ReferenceAlias.

Link to comment
Share on other sites

If you are going to have an Actor property pointing to the player, use it. Either change it to use PlayerRef instead of Game.GetPlayer() or drop the Actor property all together. But that will not solve your problem.

 

Make sure you are testing on a new game or one where the book that you've modified has not been loaded.

 

You may also wish to try the OnEquip event instead of OnRead. Especially if the book is already within the player inventory.

Ah thank you. See I'm pretty new obviously so details like this get way missed. I just ended up having the note in the inventory say what I wanted it to say and then made the Power be acquirable via a spell tome in the same inventory and that worked fine.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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