General comment by Stalker

Old and generally outdated discussions, with the rare hidden gem. Enter at your own risk.

Moderators: Haplo, Lead Developers

Locked
Assassinace
Developer
Posts: 811
Joined: Thu Aug 21, 2003 10:56 am
Location: Dreamland

General comment by Stalker

Post by Assassinace »

*Posted by theo for quests but is really for all scripters*

Stalker, who is currently fixing old esps, asked me to make sure that the scripts that will be created from now on will be comperhensible so that it is absolutely clear what they do.
So I would like to introduce several basic rules of scripting aesthetics and ask every scripter to keep them in mind. Messy and uncomperhensible scripts in quests will not pass review be they working or not.

1) Correct format to name scripts in map 1 quests will be now on:

TR_m1_(quest initials - applies only if script is made for purpose of one quest and has no other use. Otherwise put GEN)_(intelligible name of script giving basic idea what it does)

2) On the begining of each script there will be a few lines of comments describing what does the script do, what objects it affects and what is its purpose. No need to follow all that but do write what you think is necessary for correct understanding of the script.

3) Naming of variables: Just use common sense. It is not neccesary so that the name of variables were 16 characters long, just give some idea what do they do.

4) When changing some variables outside the script please make a comment on this.

5) Keep strict and uniform style of blank spaces at the beginning of the lines inside some conditions, so everybody can track which "end if" belongs to which "if".

Generarily just make sure you make your script in a way in which you would like to find it if you were asked to fix it after five years. I am sure this will be no problem for you.

Thank you for your valuable efforts.
Theo
Developer Emeritus
Posts: 1683
Joined: Thu Dec 16, 2004 5:01 pm
Location: PRAGUE

Post by Theo »

In the original thread we agreed with Omicron to keep original Majra's convention of naming the scripts. As there are about three-four active scriptmakers right now who already know this one I guess there is no rush in announcing this.
THEO
User avatar
Haplo
Lead Developer
Posts: 11651
Joined: Sat Aug 30, 2003 6:22 pm
Location: Celibacy

Post by Haplo »

Also, be nice. Post a single one-liner at minimum in your script describing what said script actually does. (if you can fit, which you can, unless you have like an 1100-line script)

ie.


begin SampleScript

;this script is just a sample to show you what this post means

if ( ScripterIQ == 0 )
slapwithtrout 1
endif

if ( ScripterIQ > 0 )
approvescriptidea
endif

End SampleScript
Last edited by Haplo on Sat May 27, 2006 12:39 am, edited 3 times in total.
Locked