zorakramone3050 Posted December 19, 2021 Share Posted December 19, 2021 I did some Oblivion modding years ago, and I've decided to try my hand at Skyrim modding and I think there's something I am fundamentally not getting about papyrus's syntax.This is a quest script. Scriptname vtes_q_main_script extends Quest Potion Property testpotion Auto Game.GetPlayer().AddItem(testpotion) I get the following errors when I compile: Starting 1 compile threads for 1 files... Compiling "vtes_q_main_script"... C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\vtes_q_main_script.psc(5,4): no viable alternative at input '.' No output generated for vtes_q_main_script, compilation failed. Batch compile of 1 files finished. 0 succeeded, 1 failed. Failed on vtes_q_main_script I've checked the creation kit wiki and tried googling the error and I just can't see what I"m doing wrong. Link to comment Share on other sites More sharing options...
ReDragon2013 Posted December 19, 2021 Share Posted December 19, 2021 (edited) Script language Papyrus is using standard events depends on script type, that means events will trigger automatically. You can build your own functions and call that inside such events.Maybe next code is helpful to understand papyrus a bit more. Scriptname vtes_q_main_script extends Quest Potion Property testpotion Auto ; fill this with any potion you like by CreationKit ; -- EVENTs -- EVENT OnInit() myF_Add() ENDEVENT ; -- FUNCTIONs -- ;----------------- FUNCTION myF_Add() ;----------------- Game.GetPlayer().AddItem(testpotion) ENDFUNCTIONKeep in mind: All scripts share the same folder (source for psc-files and scripts for pex-files) within the standard data folder.That means your script name has to be unique enough so that he doesn't clash with other vanilla or mod added scripts. Edited December 19, 2021 by ReDragon2013 Link to comment Share on other sites More sharing options...
zorakramone3050 Posted December 20, 2021 Author Share Posted December 20, 2021 Thanks. This works. I had forgotten about even blocks and the compiler error message didn't help me remember. Link to comment Share on other sites More sharing options...
Recommended Posts