EnglishGermanFrenchRussianItalianSpanish
Log inRegister
 
A guide to scripting - Ready at last!
Post new topic Reply to topic Goto page 1, 2, 3, 4  Next
View previous topic :: View next topic
Author Message
marklaverty





Joined: 23 Feb 2004
Posts: 270 on topic

Thank you for registering your game
PostPosted: Fri, 7. May 04, 16:55    Post subject: A guide to scripting - Ready at last! Reply with quote Print

The scripting guide is ready Very Happy

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 Smile


_________________
For everything you ever wanted to know about X2,
and more......

Back to top
View user's profile Send private message
JustHere4Coffee





Joined: 06 Nov 2002
Posts: 1070 on topic

Thank you for registering your game
PostPosted: Fri, 7. May 04, 18:10    Post subject: Reply with quote Print

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 Thumb up Thumb up

Back to top
View user's profile Send private message
Burianek





Joined: 29 Dec 2003
Posts: 2928 on topic
Location: Chicago, IL
Thank you for registering your game
PostPosted: Fri, 7. May 04, 19:29    Post subject: Reply with quote Print

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. Very Happy


_________________
"Nature's first green is gold" . . . stay golden.
Back to top
View user's profile Send private message Visit poster's website
kryptyk





Joined: 05 Dec 2003
Posts: 392 on topic
Location: MoNW
Thank you for registering your game
PostPosted: Fri, 7. May 04, 20:23    Post subject: Reply with quote Print

Now that's handy info! Thumb up


Where can I find the downloadable version....I seemed to have missed the links..... Confused

Back to top
View user's profile Send private message
JustHere4Coffee





Joined: 06 Nov 2002
Posts: 1070 on topic

Thank you for registering your game
PostPosted: Fri, 7. May 04, 20:27    Post subject: Reply with quote Print

at the very top of the text, where it says "or you can download it here" Smile

Back to top
View user's profile Send private message
kryptyk





Joined: 05 Dec 2003
Posts: 392 on topic
Location: MoNW
Thank you for registering your game
PostPosted: Fri, 7. May 04, 20:29    Post subject: Reply with quote Print

JustHere4Coffee wrote:
at the very top of the text, where it says "or you can download it here" Smile


man...I'm going blind..... Laughing

Back to top
View user's profile Send private message
Shara





Joined: 24 Feb 2004
Posts: 234 on topic

Thank you for registering your game
PostPosted: Fri, 7. May 04, 20:57    Post subject: Re: A guide to scripting - Ready at last! Reply with quote Print

marklaverty wrote:

Let me know what you think Smile



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

Quote:

Arguments
Ship <Var/ship> Ship
Code
If <?> …
return null
<new line>


Highlight <?> and hit return, highlight ‘ship’ and hit return. You should now have...

Quote:

Arguments
Ship <Var/ship> Ship
Code
If $ship …
return null
<new line>


Highlight ‘…’ and hit return, select ‘= =’ and hit return. Now your script should look like …

Quote:

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…

Quote:

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 …

Quote:

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/BuyResourceBest.zip
Back to top
View user's profile Send private message Send e-mail
Nanook
Moderator (English)
Moderator (English)



Joined: 15 May 2003
Posts: 25942 on topic
Location: In the X-Universe spanning two millenia
Thank you for registering your game
PostPosted: Sat, 8. May 04, 00:13    Post subject: Reply with quote Print

Excellent job and thanks for putting it into a nice universal format. I much prefer pdf over some potentially incompatible text or doc format. Thumb up Thumb up Thumb up Smile


_________________
Having an Acronym Attack? See the Ego FAQ. Also now for Terran Conflict and Albion Prelude.
NOT an Egosoft employee.
Back to top
View user's profile Send private message
marklaverty





Joined: 23 Feb 2004
Posts: 270 on topic

Thank you for registering your game
PostPosted: Sat, 8. May 04, 01:53    Post subject: Reply with quote Print

Thanks for the feedback , much appreciated Very Happy

JustHere4Coffee -> Thanks Thumb up Thumb up 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 Very Happy . 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! Embarassed

kryptyk -> Glad it helped Very Happy

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 Evil Laugh

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 Very Happy


_________________
For everything you ever wanted to know about X2,
and more......

Back to top
View user's profile Send private message
Argonaught.





Joined: 06 Nov 2002
Posts: 1618 on topic
Location: Omnipotence rules!
Thank you for registering your game
PostPosted: Sat, 8. May 04, 02:55    Post subject: Reply with quote Print

Fantastic Mark...very easy to understand....Many, many thanks for the Guide Thumb up Thumb up Thumb up Thumb up Thumb up


_________________
[MOD]X3TC No Fog / [MOD]X3AP No Fog / [MD]X3TC Menagerie Shipyard / [MD]X3AP Menagerie Shipyard
<==<<Argonaught>>==>

XBTF>XT>X2TT>X3R>X3TC>X3AP

I lurk alot for the most part now
Thumb up
Back to top
View user's profile Send private message Visit poster's website
Sir Crashalot





Joined: 06 Nov 2002
Posts: 2013 on topic
Location: Castle Aaaaaaaaaargh
Thank you for registering your game
PostPosted: Sat, 8. May 04, 03:01    Post subject: Reply with quote Print

Good work ! Thumb up Thumb up Thumb up Thumb up

An excellent beginners guide to scripting. Smile


_________________
If you can`t dazzle them with dynamics, then baffle them with bullsh*t Very Happy
Back to top
View user's profile Send private message
Burianek





Joined: 29 Dec 2003
Posts: 2928 on topic
Location: Chicago, IL
Thank you for registering your game
PostPosted: Sat, 8. May 04, 09:46    Post subject: Reply with quote Print

marklaverty wrote:
Burianek -> Again, cheers dude Very Happy . 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! Embarassed


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:

'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.
Back to top
View user's profile Send private message Visit poster's website
marklaverty





Joined: 23 Feb 2004
Posts: 270 on topic

Thank you for registering your game
PostPosted: Sat, 8. May 04, 11:06    Post subject: Reply with quote Print

Thanks everyone, glad its ok and easy to understand Very Happy


Burianek -> I'll send an E-mail and see what happens Wink


_________________
For everything you ever wanted to know about X2,
and more......

Back to top
View user's profile Send private message
kryptyk





Joined: 05 Dec 2003
Posts: 392 on topic
Location: MoNW
Thank you for registering your game
PostPosted: Sun, 9. May 04, 00:22    Post subject: Reply with quote Print

maybe they'll look at it, maybe add some more info and use it as the unofficial documentation

ya never know..... Very Happy

Back to top
View user's profile Send private message
Witchking





Joined: 24 May 2003
Posts: 340 on topic
Location: Somewhere right behind you....ok then Ireland
Thank you for registering your game
PostPosted: Sun, 9. May 04, 14:53    Post subject: Reply with quote Print

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 Very Happy


_________________
My Music: http://www.reverbnation.com/thisturbulentpriest
YouTube Channel: http://www.youtube.com/user/TheDerekCarroll
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic Reply to topic Goto page 1, 2, 3, 4  Next
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
Control Panel
Login Data
The time now is Mon, 23. Apr 18, 05:50

All times are GMT + 2 Hours


Board Security

Copyright © EGOSOFT 1989-2018
Powered by phpBB © 2001, 2005 phpBB Group
Template created by Avatar & BurnIt!
Debug: page generation = 0.11394 seconds, sql queries = 29