A guide to scripting - Ready at last!

The place to discuss scripting and game modifications for X²: The Threat.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

marklaverty
Posts: 270
Joined: Mon, 23. Feb 04, 15:03
x2

Post by marklaverty » Mon, 10. May 04, 09:36

Glad you found it helpfull :D :D :D :D
For everything you ever wanted to know about X2,
and more......

[ external image ]

User avatar
Kailric
Posts: 985
Joined: Sun, 7. Dec 03, 05:15
x3

Post by Kailric » Mon, 10. May 04, 14:26

:? Thanks to you I understand Arrays lots better now! :idea:
"Try not. Do or do not, there is no try."-Yoda

"[Its] time for the human race to enter the solar system"-Dan Quayle

User avatar
LV
Sith Lord
Posts: 8255
Joined: Wed, 6. Nov 02, 20:31
x3tc

Post by LV » Tue, 11. May 04, 00:54

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 :wink:
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

marklaverty
Posts: 270
Joined: Mon, 23. Feb 04, 15:03
x2

Post by marklaverty » Tue, 11. May 04, 12:14

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!
For everything you ever wanted to know about X2,
and more......

[ external image ]

Shara
Posts: 244
Joined: Tue, 24. Feb 04, 19:37
x2

Post by Shara » Tue, 11. May 04, 17:20

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!
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!

User avatar
GoateeCat
Posts: 1184
Joined: Mon, 10. Mar 03, 23:50
x2

Post by GoateeCat » Wed, 12. May 04, 05:57

Well, my proxy finally let it through. I'm only a few pages in and already, BRAVO!! The nuances of the engine itself and not the code always annoyed me, but you make it all crystal clear.

I imagine when I'm done reading the whole shebang I'll have only laziness to blame for not creating scripts.

...

Laziness it is then! :)

marklaverty
Posts: 270
Joined: Mon, 23. Feb 04, 15:03
x2

Post by marklaverty » Wed, 12. May 04, 13:35

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!
cool :D

no offence was intended or taken.
Well, my proxy finally let it through. I'm only a few pages in and already, BRAVO!! The nuances of the engine itself and not the code always annoyed me, but you make it all crystal clear.

I imagine when I'm done reading the whole shebang I'll have only laziness to blame for not creating scripts.

...

Laziness it is then!

ROLF :D
For everything you ever wanted to know about X2,
and more......

[ external image ]

[DLM]Jimbo
Posts: 22
Joined: Mon, 13. Sep 04, 14:53
x2

Impressive...

Post by [DLM]Jimbo » Fri, 17. Sep 04, 23:21

I actually managed to understand that. I'm looking forward to reading anything else you write as it's written in a really user friendly manner. I generally look at coding related stuff, see it in it's entirity and just get immensely confused. That managed to break it down into nice bitesized chunks and I actually feel like I could start playing with scripting a lil and see how it goes. Will play the game a lil more first to get an idea of what I really want from the game and then I'll try and script it :)

User avatar
R4v3n
Posts: 20
Joined: Fri, 12. Mar 04, 10:28
x2

Post by R4v3n » Mon, 7. Feb 05, 09:33

the address has now changed, the scripting guide can be found here:

http://www.x2source.com/index.php?act=scriptguide
Mike Dart
X Source Central
Admin/Creator

terrifiedkiller
Posts: 179
Joined: Thu, 9. Mar 06, 22:58
x4

newb scripter looking to learn how to make a script

Post by terrifiedkiller » Sun, 19. Mar 06, 23:37

hi i am trying to make me a x3 script that will give me cash for every single kill i make and i'm trying to learn how to script using the guides here in the forums but i cant understand how anyone able to explain how?

BarclayMan
Posts: 1
Joined: Wed, 8. Mar 06, 04:41

Post by BarclayMan » Tue, 28. Mar 06, 14:04

POS

Horsewhisperer
Posts: 5
Joined: Tue, 17. Jan 06, 02:58
x3

Post by Horsewhisperer » Wed, 24. May 06, 02:25

Hi Fellas,

I tried to donload this guide, but it appears that the X2Script.com site is down.

Is it just maintenance, or is it down permanently? If so, is there anywhere else I can get the guide from?


Horsey

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22197
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Wed, 24. May 06, 03:07

well, considering it was posted over a year ago, then theres a chance that its no longer supported or avaialble

User avatar
moggy2
Posts: 5505
Joined: Wed, 6. Nov 02, 20:31
x3ap

Post by moggy2 » Wed, 24. May 06, 06:05

I don't know what's up with x2source.com. It must have been there a few weeks ago. I downloaded the guide only recently.

I can't really host it without permission from the author, so I've emailed it to you. Hope that's the one you were looking for.

Horsewhisperer
Posts: 5
Joined: Tue, 17. Jan 06, 02:58
x3

Post by Horsewhisperer » Wed, 7. Jun 06, 05:59

Thanks for that. :)

MackTracker
Posts: 3
Joined: Fri, 1. Sep 06, 05:16

Post by MackTracker » Sun, 3. Sep 06, 02:17

This was a great walk through for anyone starting out. I know it sure helped me get started. Reading through this took me about 1 hour. Though I will say that I was already familiar with XML.

I am running X3 Reunion and I don't know if their are any differances but I would like to point out a few errors in this text if you don't mind. :D

FIRST:
I don't know if you are aware but I noticed that your final escourt routine causes the game to freeze should your target decide to land at a Station. (X3 Only, I don't know if it causes X2 to freeze)

I would surmize that this is caused by the fact that the ship's referance is nolonger availiable. This could be taken care of by a test to see wether the ship is about to dock or not.

SECOND:
With regaurd to the last program. If you follow your instructions cairfully and when you come to the part where you are initializing the $count variable, you will get the following wrather than what is printed in your guide:

"$count =<?> … " wrather than "$count <?> …"

From their if you continue you will get:

"$count = == 0 …"

Which of course creats a syntax error. It is common programming practice to use the "=" (Singal equal sign) to mean "Assign the value of x to the value of y" where y=x. Where as the "==" (Double equal sign) means to ask "Are these two values equal to eachother.

Hats off to you for all your effort in putting this walk through together for all of us. I apreciate this because I know it helped me lots. :) cheers :x3: (Again I have only tested this with X3.)
Their is one in all!

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22197
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Sun, 3. Sep 06, 02:31

MackTracker wrote:It is common programming practice to use the "=" (Singal equal sign) to mean "Assign the value of x to the value of y" where y=x. Where as the "==" (Double equal sign) means to ask "Are these two values equal to eachother.
actaully its not that common, most languages use the = for both.

the == was mainly only used by C/C++ and the languages that came from it, like java.

MackTracker
Posts: 3
Joined: Fri, 1. Sep 06, 05:16

Post by MackTracker » Sun, 3. Sep 06, 02:33

True that, forgive me then. My native language is C/C++. :lol: cheers mate!

Oh and XML uses both "=" & "=="
Their is one in all!

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22197
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Sun, 3. Sep 06, 02:52

yeah mine is c++ as well. but i had to use other languages while i was at collage, unfortuatlly

Gouranga Man
Posts: 27
Joined: Sun, 19. Dec 04, 16:21
xr

Post by Gouranga Man » Thu, 7. Sep 06, 17:44

thank you very much for this I havent read it but i will, love the disclaimer by the way.

"but you just got to put something in like this these days to protect you from stupid stuff. E.g., my cat died cos I forgot to feed it as I spent 2 days learning to script, so I'm going to sue you…"
Nils Illigitimi Carberundumb, Nirvana, Gouranga

Post Reply

Return to “X²: The Threat - Scripts and Modding”