Jump to content

Script issue


Recommended Posts

Simple question I hope: How can I have an OnPlayerLoadGame() script event fire a function that is attached to a base weapon form? Basically the script checks to see if one of several scripted weapons are equipped, and if they are it is supposed to fire a function on that weapon's script. I could make it work if I placed references of said weapons in play and linked the script property to it, but currently I do not have it set up where I could easily do that. Is there some way to call a script function attached to a weapon from an OnPlayerLoadGame() event? Thanks.

Link to comment
Share on other sites

If you're using SKSE you can have the weapon's script register for a custom mod event then have OnPlayerLoadGame send that event. That way the weapon itself can detect if it's the one equipped.

 

A messier but workable solution would be to have the OnPlayerLoadGame event check the equipped weapon type then if it's the right thing force the player to drop it to get a proper reference. With the reference you can then add it back to the player's inventory and re-equip it before calling your function.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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