Seeking advice on learning how to script.
Moderators: Moderators for English X Forum, Scripting / Modding Moderators, Moderators for the X3:FL Forums
Seeking advice on learning how to script.
As the title says, I am looking for some guidance on scripting from the beginning. There are lots of resources on the topic and I am looking for an updated list of what I need to get started, for instance:
- the best tool for creating/editing scripts
- is the MSCIHandbook still a valid reference?
- 7zip for unpacking pck files?
- Notepad + good for viewing/editing xml files?
Having said that, my end goal is not to create anything groundbreaking but rather to edit some already existing script or maybe make some hotkey to some command (like turret config for ex.) so if there are some guides that could be helpful I would be interested in knowing about them.
I am looking specifically at Farnham Legacy and as I already mentioned I need to start at the very beginning.
- the best tool for creating/editing scripts
- is the MSCIHandbook still a valid reference?
- 7zip for unpacking pck files?
- Notepad + good for viewing/editing xml files?
Having said that, my end goal is not to create anything groundbreaking but rather to edit some already existing script or maybe make some hotkey to some command (like turret config for ex.) so if there are some guides that could be helpful I would be interested in knowing about them.
I am looking specifically at Farnham Legacy and as I already mentioned I need to start at the very beginning.
Re: Seeking advice on learning how to script.
First thing, you should be away there are actually 2 types of scripts in the game. The MSCI and MD scripts.
the MD (Mission Director) scripts are editing in xml format, and is event driven. Primary used for missions and plots.
Then MSCI is used for everything else like the ships ai, ship commands/upgrades, UI/Menu etc.
While MSCI stores the script in XML, its not really editable directly as the xml isn't human readable.
For that you can need to use a specific editor. Theres the script editor built into the game, but also several external editors available as well.
The MSCI handbook is for X2, so it doesn't include alot of things that have been added later, but it should give you most of the basics.
my site has a few simple guide for basic scripting, its based on X3 Reunion so will look slightly different but functions in the same way
https://xpluginmanager.co.uk/scripts/help/index.html
for hotkeys specifically, these have been improved since the guide was written, in AP a hotkey manager was added internally, so you no longer need to check and store the key id.
And in FL the hotkeys have been expanded with Event scripts, as well as allowing you to put the hotkeys anywhere in the controls menu (previous games all custom hotkeys were in the same place)
the MD (Mission Director) scripts are editing in xml format, and is event driven. Primary used for missions and plots.
Then MSCI is used for everything else like the ships ai, ship commands/upgrades, UI/Menu etc.
While MSCI stores the script in XML, its not really editable directly as the xml isn't human readable.
For that you can need to use a specific editor. Theres the script editor built into the game, but also several external editors available as well.
The MSCI handbook is for X2, so it doesn't include alot of things that have been added later, but it should give you most of the basics.
my site has a few simple guide for basic scripting, its based on X3 Reunion so will look slightly different but functions in the same way
https://xpluginmanager.co.uk/scripts/help/index.html
for hotkeys specifically, these have been improved since the guide was written, in AP a hotkey manager was added internally, so you no longer need to check and store the key id.
And in FL the hotkeys have been expanded with Event scripts, as well as allowing you to put the hotkeys anywhere in the controls menu (previous games all custom hotkeys were in the same place)
Re: Seeking advice on learning how to script.
Ok, so if I understand correctly, for my needs I should be looking into MSCI and since I need to start at the very beginning the handbook should be a good asset, should I actually manage to do some progress I can then look at more recent additions.
I have seen your page and I had already bookmarked it, as indeed I intend to look at some of your scripts with the hope of understanding how they work but only when I actually have a grasp of the basics of their contents. One thing that I am asking is if now you still use the ingame editor to write scripts or if nowadays other programs are more user friendly.
I apologize for my ignorance on the subject and the apparent stupidity of my queries but from my perspective things are quite complicated.
I have seen your page and I had already bookmarked it, as indeed I intend to look at some of your scripts with the hope of understanding how they work but only when I actually have a grasp of the basics of their contents. One thing that I am asking is if now you still use the ingame editor to write scripts or if nowadays other programs are more user friendly.
I apologize for my ignorance on the subject and the apparent stupidity of my queries but from my perspective things are quite complicated.
Re: Seeking advice on learning how to script.
Myself, I learned it by looking at already existing mods. I analyzed what they do and how. Then I started making little changes and play tested them. The program X-studio X-studio made by Mr. Bear is helpful. Because you have built in descriptions of the commands. And a syntax checker too.
Re: Seeking advice on learning how to script.
Thank you Nico, that is what I had in mind and I actually already did have a look at some but I could not make any sense of the code, no surprises there since I have never studied the language used in them. I am going to try again but this time I'll do it with some reference to hopefully give me a better chance.
I have read that the original XStudio is not compatible with Farnham Legacy but there are 2 alternative versions which are, thanks for the heads up.
Re: Seeking advice on learning how to script.
Well, 'not compatible' refers to the new commands that were introduced by FL. True. Up to Albion Prelude, all commands are supported afaik. It will not let you type new commands, because some error will pop up and will not let you save the script you are writing. Would be cool if Mr. Bear would weak up from his long winter sleep and implement the new commands. Mr Bear? Hello?
Re: Seeking advice on learning how to script.
If I understand correctly it has been done already, at least to some extent, check these two posts and see if it is so.
viewtopic.php?f=201&t=444078 X-Studio FL
viewtopic.php?f=201&t=439195 X-Studio 2 for FL