![]() |
Quote:
|
ooooooooooooooooooooooooooooooooooooooooooh
that's another problem heh |
It is good to see people who know that programming is an art form, and there are certain rules that should apply for asthetic reasons, and to save on processor time (thus slashing away at the lag monster).
Good code should be self-documenting, but comments are encouraged - at least a purpose statement, like with your graal name and an exploination of what the npc does, at the top of the code. There are two ways to make comments, line at a time, and in a block. NPC Code: The comments that go on for more than one line should be put in a comment block NPC Code: Forgive spelling or grammar mistakes, as its early morning and am half awake .. and half asleep .. so my consiousness is twice as big as it needs to be? |
heh my dad's always telling meh to use comments while programming... it's fun because you can pretend that whateber you put is a sublimnal message repeated OVER AND OVER while the script is functioning but yea...
comments are very underused in gscript (as far as ive seen)... i think it would be ince to see a script once in a while that ya know says if (actionjewer){ message #p(1) Is A Jew!; //#p(1) is the player's account name } or something like that, so we have like a little helper when we're debugging other people's scripts... or scripts we made when we were "in a state where we wouldnt remember" heh... most scripters can easily identify (looking at the triggeraction) that #p(1) would be the players account name but it saves time and is much easier to just look to the right and say "oh!" or say, the script keeps coming up with something like "12 is a jew!" people can say "hmm..." "oh ok well that's the problem! #p(1) is scripted to be the players damage! they have 'account name' listed as #p(2) in the triggeraction! Silly NATs..." it can cause more confusion if someone types the wrong thing as a comment then what the script is actually intended to do but everything's got drawbacks right? |
another word for scripting hmm...geek
anyways I wish there were a good tuturial that teaches people to script easier... i just don't get it |
Quote:
|
Quote:
|
Quote:
|
Quote:
Maybe I shouldn't have posted this here, as it doesn't really belong with the topic. :( |
Quote:
|
Quote:
|
Quote:
(Also, why in the world would you attempt/hope to gain scripters from Levels Team? That seems rather foolish, if you ask me.) |
Quote:
|
Quote:
A Levels Administration Team is just that. |
Quote:
|
Quote:
Aside from all of that, my question related to why a levels administration team was dealing with scripting for an NPC-Server. :) |
Quote:
Btw, don't you have 2001 to work on? When are you going to find the time for Classic? |
Quote:
I also have bored nights+weekends, and a willingness to help out where I can. And to answer the inevitable question - correct, I do have no life. |
Quote:
And as I said, I'll see about getting you rights whenever I can. I'll forum PM you or something when you have them. |
Quote:
I,j,k,l etc. is for compability with Java and C++, just like == is. Also, this. variables can be used to. |
Quote:
|
Quote:
|
Quote:
:grrr: |
Quote:
|
Quote:
|
Quote:
Quote:
|
Quote:
Anyway, i and j aren't part of Java or C and they're not syntactic devices. They're just variable names. |
Quote:
|
There is now a new command on RC:
/style scripttype name Scripttype can be class, npc or weapon. It is reformatting the script to look nicer. Please test it before using, sometimes triggeractions can be messed up because it divides weapon names like Day-Night in Day - Night. You can change the style options in the server options: scriptstyle=spaces=2,padding=oper,brackets=attach Spaces gives the number of spaces to put in front of each line (indenting). Padding says where to put spaces in between: 'oper' will put spaces behind commands like 'if' and before and after operands like '+' and '==', 'paren' will put spaces in [] and (), 'all' will do both. Brackets says if it should break lines before and after { and } ('break'), or if it should actually attach it to the previous 'if' or 'for' command ('attach'). Use 'linux' as option if you want to break declarations (array declarations like a = {1,23}) but want to attach brackets after commands. The npcserver uses the astyle library to format the text. [edit: post merge by Loriel :cool:] Yes i,j,k is common standard for loop index variables. The 'l' is not used often because it looks like a 1. So better continue with m,n,o,p,q,r,s,t etc. :) |
Quote:
But a style button wouldn't be better? |
A style button would have required yet another RC update, and would also need to be rescripted for the new RC later on. Also, I doubt it would do much good to the RC's compactness to link it with the library Stefan mentioned.
Edit: Actually, no. Forget that. A style button would be better. |
Finnaly! Good job Stefan :)
But, yea, A style button would be better;) |
Very nice. This will come in handy. :)
|
Wait for the new scripted rc, then you'll be able to have style buttons ;)
|
What are the options to have the same style that Stefan uses when he scripts? Fourm PM this to me please, as I never read this thread much.
NPC Code: |
I set the brackets to linux style but I can't seem to get them to change back to attached.
|
Quote:
|
simply because the KSI-GS is just common sense, and if a playerworld had scripts which dont conform, that playeworld shalt be striketh down in a firey rain of brimstone and ash.
|
Quote:
Of course, the runt shouldn't be a GST member, but that's another story |
Oooh which runt, gossip gossip gossip :P
|
| All times are GMT +2. The time now is 01:38 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.