Jump to content

Help on starting Papyrus Scripting


Aderon2000

Recommended Posts

Hello, this is my first try on writing script with Papyrus. It seems like I cannot compile any script, even the simple one. I follow CIPSCIS tutorial with a very simple script:
ScriptName MyFirstScript extends Quest
Event OnInit()
Debug.Notification("Hello, World!")
EndEvent
I followed the instruction exactly, but the compile failed (I compiled with Notepad++ and also CreationKit but all failed). The errors are follow:
Starting 1 compile threads for 1 files...
Compiling "MyFirstScript"...
C:\Games\Skyrim\steamapps\common\skyrim\Data\Scripts\Source\Quest.psc(3,0): missing SCRIPTNAME at 'Quest'
C:\Games\Skyrim\steamapps\common\skyrim\Data\Scripts\Source\Quest.psc(3,6): required (...)+ loop did not match anything at input 'Function'
C:\Games\Skyrim\steamapps\common\skyrim\Data\Scripts\Source\MyFirstScript.psc(5,1): variable Debug is undefined
C:\Games\Skyrim\steamapps\common\skyrim\Data\Scripts\Source\MyFirstScript.psc(5,7): none is not a known user-defined type
No output generated for MyFirstScript.psc, compilation failed.
Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on MyFirstScript.psc
I tried to compile even the basic script file, for example "Quest.psc", "Actor.psc", and all failed because of similar problems. I reinstalled the Creation Kit and still the same. Did I do anything wrong? Is there anything I need to set? Thanks for help.
Link to comment
Share on other sites

Do you have a "Scripts" archive or something like it inside your Data folder? If you have, you need to unpack it, as you need the source files (.psc) for compiling scripts. So that you have

 

...Skyrim\Data\Scripts\Source\

 

Folder with all the .psc files (like Quest.psc and Actor.psc) inside it. I think DLC scripts have their own subfolders inside the Source folder, so keep them in the subfolders. Hopefully that helps a little. :smile:

 

Edit: Also, if you ever end up using SKSE for scripting, you need to ovewrite the source files that came with CK with the ones from SKSE. If you use Mod Organizer, things become a lot easier. But I will not write a guide here now on how to do it, as the way I do it requires Sublime text with Sublime Papyrus and MO combined. You can figure out how to do it yourself, at least it provided a fine learning (a.k.a :wallbash: ) experience for me. :tongue:

Edited by PhilippePetain
Link to comment
Share on other sites

Thanks for quick reply, PhilippePetain.


Yes, I have SKSE installed, and I have all the source files (...Data\Scripts\Source). I moved the SKSE modified sources to the data folder. It seems like the base source files are incomplete for some reasons. For example, I looked into Quest.psc, this is what I got - there is no "SCRIPTNAME" defining "Quest" in line 3, which obviously the compiler does not like. Am I missing something? Thanks.




; returns the quest with the specified editor id
Quest Function GetQuest(string editorId) global native

; returns the editor ID of the quest
string Function GetID() native

; returns the priority of the quest
int Function GetPriority() native

; returns the number of aliases associated with the quest
int Function GetNumAliases() native

; returns the specified alias associated with the queest
Alias Function GetNthAlias(int index) native

; returns the alias associated with the quest by name
Alias Function GetAliasByName(string name) native

Link to comment
Share on other sites

I think what PhillipePetain mean is that there should be an archive file in your Data folder called "Scripts.rar" that contains a bunch of missing updated scripts that is needed to be extracted into your Skyrim Scripts folder. The archive was left unextracted for some reason when they last updated the CK. Check it out and let us know what happens. :)

Link to comment
Share on other sites

The way I understood it, Aderon has all the source files in the right place. But I could be wrong. What Kuno said is true, caught me by surprise, too, the first time.

 

But whatever you do, do not touch the 'fundamental' sort of source files! These are things like Actor.psc, Quest.psc and such. No need to touch them, it will only cause issues. Just a tip.

 

One thing that comes to mind is script naming. Which could be connected to some SCRIPTNAME errors. Maybe?

 

If you have a script declared like

  • ScriptName MyFirstScript Extends Quest

you will need to have the source file saved with the same name

  • MyFirstScript.psc

and then the compiled script will also be named the same (happens automatically)

  • MyFirstScript.pex

So in case you do not have the names same, it will refuse to compile. I think. Been a while since I tried to compile a script with a different source file name and scriptname.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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