How do you get proficient at Scripting?

Post » Tue Jun 19, 2012 11:59 pm

Well, I've completed all the scripting tutorials, and Lokir's Tomb to boot. Read through all of Papyrus Primer, and I'm still quite lost. I now have some basic understanding of how these scripts work, but it's really the equivalent of learning a few words like "hello" and "goodbye" in another language. This might be good enough to order a nombre un from Le Mcdonaldeu, however this isn't quite enough to make some visions of mine come alive. For example, I'd like to make my own rendition of a potion, with no earthly idea of what to even extend this to after the scriptname... Object reference? Form? How do you even figure that out? There are hundreds of references on Creation Kit.com, most of them being quite vague and no help at my current level.

I've done some forum searching before writing this to see if I could find a thread that explained a lot of what I'm trying to do. All I found was trolling and no help at all. So, instead of asking how to do certain things within the script directly. I'd much rather ask how you fine people got proficient in the first place. Exactly how did you get good? I've seen threads with people throwing out huge blocks of script that make my eyes spin. Is there a class you can take or something? That's what I'd probably need.
User avatar
Dina Boudreau
 
Posts: 3410
Joined: Thu Jan 04, 2007 10:59 pm

Post » Wed Jun 20, 2012 12:32 am

Well, I've completed all the scripting tutorials, and Lokir's Tomb to boot. Read through all of Papyrus Primer, and I'm still quite lost. I now have some basic understanding of how these scripts work, but it's really the equivalent of learning a few words like "hello" and "goodbye" in another language. This might be good enough to order a nombre un from Le Mcdonaldeu, however this isn't quite enough to make some visions of mine come alive. For example, I'd like to make my own rendition of a potion, with no earthly idea of what to even extend this to after the scriptname... Object reference? Form? How do you even figure that out? There are hundreds of references on Creation Kit.com, most of them being quite vague and no help at my current level.

I've done some forum searching before writing this to see if I could find a thread that explained a lot of what I'm trying to do. All I found was trolling and no help at all. So, instead of asking how to do certain things within the script directly. I'd much rather ask how you fine people got proficient in the first place. Exactly how did you get good? I've seen threads with people throwing out huge blocks of script that make my eyes spin. Is there a class you can take or something? That's what I'd probably need.

Repetition...

Scripting is just like learning another language, it takes time and you have to repeat the words over and over until it settles in and your able to understand them enough that it becomes easy enough to read and write the correct form of words.

It can take months or even a few years (depends on how much time you invest) especially with Papyrus being a whole new scripting lanuage and more complicated but given time it gets easier but its never really simple.

Hope this helps.

:biggrin:
User avatar
bimsy
 
Posts: 3541
Joined: Wed Oct 11, 2006 3:04 pm

Post » Wed Jun 20, 2012 7:54 am

By the way. There IS a class to take. http://tesalliance.org/forums/index.php?/forum/81-the-enclave/ runs modding classes, actually, and scripting seems to be on the schedule. Check it out. :)
User avatar
Cat
 
Posts: 3451
Joined: Mon Dec 18, 2006 5:10 am

Post » Wed Jun 20, 2012 10:49 am

Programming is a special way of thinking...if you think of it as writing instructions for a very stupid (but fast) lackey named "Igor" who does ONLY what you tell him, very fast, and needs to be told exactly how to do almost everything, you'll get the idea.

Fortunately, there are a good number of specific and useful tasks that the developers at Bethesda have already taught Igor how to do for you :) .
User avatar
Destinyscharm
 
Posts: 3404
Joined: Sun Jul 23, 2006 6:06 pm

Post » Wed Jun 20, 2012 4:10 am

Study pre-existing scripts made by Beth, I'd say. Beyond that, it's just trial and error. Check out Cipscis' tutorials also as they're very informative.


Also, Indent your scripts. Few things can make even an orderly script utterly incoherent like lack of indentation. It helps a lot when trying to keep track of what's going on and makes it a lot easier to catch structural errors (hiding/missing 'EndIf').
User avatar
FITTAS
 
Posts: 3381
Joined: Sat Jan 13, 2007 4:53 pm

