Jump to content

Recommended Posts

Posted

Hi all, I'm attempting to run a single SKSE command from a Papyrus script (activated by the player by clicking on an object). Unfortunately, I'm running into a bit of difficulty!

 

First, I went through Bethesda's "Papyrus Hello World" tutorial located here, and everything worked as expected. Player clicks on the monolith, and gets a "Hello World" message. Original script looks like this:

Scriptname HelloWorldScript extends ObjectReference  

Event OnActivate(ObjectReference akActionRef)
Debug.MessageBox("Hello, World!")
endEvent

 

So far so good. Next I substitute the SKSE command into my code, like this:

Scriptname HelloWorldScript extends ObjectReference  

Event OnActivate(ObjectReference akActionRef)
skse.OpenMenu("Inventory Menu")
endEvent

 

At this point my Papyrus script will no longer compile, and I get this compiler error:

  Quote
f:\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\HelloWorldScript.psc(4,1): variable skse is undefined

 

So, how do I get my script to see SKSE and access its commands? Do I need a "#include" equivalent or something similar? Or is it something else entirely?

Posted

I am also interested in the answer to this.

 

I was hoping the make use of the "GetArmorValue" function included in SKSE, but couldn't find any way to call it, despite it being properly installed in .../Data/Scripts/Source (technically, the function is in Armor.psc). It's amazing that there is literally no documentation on SKSE out there for mod makers.

Posted

I'd be interested in this also. I tried my hand with Papyrus first time and didn't find (or notice) anything about scope or namaspaces in the documentation. I was able to do what I wanted, but had to settle with a naive solution. If anyone knows of "programmers intro" into Papyrus, I'd be more than happy.

 

To OP, I don't know if either of these would be helpful, they seem to deal with 'import':

http://www.creationkit.com/Script_File_Structure

http://www.cipscis.com/skyrim/tutorials/externalaccess.aspx

Posted

Thanks for the responses so far. I checked out those links and the 'Import' command. Although initially it sounds promising, when I add "Import SKSE" to my script, I get the same error about skse being undefined. Turns out that 'Import' simply let's you leave off prefixes to make your code more readable. I should probably mention that I too have SKSE installed correctly and working with other mods.

 

My next thought was to look inside another mod that uses SKSE commands. I opened up Economics of Skyrim as it uses SKSE, is composed entirely of scripts, and all the source files are included. Inside what appears to be the initialization file "aaTKInitialization.psc", there is indeed an "Import SKSE", but I can't find anything in *any* of the scripts that appears to set up scope or namespace for SKSE.

 

The only other file in that mod is the ESP file. That leads me to believe that the reference is probably stored somewhere inside the ESP.

 

I know whatever I'm missing here is likely something extremely quick and straight forward. Can some kind soul please end the misery here and enlighten us? How do we make a simple skse call from Papyrus?

Posted
One does not need to import SKSE nor use SKSE.*****(). Copy the files in /data/scripts from the skse archive to skyrim/data/scripts. Skyrim likes to 'update' those files sometimes.
Posted

Many thanks J3X! I recopied the files, and I am now up and running with SKSE commands, specifically trying a number of those listed in "skse_papyrus_docs.txt". Success!

 

Quick side question though. What I really want to do is to open a UI menu via a script command.

 

Based on the list of commands inside SKSE documentation, there is only one single UI command: IsMenuOpen()

However, when I decompile SkyUI (using Shockwave decompiler) and take a look at the Papyrus scripts imbedded within, I see what looks like exactly the command I need, and it appears to be a SKSE command:

skse.OpenMenu("Inventory Menu");

It certainly does not compile in my script, and I get compiler error:

  Quote
OpenMenu is not a function or does not exist

Is OpenMenu really an SKSE command? If so, why it is not listed inside the SKSE docs? More importantly, how do I call it?

  • 2 years later...
Posted

I'm not sure if this topic is still active but it might be worth checking the Game.psc. I believe that is where most of the OpenMenu type functions exist.

  • Recently Browsing   0 members

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