Jump to content

[LE] Help! How to automatically add spell to player


Cristobot

Recommended Posts

I've seen this done with Relationship Dialogue Overhaul, Amazing Follower Tweaks, Better Vampires, and many others...

 

I want to have a spell added to the player's spell list when the mod loads. (I think I need a quest? But I'm not quite sure how to do this.)

 

I have the Magic Effect and Spell created, but how can I automatically add it to the Player inventory?

 

If there is a reference on this somewhere please point me to it.

 

Thanks in advance!

Link to comment
Share on other sites

https://www.creationkit.com/index.php?title=OnPlayerLoadGame_-_Actor

https://www.creationkit.com/index.php?title=OnInit

https://www.creationkit.com/index.php?title=AddSpell_-_Actor

 

* I don't know how the mods you mentioned work, i've never looked at them and some i don't know them.

 

Merry christmas.

Link to comment
Share on other sites

How I do it, is put a script on a new quest that's start game enabled.

 

Scriptname MyInitScript extends Quest 

Actor Property PlayerRef Auto 
Spell Property MySpell Auto

Event OnInit()
    Utility.Wait(1)
    PlayerRef.AddSpell(MySpell)
    Utility.Wait(1)
    self.Stop() ;stops this quest
    
EndEvent

Name the script something more unique. Happy Modding!

Link to comment
Share on other sites

 

How I do it, is put a script on a new quest that's start game enabled.

 

Scriptname MyInitScript extends Quest 

Actor Property PlayerRef Auto 
Spell Property MySpell Auto

Event OnInit()
    Utility.Wait(1)
    PlayerRef.AddSpell(MySpell)
    Utility.Wait(1)
    self.Stop() ;stops this quest
    
EndEvent

Name the script something more unique. Happy Modding!

 

 

I did as instructed and this worked in running on loading my mod! However, it didn't add my spell?

Is anything wrong with this?

 

Scriptname crbtAddEditNPCSpell extends Quest  
{Automatically adds spell on mod load}
 
Actor Property PlayerRef Auto 
Spell Property crbtEditNPCInfo Auto
 
Event OnInit()
    Utility.Wait(1)
    PlayerRef.AddSpell(crbtEditNPCInfo)
    Utility.Wait(1)
    self.Stop() ; stops this quest
    
debug.messageBox("Added Edit NPC Info to Illusion list")
EndEvent
Link to comment
Share on other sites

  • Recently Browsing   0 members

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