Post » Wed Jun 20, 2012 8:26 am

One last thing. You must enjoy it. At least at the beggining. So, start with little changes that you find funny. Just crazy little things. The idea is to had fun at the beggining, to make your learning (by practice) more easy.
User avatar
Justin Bywater
 
Posts: 3264
Joined: Tue Sep 11, 2007 10:44 pm

Post » Wed Jun 20, 2012 10:32 am

I learn by reading forum threads. Someone asks for help, someone else comes along and answers. If they explain how the code they posted works, great. If not, well I know what it's supposed to do so I can figure out how it works given enough time.

I think it's actually a lot easier than learning a new language. You just have to learn proper grammar (ie event & function calls, properties, casting) and you're set. After that, you just look through the dictionary (ie the wiki page listing all the functions) for what you need for whatever you're scripting.
User avatar
sophie
 
Posts: 3482
Joined: Fri Apr 20, 2007 7:31 pm

Post » Tue Jun 19, 2012 11:25 pm

I agree with JustinOther: to really understand the scripts you have to see how Beth used them. Open up some of the vanilla scripts and then look up each of the terms in the wiki. It will start to make sense gradually, but it's not going to happen overnight. There are a lot of basic programming concepts you need to learn to really understand what is going on in the scripts.

In addition to the scripts, you need to see how vanilla properties are set in the CK. I had a heck of a time figuring out how the jail script worked until I figured out that the properties were being set in a faction. Once you understand how data gets into the script, it will make a lot more sense. There is no better guide than the CK and vanilla scripts + wiki, you just have to hunker down and study. If you're patient, it will come to you.
User avatar
Steeeph
 
Posts: 3443
Joined: Wed Apr 04, 2007 8:28 am

Post » Wed Jun 20, 2012 7:54 am

One last thing. You must enjoy it. At least at the beggining.
That's not a requirement.
I was thrown away by many things related to papyrus since the very start. And still I do not like it much, especially that need of assigning properties in different window even while they are already declared in script bugs me a lot. And that "owerwhelming blindness" where "global" is not actualy a global, etc. Things I could do in Oblivion, here take twice as much time to complete. Anyway this all didn't stop me to write working scripts for my mod, as I do not want to "learn" this language, but just to have "things done".
User avatar
Floor Punch
 
Posts: 3568
Joined: Tue May 29, 2007 7:18 am

Post » Tue Jun 19, 2012 8:44 pm

Set up a test cell and run experiments. See what works without having to adventure round half the world just to test it out.

i have a slab of rock floating in the formless void with a kajiit bandit and a nord farmer (at the moment) plus a row of buttons. If I don't know what something does, I set it up in there and try it.

It's a lot faster than staring at a wiki page and scratching your head.
User avatar
Trevi
 
Posts: 3404
Joined: Fri Apr 06, 2007 8:26 pm

Post » Wed Jun 20, 2012 7:07 am

I've been mostly reverse engineering everything. I didn't run the tutorials on the wiki. Instead I opened the CK on day one and just stared at the vampire script until things started making sense. I broke a lot of scripts and rewrote many others until I started to get the jist of it.

TESA is awesome for knowledge. So is the wiki and this website. (The Search box is my friend, the search box is my friend...)

The friendly folks on the forum help a lot too.

My method is a bit unorthodox though. When I was 12 my dad took apart our station wagon, toe to tiv, and forced me to spend my summer putting it back together.
User avatar
Natalie Taylor
 
Posts: 3301
Joined: Mon Sep 11, 2006 7:54 pm

Post » Wed Jun 20, 2012 11:55 am

This has all been reassuring, thanks all for your input. I'll definitely be checking out those classes over at TesAlliance. Thanks again :D
User avatar
Stephanie Nieves
 
Posts: 3407
Joined: Mon Apr 02, 2007 10:52 pm

Post » Wed Jun 20, 2012 1:59 am

I think scripting is kind of like... say, snowboarding. You can read all you want about it, but until you actually do it, you don't learn anything.

I learn by diving in, and saying 'What do I need to do?' Then I learn that. I just keep learning what I immediately need, and eventually I refine my abilities and learn a wide range of stuff.
User avatar
adam holden
 
