Help with Grasping Papyrus

Post » Sun Jun 17, 2012 8:45 pm

Allright, so I need a little bit of help here. I'm no "stranger" to the basic ideas behind scripting, but 99% of scripting I've done before was either visual scripting (which works like the Dialog Editor, in the sense that you never have to worry about syntax) or very simple game scripting.

So, I opened up the wiki with the goal of learning how to dynamically adjust the player walk speed depending on the enviornment the player is in. I've already got a list of the commands I'll need so I then check into how to put them together.

This is where I'm completely lost. It's clear to my Papyrus isn't just your basic game script, it's a full blown and fully featured scripting language. I've read over all the tutorials on it but it still really isn't all that much help. I suspect it's either to do with the hour of the day, the fact that I want to do more than display a basic message, or the fact that the wiki doesn't appear to explain the backbone of how scripts outside the tutorial work and their syntax

Basically, I just can't make sense of any of it.

I don't suppose there's any help for someone like me? I understand how a script's logic would flow (checking if things are true and not), but I (in my complete lack of experience with real scripting languages) just can't understand Papyrus's specific syntax structure, or what certain actions mean at all. And that's not even mentioning what the proper structure of a completed script should be in order to be efficient.

Any help? :( Not sure what help there is out there at the moment for this type of thing.
User avatar
quinnnn
 
Posts: 3503
Joined: Sat Mar 03, 2007 1:11 pm

Post » Sun Jun 17, 2012 3:29 pm

Welp this forum sure moves fast :tongue:

Also: http://www.creationkit.com/GetSkyMode_-_Weather

What constitutes as a "Skydome"? Any exterior cell that isn't wilderness (such as cities)?
User avatar
Samantha Wood
 
Posts: 3286
Joined: Sun Oct 15, 2006 5:03 am

Post » Sun Jun 17, 2012 9:05 pm

Looking at (shorter) existing scripts should help you grasp the syntax. Why don't you post some pseudocode here, and perhaps we'll be able to help you translate it into Papyrus.

Cipscis
User avatar
Ross Thomas
 
Posts: 3371
Joined: Sat Jul 21, 2007 12:06 am

Post » Sun Jun 17, 2012 11:38 pm

Well, let's start with the beginning. How would I add a script that just runs as long as the game is running as soon as the mod is loaded? I.E. I don't want to attach it to a specific object except the player (if that's possible) because I want ONLY the walk speed to increase whenever the player is walking, and at certain speeds depending on if the player is indoors or not.
User avatar
Rebecca Clare Smith
 
Posts: 3508
Joined: Fri Aug 04, 2006 4:13 pm

Post » Sun Jun 17, 2012 2:21 pm

Allirght, I know this won't work, but this is my "script" so far.

Scriptname DynamicWalkSpeed extends ObjectReference;checks to see if player is in an interior space, then if they are running or sprinting.if Weather.GetSkyMode() == 1GetPlayer().IsRunning()Game.GetPlayer().ModActorValue("SpeedMult", 1)elseif GetPlayer().IsSprinting()Game.GetPlayer().ModActorValue("SpeedMult", 1)elseGame.GetPlayer().ModActorValue("SpeedMult", 1.75)endIf;checks to see if player is in a town/skydome space, then if they are running or sprinting.if Weather.GetSkyMode() == 2GetPlayer().IsRunning()Game.GetPlayer().ModActorValue("SpeedMult", 1)elseif GetPlayer().IsSprinting()Game.GetPlayer().ModActorValue("SpeedMult", 1)elseGame.GetPlayer().ModActorValue("SpeedMult", 2)endIf;checks to see if player is in in wilderness space, then if they are running or sprinting.if Weather.GetSkyMode() == 2GetPlayer().IsRunning()Game.GetPlayer().ModActorValue("SpeedMult", 1)elseif GetPlayer().IsSprinting()Game.GetPlayer().ModActorValue("SpeedMult", 1)elseGame.GetPlayer().ModActorValue("SpeedMult", 2.5)endIf

But anyways, that's the general idea of what I want to pull off. How do I actually get it to work though?

EDIT: No idea how to format the code BBCode tags to work with the spacing/indents of the actual script file but oh well :tongue:
User avatar
Adriana Lenzo
 
Posts: 3446
Joined: Tue Apr 03, 2007 1:32 am

Post » Sun Jun 17, 2012 6:56 pm

Really? Allready off page one?


It's going to be impossible to learn this scripting language at this rate :( Nobody seems to know a thing about it either except lol.
User avatar
Mandy Muir
 
Posts: 3307
Joined: Wed Jan 24, 2007 4:38 pm

Post » Sun Jun 17, 2012 5:51 pm

Check out this blog, the very first comment translates the complicated wiki into plain english. It will at least show you the long road to follow.

http://www.theengineeringguild.co.uk/index.php?option=com_content&view=article&id=359:skyrim-scripting-language&catid=22:the-blog&Itemid=117
User avatar
sharon
 
Posts: 3449
Joined: Wed Nov 22, 2006 4:59 am

Post » Mon Jun 18, 2012 2:21 am

Thanks for that link, it helps.

And it does appear to be very closely related to Python. I find myself understanding how things work on a syntax level much better after reading some guides on Python:

http://www.swaroopch.com/notes/Python_en:Basics

The guide is extremely long and thurough, but giving it a quick readthrough and making sure you understand what each page is explaining can help understand how Papyrus itself works.
User avatar
Stacey Mason
 
Posts: 3350
Joined: Wed Nov 08, 2006 6:18 am

Post » Mon Jun 18, 2012 1:12 am

Well, let's start with the beginning. How would I add a script that just runs as long as the game is running as soon as the mod is loaded?

As far as this goes, I added a quest with no name so it doesnt show up, selected "Start Game Enabled" and added 1 stage, to which I linked my script and used the Event OnInit(). Now it starts on game load.

Hope this helps.
User avatar
Emmanuel Morales
 
Posts: 3433
Joined: Sat Oct 06, 2007 2:03 pm


Return to V - Skyrim