Jump to content

Recommended Posts

Posted

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!

Posted

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!

Posted
  On 12/23/2020 at 5:29 PM, dylbill said:

 

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
Posted

Make sure you filled your properties. After attaching the script, click on properties and Auto Fill All, if your properties are named the same in the script as in the creation kit, they should be automatically filled.

  • Recently Browsing   0 members

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