PDA

View Full Version : Scripting for dummies?



SpacemanDan
08-04-2007, 11:10 AM
Can someone explain scripting and how to use it to me from the top? (Or direct me somewhere on the site that explains it all. Bear in mind, I have literally no knowledge of scripting.)
Thanks! :D

Gleeok
08-04-2007, 11:22 AM
Holy shit dude! You and me both. I just realized what FFC meant only a few hours ago. It makes me angry looking at stuff like int(x_0) if x=(0) then x=1 else if-->{waitframe} the ffc return<from= camping....wtf? I mean there really needs to be some help for people like us. And I don't think an idiots guide to scripting is gonna cut it for me. What I need is something like "So your 90 year old grandma wants to learn Zscript" Yep. that's the stuff. ;p

Seriously though.

SpacemanDan
08-04-2007, 11:39 AM
I know some very basic stuff about FFCs, as in, I can make them move, and change direction, but that isn't scripting at all. It's just FFC changers and stuff like that. I don't even know what the heck an arguement is...

ShadowMancer
08-04-2007, 12:00 PM
This might be a good place to start:
http://www.phim.unibe.ch/comp_doc/c_manual/C/SYNTAX/syntax.html
it is related to C programming but ZScript is very similar to C and the basic concept and logic are the same (although be warned that not every function you see in a C tut is going to be available in ZScript)

Also check out the ZU's tuts on ZScript (only 2 right now but may be of some help)
http://zcu.sephiroth.ws/forums/index.php?autocom=ineo&showcat=6

Get some scripts that are already written and working correctly and experiment, just play play play until you understand, that worked for me.
Any specific questions will useally be answerd by one of the few good scripters around here (you know who you are :D )

SpacemanDan
08-04-2007, 12:05 PM
I think I'll stick with the later two tutorials, and play with other scripts. The first site looks complicated. :confused:
Thanks for the help! :D

pkmnfrk
08-05-2007, 12:12 AM
Eh... I'm writing a tutorial here (http://zctut.com/script1.php), but it's far from complete. It does have a bit of content, enough to hopefully get you started reading other people's scripts.

Gleeok
08-05-2007, 12:37 AM
Thanks pkmnfrk. That example is very direct and to the point. The other examples were extremely bloated and hard to read, where a simple //this line does that is very appreciated. I think I can give this a try now. :)

pkmnfrk
08-05-2007, 12:41 AM
You're welcome :D

