Jump to content

SKSE Scripting Help


AI74

Recommended Posts

I'm trying to create a small immersion mod which would prevent opening the Journal menu in Skyrim unless you have a book named 'Journal' in your inventory. I was also wondering how hard it would be to implement the player requiring to have charcoal or ink in their inventory, which would be consumed after a certain number of times the journal was opened; or to make whether the journal is openable decided by light levels in the area (I imagine these would be much more complicated, esp. the second). However, I don't have any scripting experience at all with Skyrim or SKSE, so I was hoping for some help as to which functions etc I should use and how.

 

 

This is the script I have so far

Event OnInit()
    RegisterForMenu("Journal Menu")
EndEvent


Event OnMenuOpen(String MenuName)
    If MenuName == "Journal Menu"
        If (Game.GetPlayer().GetItemCount(LyrJournalItem) == 1)


        If (Game.GetPlayer().GetItemCount(LyrJournalItem) == 0)    
            
 

I don't know what to put after each GetItemCount line; the first one to end the script and allow Journal access and after the second to block it. Any advice?

Edited by AI74
Link to comment
Share on other sites

What you proposed won't work nicely, because it won't let you see the settings tab if you don't have the book.

 

You should just be able to use http://www.creationkit.com/DisablePlayerControls_-_Game

event onPlayerLoadGame()
    bool hasBook = Game.GetPlayer().GetItemCount(LyrJournalItem) as bool ;this should work, i haven't tested it..
    Game.DisablePlayerControls(abJournalTabs = !hasBook) ;Something like this
endEvent
Edited by Mardoxx
Link to comment
Share on other sites

  • Recently Browsing   0 members

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