A guide to scripting - Ready at last!

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

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

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: 20544
Joined: Mon, 15. Nov 04, 00: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: 20544
Joined: Mon, 15. Nov 04, 00: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, 17: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

BattleCommando
Posts: 1
Joined: Wed, 9. Jan 08, 04:11

Post by BattleCommando » Thu, 10. Jan 08, 05:44

Small problem... link is broken now as x2source is hosed... :evil:

Phrathum
Posts: 39
Joined: Wed, 7. Mar 07, 10:11

Post by Phrathum » Sat, 26. Jan 08, 04:00

Does anybody have a copy of this guide they'd be willing to e-mail to me?
Image

firefly28
Posts: 208
Joined: Mon, 14. Jan 08, 17:50
x3tc

Post by firefly28 » Wed, 6. Feb 08, 20:22

Yeah the site is giving sql errors.

On a lighter note - nice inspirational thread LV :)
"Freedom is a rich mans dish, a poor mans illusion" :: Firefly28
Cool browser game: http://firefly28.mybrute.com

Buck_Rogers
Posts: 1462
Joined: Tue, 21. Dec 04, 00:23
x3

Post by Buck_Rogers » Thu, 3. Apr 08, 22:11

anyone have a copy of this?
Buck Rogers

Vice Admiral of Shadows Haven Alliance (SHA) visit us at:
SHA Forum
Feel free to join my DID
Too often we lose sight of life's simple pleasures. Remember, when someone annoys you, it takes 42 muscles in your face to frown. But only 4 to extend your arm and slap the bugger!

znix77
Posts: 5
Joined: Tue, 22. Apr 08, 13:54
x4

Post by znix77 » Mon, 12. May 08, 13:37

Hi, any possibility of getting a copy of the scripting guide? Am just starting out so would be great to start reading up :) Thanks!

mstrkaratakus
Posts: 1
Joined: Thu, 24. Apr 08, 06:28
x3

Post by mstrkaratakus » Sun, 1. Jun 08, 19:34

Its funny how this game keeps going, even after X3 has come out and been running wild for awhile. I blame it on Gametap! I hadn't even heard of this game until I found it there. Then I had download it from direct2drive so I could actualy play a version I could run scripts on. You guys got me hooked. Now I need to learn to script myself and I really would LOVE to have a copy of this guide. If anyone has it hidden away in some dark corner of their hard drive, or has a link to it somewhere, I would be most appreciative if you could suppy me with said files or link. PM me and I'll supply an email addy :) Thanks in advance to anyone who can help, and a HUGE thank you to all those who have worked so hard at the scripts I'm already running in my games.

rkrisher
Posts: 22
Joined: Tue, 10. Jun 08, 02:50
x4

Post by rkrisher » Sat, 21. Jun 08, 00:31

I can't find anyones e-mail address or I'd send it. I have the Linux version of X2 It came with a mod kit to extract the scripts from the archive files and place them in the right directories and two docs, one for script editing and one for Galaxy editing. They should work for you winduhhs people too.

lutorm
Posts: 5
Joined: Wed, 12. Nov 08, 22:47

Post by lutorm » Wed, 19. Nov 08, 19:49

Me too. You start clicking the X3TC tutorial pages to X3 tutorial to X2 tutorial and you end up looking for this guide which is the point of origin for learning about scripting. And it's gone. Can someone put it at an accessible location? Please?

kel187
Posts: 15
Joined: Thu, 22. Nov 07, 03:35
x3tc

Post by kel187 » Fri, 21. Nov 08, 19:17

lutorm wrote:Me too. You start clicking the X3TC tutorial pages to X3 tutorial to X2 tutorial and you end up looking for this guide which is the point of origin for learning about scripting. And it's gone. Can someone put it at an accessible location? Please?
i absolutely agree with lutorm. we want to learn scripting, and instead of bothering the experienced scripters, we followed the tutorials, to find out that x3tc SE is very similar to x3r SE. and then, second aha, we found out that x3r SE is very close to x2 SE. and then you land here, where noobs as me should start, and finding nothin'.....

sorry, i'm just a lil' bit frustrated, i didnt want to offend someone, just releasing some pressure....
"79 bitte 28"

baubsmyth
Posts: 66
Joined: Sat, 5. Nov 05, 07:34
xr

Post by baubsmyth » Sat, 22. Nov 08, 00:54

The Community Plugins sticky has links to tools & documents, as well as mods & scripts. If you look at the bottom of the first post you will see that Moggy2 provides a link to "the scripting handbook at Xai Corp". Lot's of fantastic scripting info there.

Post Reply

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