Posts: 3339
Joined: Tue Jun 19, 2007 9:34 pm

Post » Wed Jun 20, 2012 4:19 am

My method is a bit unorthodox though. When I was 12 my dad took apart our station wagon, toe to tiv, and forced me to spend my summer putting it back together.
That's brilliant, I bet you became a really good problem solver as a result...
User avatar
SWagg KId
 
Posts: 3488
Joined: Sat Nov 17, 2007 8:26 am

Post » Wed Jun 20, 2012 11:41 am

That's not a requirement.
I was thrown away by many things related to papyrus since the very start. And still I do not like it much, especially that need of assigning properties in different window even while they are already declared in script bugs me a lot. And that "owerwhelming blindness" where "global" is not actualy a global, etc. Things I could do in Oblivion, here take twice as much time to complete. Anyway this all didn't stop me to write working scripts for my mod, as I do not want to "learn" this language, but just to have "things done".

Those properties are an annoyance, but they're also pretty powerful. You can take one script and make it do 100 different things just by specifying different properties.
User avatar
Chad Holloway
 
Posts: 3388
Joined: Wed Nov 21, 2007 5:21 am

Post » Wed Jun 20, 2012 8:55 am

As somebody who never scripted until the CK was released, i would suggest starting with small scripts trying to do simple things and expand on the idea when you get it working , even if you may never use them in a mod.

For example, my first script was just to add 5 gold to my character when i hit a target with a sword
This then progressed to a 20% chance on hit with a further 20% chance that it awarded 10 gold instead of 5
Next was to make it so that it only applied to hitting a hostile target.
Lastly, during testing i found the effect applied to a dead hostile target, so added another line to prevent this.

Only when you start to write a script and understand what you have written will it become easier.
If you become stumped, i have found these forums very helpful and sometimes the answer is so obvious (and easy) that you may be looking too hard for the solution.

Also i would re-iterate what others have already posted

Each time you write a line, add a comment to it so you know what that line was trying to achieve, for example this is two lines out of my first script everything behind ;is classed as a comment

 bool akTargetisDead = akTarget.isDead() ; expression to check to see if the target is deadif (akTargetisDead ==0) ; 0 represents that the target is not dead and is alive Prevents hitting a dead hostile and gaining gold

Lastly if you come across a page which is useful, bookmark it.
User avatar
SiLa
 
Posts: 3447
Joined: Tue Jun 13, 2006 7:52 am

Post » Wed Jun 20, 2012 2:16 am

That's brilliant, I bet you became a really good problem solver as a result...

Heh...I'd do that when the kid started wanting his own car. "Here ya go kid...get it assembled and it's all yours!"
User avatar
K J S
 
Posts: 3326
Joined: Thu Apr 05, 2007 11:50 am

Post » Wed Jun 20, 2012 11:51 am

That's brilliant, I bet you became a really good problem solver as a result...

In point of fact I did. That coupled with my mother forcing me to never give up sculpted a well-rounded chap. ...if a bit proudful. :D
User avatar
Francesca
 
Posts: 3485
Joined: Thu Jun 22, 2006 5:26 pm

Post » Wed Jun 20, 2012 6:09 am

What I know now, came from reading everyone else scripts and looking at some of beth's scripts. Some things I don't understand, and things I want to do can be done simply through a magic effect but I prefer to do it as a script as it feels more natural.
User avatar
Marie Maillos
 
Posts: 3403
Joined: Wed Mar 21, 2007 4:39 pm

Post » Tue Jun 19, 2012 11:07 pm

A lot of things have already been mentioned: Look at vanilla scripts, mess around, try doing things for fun or to challenge yourself.

I want to add one (boring) thing though: learn some basic theory of how programming languages work. How functions works, how conditionals works, what an object is, variable scope, classes, methods, inheritance, and more.
Even learn another language like PHP, Python, Java or C#.
It just helps you in so many ways. You understand more, you write better code with less bugs, you can code quicker.
User avatar
Alisia Lisha
 
Posts: 3480
Joined: Tue Dec 05, 2006 8:52 pm


Return to V - Skyrim