Orvid/Champollion

Skyrim event functions, named events, instead of function. Causing Papyrus Compiler to not compile it.

Michael-wigontherun opened this issue · 1 comments

What this decompiles FISSFactory into:


;-- Functions ---------------------------------------

FISSInterface Function getFISS() Global
  Return Game.GetFormFromFile(4804, "fiss.esp") as FISSInterface
EndFunction

; Skipped compiler generated GetState

Event onEndState()
{ Event received when this state is switched away from }
  ; Empty function
EndEvent

; Skipped compiler generated GotoState

Event onBeginState()
{ Event received when this state is switched to }
  ; Empty function
EndEvent

What the original Champollion decompiles into:

scriptName fissfactory

;-- Properties --------------------------------------

;-- Variables ---------------------------------------

;-- Functions ---------------------------------------

FISSInterface function getFISS() global

	return game.GetFormFromFile(2048, "FISS.esp") as FISSInterface
endFunction

; Skipped compiler generated GotoState

function onBeginState()
{Event received when this state is switched to}

	; Empty function
endFunction

; Skipped compiler generated GetState

function onEndState()
{Event received when this state is switched away from}

	; Empty function
endFunction

The original Champollion decompiles it into its original source code, minus comments. the capitalization isn't a problem.
I have a long command line for Papyrus Compiler because its automated in ESLify Everything.

C:\Steam\steamapps\common\Skyrim Special Edition\Papyrus Compiler>PapyrusCompiler.exe "C:\Modding\SkyrimSE\ESLifyEveryth
ing\ESLifyEverything\bin\Personal\net6.0\ChangedScripts" -q -f="TESV_Papyrus_Flags.flg" -a -i="C:\Modding\SkyrimSE\ESLif
yEverything\ESLifyEverything\bin\Personal\net6.0\ExtractedBSAModData\Source\Scripts" -o="E:\SkyrimMods\MO2\mods\ESLify E
verything\Scripts"
C:\Modding\SkyrimSE\ESLifyEverything\ESLifyEverything\bin\Personal\net6.0\ExtractedBSAModData\Source\Scripts\fissfactory
.psc(14,0): no viable alternative at input 'EndEvent'
C:\Modding\SkyrimSE\ESLifyEverything\ESLifyEverything\bin\Personal\net6.0\ExtractedBSAModData\Source\Scripts\fissfactory
.psc(21,0): no viable alternative at input 'EndEvent'
No output generated for fissfactory.psc, compilation failed.

Changing "Event" and "EndEvent" to "Function" and "EndFunction" fixes the issue but its necessary in all of the scripts

Skyrim just uses the function identifier instead of Event for events.

I am hoping to switch ESLify Everything to using this instead of the original Champollion.

I can't reproduce the compiler errors you're getting here.

  • The OnBeginState and OnEndState here are compiler generated and are attached to all scripts when compiled. In my testing, it doesn't matter if I label these Function or Event, they will be compiled regardless.
  • However, if it's an Event on the base form (like OnHit on ObjectReference), if I override that in my script and label it Function, it will fail to compile if it's not labelled as an Event.

We may be using different compilers, or there's something about your setup that's causing this. Can you ping me on the Skyrim Mods discord so we can diagnose this further? @nikitalita