Jump to content

Need help compiling a simple script


Recommended Posts

Posted (edited)

I just want to make a small script to add an MCM image to Fill Her Up. I have unpacked all source scripts and SkyUI scripts starting with SKI to Skyrim Special Edition\Data\Source\Scripts. After a long chat session with ChatGPT, using both the CK(the compiler just crashes), and Papyrus Compiler App I'm still getting the same errors:

 

D:\SteamLibrary\steamapps\common\Skyrim Special Edition\Data\Scripts\Source\SKI_ConfigManager.psc(61,1): RegisterForModEvent is not a function or does not exist
 

Here is the script:

Scriptname sr_FHU_MCMImage extends SKI_ConfigBase

Event OnPageReset(String a_page)
    if a_page == "Main"
        LoadCustomContent("Fill Her Up/FHUMain.dds", 226, -2)
    else
        UnloadCustomContent()
    endif
EndEvent

 

If you can't say what's wrong but can compile yourself I would appreciate it if you can upload a compiled version, because this is painful. I'm planning on releasing a mod with new MCM art(only quality AI art) for most SexLab mods, and will use this for other mods if I can.

Edited by Omnishade
Posted (edited)
54 minutes ago, chaimhewast said:

You're missing the SKSE version of the source files, which is what adds the ability to register for mod events.

 

You mean the source scripts that you should install when installing SKSE? I've added those to Skyrim Special Edition\Data\source\scripts.

I've also downloaded and added SKI scripts from github.

 

Spoiler

Untitled-1.jpg

 

Edited by Omnishade
Posted

If you look in your Form.psc source file, you will see that RegisterForModEvent is missing.  It's part of the SKSE package.

 

On LE, this is what I see:

; Registers a custom event callback for given event name.
; Registrations have to be refreshed after each game load.
;
;	Examples:
;		RegisterForModEvent("myCustomEvent", "MyModEventCallback")
;
;	Event signature of custom event callbacks:
;		Event MyModEventCallback(string eventName, string strArg, float numArg, Form sender)
;		endEvent
;
Function RegisterForModEvent(string eventName, string callbackName) native
Function UnregisterForModEvent(string eventName) native
Function UnregisterForAllModEvents() native

 

On SE, your will be different...

 

You need to review your SKSE installation and install its version of the base source files.

Posted (edited)

You also need to make sure your compiler is including all the folders with the source scripts if they are in a non-traditional location, such as individual mod organizer folders.

 

Also, with SE there can be a mix-up between putting the source scripts in data/source/ and data/scripts/source/, I usually just put the SKI and SKSE source scripts in both to cover my bases.

Edited by Ashal

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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