I too am frustrated by the lack of substantial documentation. Luckily, I have Quick Learn (I think it's a feature of the Technomancer (http://hamsterrepublic.com/james/technomancy/) class), and so I feel the need to help others.

Gleeok
08-05-2007, 12:56 AM
Ahahahaha!!! That sums it up pretty well. My computer IS evil you know.

Here..i'll prove it to you; Just open it's evil armor and pour holy water over the cursed thing. Without evil demons, it can't work. :tongue:

Also be sure to let your computer listen to lots of death metal. That keeps it working in tip-top shape and kills viruses too!

ShadowTiger
08-05-2007, 09:22 AM
Heheh. ZScript tutorials...

First of all, Anyone who says that "ZScript is easy to learn" will promptly find themselves with a bucket over their head. (Padded for your comfort. May contain macaroni. I'm far too nice y'see.) Essentially, just because -you- may happen to know it easily enough, doesn't mean that others may learn it as easily. Different people learn things in different ways.

Yes, it's easy to say that you learn by doing, but you have to *know what* you're doing before you can actually do it, otherwise you're just pushing buttons. I.e. I can copy and paste "import "std.zh"" easily enough, but that doesn't mean that I'd know what it means. And then when someone explains what it does, I may not understand why we even need that until we get to actually scripting in the rest. It'd need some sort of tie-in with content later down the road that's already there and understood.

Of course, on the subject of tie-ins, it's not as simple as a single tie-in. With something like an entire script in front of our eyes, open for analysis, but with things that we couldn't even identify sitting on the page, it doesn't really get any easier. You've got lines that don't make a whole lot of sense taken by themselves. Within a context, it's a bit easier for just about anyone, (Context is a universal truth.) That's why it's VERY important to label/comment literally every single line with not only a what but a why as well. For example:

if(x >= 7) { // Checks to see if variable (x) is greater than or equal to (seven) and then opens its results scope.
Link->MaxHP = 7; //Sets Link's Maximum Hit Points to 7.
} //Closes the If results scope.

Something like that would indeed be most helpful. The way I see it, if you're too lazy to label and comment everything, you'd be too lazy to script for other peoples' use in the first place. It's a rather harsh analysis, but look at it this way: If you ARE scripting for the purpose of helping the community, going all out and commenting every line *WILL* be of such an incredible boon to the community that you'll really have done something amazing for people. It's not that big of an effort or difference on your part, but it is on the rest of the community's.

Petoe
08-05-2007, 09:40 AM
if(x >= 7) { // Checks to see if variable (x) is greater than or equal to (seven) and then opens its results scope.
Link->MaxHP = 7; //Sets Link's Maximum Hit Points to 7.
} //Closes the If results scope.

Something like that would indeed be most helpful. The way I see it, if you're too lazy to label and comment everything, you'd be too lazy to script for other peoples' use in the first place.

Oh indeed! That would be even better than the "Scripting tutorial for dummies" I've been crying for! If people would be kind enough to take the extra time to make comments like that after every line of code, that would be the bestw ay to learn. Right now when I look at the code I'm like "umm... {x=>0 y=xhglgl] ?} ...wtf?" :tongue: lol.

ShadowMancer
08-05-2007, 10:06 AM
ShadowTiger makes a good point


Something like that would indeed be most helpful. The way I see it, if you're too lazy to label and comment everything, you'd be too lazy to script for other peoples' use in the first place.

I think I may add those comment lines to the scripts I've been writeing for my quest (scripts which I am planning on shareing with the community anyway) this way they may also serve as a tutorial insted of just a 'black box' add in for non-scripting quest makers.
Im glad to see so many ppl with the disire to learn scripting, and I want to help any way I can.

Gleeok
08-05-2007, 10:16 AM
if(x >= 7) { // Checks to see if variable (x) is greater than or equal to (seven) and then opens its results scope.
Link->MaxHP = 7; //Sets Link's Maximum Hit Points to 7.
} //Closes the If results scope.

init ffc script Help_me_script()
{void run()
y>=awesome{ //checks to see if variable y is greater than or equal to awesome
My scripting->understanding=1 //increasing my scripting knowledge by 1.
{ waitframe()
else if x<=(tut) // variable x (me) is less than or equal to tutorial
{ then Run_Tut() //someone please make one!!!
waitframe(124542)
{
End run}

ShadowTiger
08-05-2007, 06:50 PM
Just for kicks:
init ffc script //Are we sure we need init?
Help_me_script() //Can't forget the opening brackets! ({)
{void run() //Run void, run! I think this is "void main()" I hope. Don't forget the { !!
y>=awesome{ //checks to see if variable y is greater than or equal to awesome
My scripting->understanding=1 //increasing my scripting knowledge by 1. //Though technically, "1" == "true" rather than "1 as in 1-100." We're talkin' booleans.
{ waitframe() //Can't forget the ; to mark the end of a line, if it's the opening subject of a new scope.
else if x<=(tut) // variable x (me) is less than or equal to tutorial //What's with the Waitframe() being placed before that? Doesn't make a lot of sense. Then again, we are just joking around here. :blah:
{ then Run_Tut() //someone please make one!!! //Again, run, Run_Tut(), run!
waitframe(124542) //That's how important waitframe()s are. ^__^
{ //End scope!!!!!!!6!
End run} //I don't think we need run either. This'd just be quit(), I'd bet.I should color my comments next time, instead. Easier to read. D: