- Tutorial 1: New X² Commands - Connect a script to X²'s Menu
How to link a script into the normal Nav, Trade, Combat, etc. menuing system in X².
Example script: "Trade->Maintain product quantities..." command. A command to cause a ship to attempt to maintain a constant quantity of products in stock in its home factory. - Tutorial 2: Adding new command extension wares to X²
How to create new wares, how to distribute them among stations, and how to integrate new commands with new wares.
Example script: Create the ware "Hire Gunnery Crew" which will activate the turret command "Man turrets with gun crews". This ware will be used with a script developed in Tutorial 4. - Tutorial 3: Creationism Revisited: How to change the X Universe
How to create planets, nebulas, gates, asteroids, factories, and ships.
Example script: Create random asteroids coming from the planet Shipfall (the planet that is breaking up in Power Circle) and move them out and through the trading grid area. - Tutorial 4: Flight mechanics and combat: Custom combat scripts and more.
The actual tutorial was never written - instead, get the MSCI Programmer's Handbook from the downloads section.
Example script: Hired Gunnery Crews - an advanced turret AI. This script will change weapons to suit the target and conditions. IE: Use PSGs (if able to) if no friendlies are around, use mass drivers against incoming missiles, won't target incoming missiles if shields are above a certain percent and it's a weak missile, etc.
Note: This evolved into a signed "bonus plugin" script. Download from the X² downloads page. - Tutorial 5: Interrupts & Signals
Superceded by the MSCI Programmer's Handbook - Tutorial 6: Process control, init scripts, and other internal workings of the scripting system.
Superceded by the MSCI Programmer's Handbook - X² Math library - fixed point decimal & trig functions
A scripted X² math library and tutorial on how to use it to duplicate the functionality of floating-point variables. Includes sine and cosine functions.
Scripting Tutorials
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
Scripting Tutorials
Most of the material in the below tutorials is now in the MSCI Programmer's Handbook. Tutorial 2 is the only one with any material not in the book. The tutorials may still be useful, however, as they contain more in-depth examples than the book has.
Last edited by Reven on Mon, 13. Dec 04, 05:08, edited 5 times in total.
You were warned... pirates will be hunted down like vermin.
Ex Turbo Modestum
Ex Turbo Modestum
- Argonaught.
- Posts: 1827
- Joined: Wed, 6. Nov 02, 20:31
Yea I vote for stickying this one....soon I shall be able to script a thing into X2.....Don't ask me what thing, as it has no name.
[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: 55
- Joined: Sat, 24. Jan 04, 12:21
I just started playing the game last week, and was so very happy to find the scripting support here. So much excellent work, I just hope I can make some contribution.
First though, I must learn how. Reven, your first 2 tutorials and the extra stuff you've posted about scripting (the Ore Belt Colossus prod, for instance) have helped me a lot.
I can't wait for the next tutorials!
Zelig
First though, I must learn how. Reven, your first 2 tutorials and the extra stuff you've posted about scripting (the Ore Belt Colossus prod, for instance) have helped me a lot.
I can't wait for the next tutorials!
Zelig
I maybe shouldn't have asked for a sticky for this - it means I actually have to do the rest now.
@ZeligtheLiar: Thanks. Glad it's helped. The next one is in progress - I'm hoping it will be ready tonight. Depends on how much time the wife leaves me.
@ZeligtheLiar: Thanks. Glad it's helped. The next one is in progress - I'm hoping it will be ready tonight. Depends on how much time the wife leaves me.
You were warned... pirates will be hunted down like vermin.
Ex Turbo Modestum
Ex Turbo Modestum
-
- Posts: 153
- Joined: Thu, 8. Jan 04, 20:05
I'm getting into writing some trade scripts that use Jump. Yeah I know its been done already, but I want to use my own scripts. It feels less like cheating if I make it myself .
Thanks for the push in the right direction Rev, that helped me get started. I popped open a few of EGO's .pck's and picked up on the scripting. Your tut, taught me how to make it show up in the game, thanks bud
Thanks for the push in the right direction Rev, that helped me get started. I popped open a few of EGO's .pck's and picked up on the scripting. Your tut, taught me how to make it show up in the game, thanks bud
-
- Posts: 55
- Joined: Sat, 24. Jan 04, 12:21
Hey Reven. I've been looking through a few of the scripts, hoping to teach myself how to write them by working out how to read them first. I actually have a few little things I'd like to write myself once I get "there". Nothin' grandiose, nothin' amazin'. Jus' a few little things I think would make life easier, and I don't mean massive ships with flaming guns. I'll post on that when I'm done, or before then if anyone wants to know...
Anyway, what I wanted to say was that while looking through some of the scripts I think I may have found two typos in the Tutorial 1 script ship.cmd.maintainprod.xml - One is just a spelling error (I think) but the other looks like it would be a script-crashing bug.
Line 018 - The message 'Not enough room onboard to hold and %s' - Should that "and" be "any"?
Line 051 - Variable "$Freespace" at the start of the line... should that be "$Message"?
Thanks again Reven!
Anyway, what I wanted to say was that while looking through some of the scripts I think I may have found two typos in the Tutorial 1 script ship.cmd.maintainprod.xml - One is just a spelling error (I think) but the other looks like it would be a script-crashing bug.
Line 018 - The message 'Not enough room onboard to hold and %s' - Should that "and" be "any"?
Line 051 - Variable "$Freespace" at the start of the line... should that be "$Message"?
Thanks again Reven!
- red assassin
- Posts: 4613
- Joined: Sun, 15. Feb 04, 15:11
- Argonaught.
- Posts: 1827
- Joined: Wed, 6. Nov 02, 20:31
Yes...I think he did considering Egosoft won't do the tutorials or release them...or give us any info on them....bloody shame that.....I used to think they actually cared what the X Gamer thought.red assassin wrote:He probably ran away to avoid having to do the rest of the tutorials .
[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
I've unstickied this in favour of this Scripting / Modding Tutorials and Resources list, which includes a link to this thread as well as a number of other useful ones.
Updated (at last) with Tutorial 3.
Tutorial 4 will be out in a day or two - this is a for sure, as I just bought a Titan and I really want the updated turret script for myself anyways.
After that, I'll reevaluate tutorials 5 and 6 to see if they are still necesary, or if existing documentation covers those topics.
Tutorial 4 will be out in a day or two - this is a for sure, as I just bought a Titan and I really want the updated turret script for myself anyways.
After that, I'll reevaluate tutorials 5 and 6 to see if they are still necesary, or if existing documentation covers those topics.
You were warned... pirates will be hunted down like vermin.
Ex Turbo Modestum
Ex Turbo Modestum
Obviously it was more than a day or two. The X² MSCI Programmer's Handbook combined with the newly signed Gunnery Crews "bonus plugin" finally lay to rest the remainder of my commitment made so long ago in this thread's original post. All the topics covered in the unfinished tutorials are covered in the book. I've edited the original post a little to reflect that.
In the next few days I'll go over the four tutorials and update them a little to make sure they are still accurate.
In the next few days I'll go over the four tutorials and update them a little to make sure they are still accurate.
You were warned... pirates will be hunted down like vermin.
Ex Turbo Modestum
Ex Turbo Modestum
-
- Posts: 5145
- Joined: Mon, 23. Feb 04, 01:28
Many thanks,Reven.Reven wrote:Obviously it was more than a day or two. The X² MSCI Programmer's Handbook combined with the newly signed Gunnery Crews "bonus plugin" finally lay to rest the remainder of my commitment made so long ago in this thread's original post. All the topics covered in the unfinished tutorials are covered in the book. I've edited the original post a little to reflect that.
In the next few days I'll go over the four tutorials and update them a little to make sure they are still accurate.
Tinker
"If engineers built buildings the way programmers write programs, the first woodpecker that came along would destroy civilization!"
"If engineers built buildings the way programmers write programs, the first woodpecker that came along would destroy civilization!"
Hi all. This is a great little tut set (wish the Gunnery Crews tut was done tho). I've got a smidge of scripting skills for IRC (I know, it's not X) and trying to do an init script.... I can't find the "Player" variable for race... how do you get to it? I go into the 'select race' category but I don't see "Player" anywhere.