A guide to scripting - Ready at last!
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
-
- Posts: 270
- Joined: Mon, 23. Feb 04, 15:03
A guide to scripting - Ready at last!
The scripting guide is ready
32 pages of it covering......
1) Introduction
2) Activating and Accessing the Script Editor
3) Basic Script Editor use and Variables
4) Basic Concepts :-
More variables
Arguments
Script calls
Time outs
While, While Not and GO TO
If, If Not, and Expressions
Arrays DONE
http://www.x2source.com/scriptguide.php
*edit- burianek* new address per site owner's instructions:
http://www.x2source.com/index.php?act=scriptguide
Let me know what you think
32 pages of it covering......
1) Introduction
2) Activating and Accessing the Script Editor
3) Basic Script Editor use and Variables
4) Basic Concepts :-
More variables
Arguments
Script calls
Time outs
While, While Not and GO TO
If, If Not, and Expressions
Arrays DONE
http://www.x2source.com/scriptguide.php
*edit- burianek* new address per site owner's instructions:
http://www.x2source.com/index.php?act=scriptguide
Let me know what you think
You do not have the required permissions to view the files attached to this post.
-
- Posts: 1075
- Joined: Wed, 6. Nov 02, 20:31
yay for doing it, eh for making it a single page rather than a group of pages that'd make for easier digestion, and wtf for making the downloadable a pdf instead of a nice simple doc or txt or html page...
still, it's about a zillion times better than anything I've contributed, so overall our survey says
still, it's about a zillion times better than anything I've contributed, so overall our survey says
-
- Posts: 2981
- Joined: Mon, 29. Dec 03, 03:29
Very nice, thank you!
You know if you want to give up your intellectual property rights, I'd be willing to wager that if you mailed it to BurnIt!, with your permission, you'd see large chunks of this appear in the 'official' script editor documentation.
Pretty sure he'd appreciate the effort. I do.
You know if you want to give up your intellectual property rights, I'd be willing to wager that if you mailed it to BurnIt!, with your permission, you'd see large chunks of this appear in the 'official' script editor documentation.
Pretty sure he'd appreciate the effort. I do.
"Nature's first green is gold" . . . stay golden.
-
- Posts: 483
- Joined: Fri, 5. Dec 03, 20:19
-
- Posts: 1075
- Joined: Wed, 6. Nov 02, 20:31
-
- Posts: 483
- Joined: Fri, 5. Dec 03, 20:19
-
- Posts: 244
- Joined: Tue, 24. Feb 04, 19:37
Re: A guide to scripting - Ready at last!
marklaverty wrote: Let me know what you think
The only thing I want to say about the content is that I was hoping for something more along the lines of X2Scripting in a Nutshell, and this is more like X2Scripting for Dummies.
Knowing that, I still have gripes, and they deal exclusively with presentation. The site that is hosting this is crap for color/font selection. It makes your guide hard to read. There's zero font/color differentiation for code blocks, and they aren't set apart from the rest of the text. The section headings are in italics. They need to be bold, and larger than the rest of the text fonts.
The code blocks really need to be distinguished in some way, much the way quotes are handled in this message board (except maybe without the indentation). Like so:
##############################################
Delete all of the line in the ‘code’ section except for <new line> and return null. Next insert a new line above the ‘return null’, highlight it and hit return. Go into ‘General commands’ and select the ‘<retvar/if><expression>’ function. Then choose ‘if’ from the list of selections. You should now have
Highlight <?> and hit return, highlight ‘ship’ and hit return. You should now have...Arguments
Ship <Var/ship> Ship
Code
If <?> …
return null
<new line>
Highlight ‘…’ and hit return, select ‘= =’ and hit return. Now your script should look like …Arguments
Ship <Var/ship> Ship
Code
If $ship …
return null
<new line>
Arguments
Ship <Var/ship> Ship
Code
If $ship = = …
return null
<new line>
Highlight ‘…’ and hit return, select ‘PLAYERSHIP’ and hit return. This should give you…
Arguments
Ship <Var/ship> Ship
Code
If $ship = = [PLAYERSHIP] …
return null
<new line>
Insert a new line above ‘return null’, select it and hit return. Go into the ‘logbook commands’ section and pick ‘write to player logbook <value>’ then hit return. Select <string> from the list of selections and hit return. Type in ‘this is your ship’ and hit return. You should be taken back to your script which will now look like …
Arguments
Ship <Var/ship> Ship
Code
If $ship = = [PLAYERSHIP] …
Write to player logbook ‘this is your ship’
return null
<new line>
#############################################
See how this is easier to read?
Get the hosts of that site to do your guide a favor, and format it like a regular coding guide. It will help your readers.
Buy from your own factories only: http://users.genesee-id.com/cholmes/x2/ ... ceBest.zip
-
- Moderator (English)
- Posts: 27907
- Joined: Thu, 15. May 03, 20:57
Excellent job and thanks for putting it into a nice universal format. I much prefer pdf over some potentially incompatible text or doc format.
Have a great idea for the current or a future game? You can post it in the [L3+] Ideas forum.
X4 is a journey, not a destination. Have fun on your travels.
X4 is a journey, not a destination. Have fun on your travels.
-
- Posts: 270
- Joined: Mon, 23. Feb 04, 15:03
Thanks for the feedback , much appreciated
JustHere4Coffee -> Thanks I did pass Raven a .doc and a .pdf for downloading. I'll ask him to put the .doc up aswell.
Burianek -> Again, cheers dude . The guide is still incomplete and there is alot of stuf still to go in. I hadn't really dared consider it good enough to be part of the official documentation!
kryptyk -> Glad it helped
Shara -> I take your point and yes it would make it alot easyier to read *nods in agreement*. I'll ask for the code to be formatted in code blocks. In fairness I did just give him a load of unformatted text on a word document and let him sort it, out then tidyied it up for the pdf
On the other point. if it comes accros as a 'scripting for dummies guide' instead of a 'x2 scripting in a nutshell' guide then I've suceeded in what I set out to do. An x2 scripting in a nutshell would be more like 300 pages long instead of 32, and I don't know anywhere near enought to begin compiling one. The guide will grow with me as I get time to update it and learn new things (already loads more to go in ) then it should turn into a 'scripting in a nutshell' guide.
It was done for the sole purpose of giving anyone who knows absolutely nothing about scripting/programming a helping hand to get started. I remember how hard it was when I started and some of the time I work with relational databases and a querey language (ms sql server) as part of my day job.
Nanook -> Glad you like it
JustHere4Coffee -> Thanks I did pass Raven a .doc and a .pdf for downloading. I'll ask him to put the .doc up aswell.
Burianek -> Again, cheers dude . The guide is still incomplete and there is alot of stuf still to go in. I hadn't really dared consider it good enough to be part of the official documentation!
kryptyk -> Glad it helped
Shara -> I take your point and yes it would make it alot easyier to read *nods in agreement*. I'll ask for the code to be formatted in code blocks. In fairness I did just give him a load of unformatted text on a word document and let him sort it, out then tidyied it up for the pdf
On the other point. if it comes accros as a 'scripting for dummies guide' instead of a 'x2 scripting in a nutshell' guide then I've suceeded in what I set out to do. An x2 scripting in a nutshell would be more like 300 pages long instead of 32, and I don't know anywhere near enought to begin compiling one. The guide will grow with me as I get time to update it and learn new things (already loads more to go in ) then it should turn into a 'scripting in a nutshell' guide.
It was done for the sole purpose of giving anyone who knows absolutely nothing about scripting/programming a helping hand to get started. I remember how hard it was when I started and some of the time I work with relational databases and a querey language (ms sql server) as part of my day job.
Nanook -> Glad you like it
-
- Posts: 1827
- Joined: Wed, 6. Nov 02, 20:31
Fantastic Mark...very easy to understand....Many, many thanks for the Guide
[MOD]X3TC No Fog / [MOD]X3AP No Fog / [MD]X3TC Menagerie Shipyard / [MD]X3AP Menagerie Shipyard
<==<<Argonaught>>==>
XBTF>XT>X2TT>X3R>X3TC>X3AP>X4F
I lurk alot for the most part now
<==<<Argonaught>>==>
XBTF>XT>X2TT>X3R>X3TC>X3AP>X4F
I lurk alot for the most part now
-
- Posts: 3846
- Joined: Wed, 6. Nov 02, 20:31
-
- Posts: 2981
- Joined: Mon, 29. Dec 03, 03:29
I think you may be surprised. It's my impression that these guys are swamped with work beyond what most of us would figure. Every time I've seen Bernd in the chat rooms and someone has asked him about scripting guides and the like the answer is always:marklaverty wrote:Burianek -> Again, cheers dude . The guide is still incomplete and there is alot of stuf still to go in. I hadn't really dared consider it good enough to be part of the official documentation!
'Scripting is an unsupported feature. Since we don't even have enough time to finish all of the things that we absolutely have to finish, it will have to be placed on the back burner as there aren't enough hours in the day. If anyone out there would like to contribute and take a shot at writing something, please do and send it to me.'
I've even seen him (Bernd) offer access to higher level people to get questions answered to a german forum member that was considering putting together a modder's guide.
A first attempt is better than no attempt, and while I certainly don't have any say in anything important, this stuff may be more well received than you think it would be.
Just something to think about.
"Nature's first green is gold" . . . stay golden.
-
- Posts: 483
- Joined: Fri, 5. Dec 03, 20:19
-
- Posts: 698
- Joined: Sat, 24. May 03, 19:14
On behalf of all morons everywhere I would like to thank you for the Scripting Guide, I just dl'd it and was extremely relived to discover that it's not written in Swahili as most of the scripting tuts I've tried to understand seem to be. Great work man thanx again
Happy chappie
Happy chappie
My Music: http://www.reverbnation.com/thisturbulentpriest
YouTube Channel: http://www.youtube.com/user/TheDerekCarroll
YouTube Channel: http://www.youtube.com/user/TheDerekCarroll
-
- Posts: 985
- Joined: Sun, 7. Dec 03, 05:15
-
- Sith Lord
- Posts: 8255
- Joined: Wed, 6. Nov 02, 20:31
Now now gentlemen
Any guide is a good guide
The only way this scripting forum is going to get anywhere is if it's users work together as the any official help/hints are about as likely as martians landing on earth tommorow
It's a fine guide but i must admit it is hard to read and the code should standout, marklaverty has put some serious effort in here and i'd hope if someone else tidied it up mark would apprieciate it.
I'd happily tidy it up but I have nearly 30 scripts to tidy b4 1.4 comes out
If the peeps on this forum wants some scripting docs their going to have to make them themselves and if you havn't worked this out yet you never will
Any guide is a good guide
The only way this scripting forum is going to get anywhere is if it's users work together as the any official help/hints are about as likely as martians landing on earth tommorow
It's a fine guide but i must admit it is hard to read and the code should standout, marklaverty has put some serious effort in here and i'd hope if someone else tidied it up mark would apprieciate it.
I'd happily tidy it up but I have nearly 30 scripts to tidy b4 1.4 comes out
If the peeps on this forum wants some scripting docs their going to have to make them themselves and if you havn't worked this out yet you never will
LV's TC Scripts
Readme's For All My Scripts
I felt a great disturbance in the forum, Like millions of voices cried out in terror, then were silenced
si tacuisses, philosophus mansisses
Readme's For All My Scripts
I felt a great disturbance in the forum, Like millions of voices cried out in terror, then were silenced
si tacuisses, philosophus mansisses
-
- Posts: 270
- Joined: Mon, 23. Feb 04, 15:03
Hi,
Ok, I'd just like to start by saying that I did ask for comments and that was because I wanted them, both good and bad.
I'm not one of these people who don't like being critisised, as long as it's helpfull.
Shara -> whilst your comments might may be percieved as a bit 'blunt', your sugestion about the code blocks was very usefull and I thank you for it. I have asked for this to be done ASAP.
That said, and this was never going to be a 'scripting in a nutshell guide'. It is aimed at helping people get started with scripting and is just an attempt to take some of the steepness out of the learning curve.
As LV said, it will be some time before we see a 'propper' scripting in a nutshell guide from egosoft, and we may never do.
With this in mind, the more that's written down by people the better. If you know how to do something with x2 scripts please consoider taking just half an hout or so and writing it down.
If you want send it to me and I'll add it to the guide, obviously stating your name as the person who submitted that section and thanking you profusely!
Ok, I'd just like to start by saying that I did ask for comments and that was because I wanted them, both good and bad.
I'm not one of these people who don't like being critisised, as long as it's helpfull.
Shara -> whilst your comments might may be percieved as a bit 'blunt', your sugestion about the code blocks was very usefull and I thank you for it. I have asked for this to be done ASAP.
That said, and this was never going to be a 'scripting in a nutshell guide'. It is aimed at helping people get started with scripting and is just an attempt to take some of the steepness out of the learning curve.
As LV said, it will be some time before we see a 'propper' scripting in a nutshell guide from egosoft, and we may never do.
With this in mind, the more that's written down by people the better. If you know how to do something with x2 scripts please consoider taking just half an hout or so and writing it down.
If you want send it to me and I'll add it to the guide, obviously stating your name as the person who submitted that section and thanking you profusely!
-
- Posts: 244
- Joined: Tue, 24. Feb 04, 19:37
I never meant to disrespect your guide. So, if it got perceived that way, that was not my intent. My intent was simply to provide feedback that was asked for, so I did. I noted two important things: (1) The format needed some work, and that was not your fault, but the maintainers of the site and (2) I expected a different guide. That was my expectation, and I never meant for it to reflect the quality of your guide. You meant to write a Scripting for Dummies guide, and so you achieved your objective - good show!marklaverty wrote:Hi,
Ok, I'd just like to start by saying that I did ask for comments and that was because I wanted them, both good and bad.
I'm not one of these people who don't like being critisised, as long as it's helpfull.
Shara -> whilst your comments might may be percieved as a bit 'blunt', your sugestion about the code blocks was very usefull and I thank you for it. I have asked for this to be done ASAP.
That said, and this was never going to be a 'scripting in a nutshell guide'. It is aimed at helping people get started with scripting and is just an attempt to take some of the steepness out of the learning curve.
As LV said, it will be some time before we see a 'propper' scripting in a nutshell guide from egosoft, and we may never do.
With this in mind, the more that's written down by people the better. If you know how to do something with x2 scripts please consoider taking just half an hout or so and writing it down.
If you want send it to me and I'll add it to the guide, obviously stating your name as the person who submitted that section and thanking you profusely!
Buy from your own factories only: http://users.genesee-id.com/cholmes/x2/ ... ceBest.zip