X-Studio Script Editor - unofficial update for X3FL

The place to discuss scripting and game modifications for X³: Farnham's Legacy

Moderators: Moderators for English X Forum, Scripting / Modding Moderators, Moderators for the X3:FL Forums

Deniskos
Posts: 153
Joined: Wed, 11. Jun 08, 21:40
x4

Re: X-Studio Script Editor - unofficial update for X3FL

Post by Deniskos » Mon, 10. Apr 23, 08:05

:arrow: X-Studio-v1.08_X3FL-v1.3.5
- added all new commands from Unoffical Patch : V1.3.5
- changes made to all old commands

All new commands from Unoffical Patch : V1.3.5 have been added to the Farnham's Legacy Commands section of the editor.

User avatar
Aldebaran_Prime
Posts: 1386
Joined: Sat, 20. Feb 10, 17:47
x4

Re: X-Studio Script Editor - unofficial update for X3FL

Post by Aldebaran_Prime » Mon, 10. Apr 23, 12:31

Deniskos wrote:
Mon, 10. Apr 23, 08:05
:arrow: X-Studio-v1.08_X3FL-v1.3.5
- added all new commands from Unoffical Patch : V1.3.5
- changes made to all old commands

All new commands from Unoffical Patch : V1.3.5 have been added to the Farnham's Legacy Commands section of the editor.
Great! Thanks for your ongoing engagement for this great piece of software! :)
:x3:

Deniskos
Posts: 153
Joined: Wed, 11. Jun 08, 21:40
x4

Re: X-Studio Script Editor - unofficial update for X3FL

Post by Deniskos » Fri, 14. Apr 23, 20:53


User avatar
Joubarbe
Posts: 4796
Joined: Tue, 31. Oct 06, 12:11
xr

Re: X-Studio Script Editor - unofficial update for X3FL

Post by Joubarbe » Mon, 8. May 23, 15:15

Thank you Deniskos. Are you aware of the "foreach" macro problem? Quote from Cycrow: basically using the array command, $value = $array[$i] doesn't work, which is what the foreach macro uses, instead you have to use the $value = get array value... command

On a second note, and because I guess you know the source code of X-Studio, do you think it would be possible to have all macros externalized, like the syntax, through a "custom macros" text file? It would be great to be able to define our own macros. It would change everything actually :)

Deniskos
Posts: 153
Joined: Wed, 11. Jun 08, 21:40
x4

Re: X-Studio Script Editor - unofficial update for X3FL

Post by Deniskos » Mon, 8. May 23, 18:13

Hi Joubarbe!
To be honest, I do not see the point in these macros.
Why are you not satisfied with the standard X3 syntax .. For so many years, I have long been accustomed to it)
Further development of the macro system requires desire and a lot of time. It would probably be better to contact mr.bear.

User avatar
Joubarbe
Posts: 4796
Joined: Tue, 31. Oct 06, 12:11
xr

Re: X-Studio Script Editor - unofficial update for X3FL

Post by Joubarbe » Wed, 17. May 23, 11:21

Sorry for the delay, didn't see your reply before. Well, MSCI being extremely verbose and having no functions, plus the fact that we very often type the same sequence of lines, macros would be a nice hack to have. I know macros are dirty, but MSCI is dirty too, so for me, it would change a lot (I would make A TON of them).

Anyway, don't bother about it :) Could you maybe fix the foreach one? If not, there are some commands in the latest patches that are worth integrating into X-Studio. I know you can add them through custom syntax file, but you have the whole thing already setup to make proper integration :) Thanks for your work!

Deniskos
Posts: 153
Joined: Wed, 11. Jun 08, 21:40
x4

Re: X-Studio Script Editor - unofficial update for X3FL

Post by Deniskos » Wed, 17. May 23, 18:11

Updated the editor to X-Studio-v1.08_X3FL-v1.3.8.
Updated archive.
Added new script commands
Show

Code: Select all

3213 - <RefObj> clear sector objects
3214 - <RefObj> remove sector wreck: <Value>
3215 - load universe map: <Var/String>
3216 - <RefObj> set override comm range: <Var/Number>
3217 - <RetVar/IF> <RefObj> get override comm range
3218 - <RefObj> set sector text id: <Var/Number>
3219 - <RefObj> set sector description id: <Var/Number>
3220 - <RefObj> clear all wrecks
3221 - <RetVar/IF> <RefObj> has sector fog of war
3222 - <RefObj> set sector fog of war: <Var/Boolean>
3223 - <RetVar/IF> <RefObj> is sector always jumpable
3224 - <RefObj> set sector always jumpable: <Var/Boolean>
3225 - add script selection option: name=<Var/String>, pageid=<Var/Number>, textid=<Var/Number>, options=<Var/Array>, default=<Var/Number>
3226 - add script selection option: name=<Var/String>, pageid=<Var/Number>, textid=<Var/Number>, options=<Var/Array>, default=<Var/Number>, callback script=<Script Name>
3227 - remove script selection option: name=<Var/String>
3228 - <RetVar> get script selection value: name=<Var/String>
3229 - <RetVar> get all script selection options
3230 - set script selection option: name=<Var/String>, value=<Var/Number>
3231 - add script selection option: name=<Var/String>, pageid=<Var/Number>, textid=<Var/Number>, options=<Var/Array>, default=<Var/Number>, callback scriptname=<Var/String>
3232 - add object info menu: class=<Var/Class>, script=<Script Name>, prio=<Var/Number>
3233 - add object info menu: class=<Var/Class>, scriptname=<Var/String>, prio=<Var/Number>
3234 - remove object info menu: class=<Var/Class>, script=<Script Name>
3235 - remove object info menu: class=<Var/Class>, scriptname=<Var/String>
3236 - <RetVar/IF> get files in directory: <Var/String> search pattern=<Var/String>
Changed old script commands
Show

Code: Select all

2351 - <RetVar> register hotkey event script: script=<Script Name>, type=<Var/Number>, page id=<Var/Number>, text id=<Var/Number>, key=<Var/Number>
2352 - <RetVar> register hotkey: script=<Script Name>, type=<Var/Number>, page id=<Var/Number>, text id=<Var/Number>, menu=<Var/Boolean>, key=<Var/Number>
2353 - <RetVar> register hotkey event script: scriptname=<Var/String>, type=<Var/Number>, page id=<Var/Number>, text id=<Var/Number>, key=<Var/Number>
2354 - <RetVar> register hotkey: scriptname=<Var/String>, type=<Var/Number>, page id=<Var/Number>, text id=<Var/Number>, menu=<Var/Boolean>, key=<Var/Number>
For Cycrow:
Commands are not correctly written in the text file 0001-L044.xml:

Code: Select all

<t id="3221">%0%1 has sector fog of war</t> -> <t id="3221">%1%0 has sector fog of war</t>
<t id="3223">%0%1 is sector always jumpable</t> -> <t id="3223">%1%0 is sector always jumpable</t>

Deniskos
Posts: 153
Joined: Wed, 11. Jun 08, 21:40
x4

Re: X-Studio Script Editor - unofficial update for X3FL

Post by Deniskos » Wed, 17. May 23, 18:15

Joubarbe wrote:
Wed, 17. May 23, 11:21
Could you maybe fix the foreach one?
I'll try, but a little later. Now I post only new commands.


User avatar
Joubarbe
Posts: 4796
Joined: Tue, 31. Oct 06, 12:11
xr

Re: X-Studio Script Editor - unofficial update for X3FL

Post by Joubarbe » Fri, 19. May 23, 16:14

There seems to be a problem with the FL command "send incoming message":

Code: Select all

IDS_SCRIPT_COMMAND_TRANSLATION_FAILED: Could not translate the standard script command 'send incoming message 'String' to player: type:0, display it=[Boolean], log it=[Boolean]' (ID:203) on line 515 (XML line 5084)
IDS_SCRIPT_COMMAND_NODE_COUNT_MISMATCH: The command has an inappropriate number of child <sourcevalue> tags
IDS_SCRIPT_COMMAND_NODE_COUNT_INCORRECT: The command should have 9 child nodes but 7 were detected
IDS_ERROR_APPEND_LOCATION: verifyCommandChildNodeCount(..) has encountered an IDS_SCRIPT_COMMAND_NODE_COUNT_INCORRECT error (ID: 0286) in Script Translation (XML).cpp, line 948
Example script: !ship.cmd.mtc.bestsell.pl.pck

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

Re: X-Studio Script Editor - unofficial update for X3FL

Post by Cycrow » Fri, 19. May 23, 17:25

Im guessing this is because that command has had an additional argument added in the the unofficial patch, and some of the scripts are using the old version.

you may have to just edit that file in the internal editor, simply deleting the command and replacing it with the adjusted version
The game and internal editor can handle missing arguments fine

Deniskos
Posts: 153
Joined: Wed, 11. Jun 08, 21:40
x4

Re: X-Studio Script Editor - unofficial update for X3FL

Post by Deniskos » Fri, 19. May 23, 18:47

Yes, there's nothing you can do about it.
You are trying to open a script from an older version of the game engine. The old command is missing the "type:0 and log it=[Boolean]" arguments
Spoiler
Show

Code: Select all

<?xml version="1.0" standalone="yes" ?>
<?xml-stylesheet href="x2script.xsl" type="text/xsl" ?>
<script>
<name>!ship.cmd.mtc.bestsell.pl</name>
<version>1</version>
<engineversion>40</engineversion>
<description>Ship Player COMMAND REMOTE BESTSELL</description>
<arguments>
<argument index="1" name="ware" type="Var/Ware of Ship" desc="Select a ware" />
<argument index="2" name="range" type="Var/Number" desc="Maximum Jump Range" />
</arguments>
<sourcetext>
<line linenr="001" indent=""><comment><text>*&#160;</text><var>Created&#160;by&#160;Xai&#160;Corporation</var></comment></line>
<line linenr="002" indent=""><comment><text>*&#160;</text><var>Manual&#160;Trade&#160;Command</var></comment></line>
<line linenr="003" indent=""><comment><text>*&#160;</text><var></var></comment></line>
<line linenr="004" indent=""></line>
<line linenr="005" indent=""><comment><text>*&#160;</text><var>find&#160;best&#160;price&#160;for&#160;ware</var></comment></line>
<line linenr="006" interruptable="@" indent=""><var>$msg&#160;=&#160;</var><var>[THIS]&#160;-&gt;</var><text>&#160;call&#160;script&#160;</text><call>!ship.cmd.mtc.bestsell.std</call><text>&#160;:&#160;</text><text>&#160;Select&#160;a&#160;ware=</text><var>$ware</var><text>&#160;</text><text>&#160;Maximum&#160;Jump&#160;Range=</text><var>$range</var></line>
<line linenr="007" indent=""></line>
<line linenr="008" indent=""><var>if&#160;</var><var>$msg</var></line>
<line linenr="009" interruptable="@" indent="&#160;"><var>=&#160;</var><text>wait&#160;randomly&#160;from&#160;</text><var>500</var><text>&#160;to&#160;</text><var>2000</var><text>&#160;ms</text></line>
<line linenr="010" indent="&#160;"><text>send&#160;incoming&#160;message&#160;</text><var>$msg</var><text>&#160;to&#160;player:&#160;display&#160;it=</text><var>[FALSE]</var></line>
<line linenr="011" indent="&#160;"><var>skip&#160;if&#160;</var><var>[DOCKEDAT]</var></line>
<line linenr="012" interruptable="@" indent="&#160;&#160;"><var>$ware&#160;=&#160;</var><var>[THIS]&#160;-&gt;</var><text>&#160;call&#160;script&#160;</text><call>!lib.nav.switch</call><text>&#160;:&#160;</text><text>&#160;Target=</text><var>null</var><text>&#160;</text><text>&#160;Range=</text><var>null</var><text>&#160;</text><text>&#160;Sector&#160;Position=</text><var>null</var></line>
<line linenr="013" indent=""><text>end</text></line>
<line linenr="014" indent=""><text>return&#160;</text><var>null</var></line>
</sourcetext>
This command must be entered in its new version.

Code: Select all

send incoming message $msg to player: type:0, display it=[FALSE], log it=[FALSE]

User avatar
Joubarbe
Posts: 4796
Joined: Tue, 31. Oct 06, 12:11
xr

Re: X-Studio Script Editor - unofficial update for X3FL

Post by Joubarbe » Fri, 19. May 23, 19:20

Ok I thought it was a complete new command. No problem. :)

FriendlyFirePhoenix
Posts: 90
Joined: Tue, 14. Feb 17, 10:06
x3ap

Re: X-Studio Script Editor - unofficial update for X3FL

Post by FriendlyFirePhoenix » Thu, 1. Jun 23, 15:56

Joubarbe wrote:
Wed, 17. May 23, 11:21
Anyway, don't bother about it :) Could you maybe fix the foreach one
I'll second the call for the foreach command. I didn't even realise foreach was a macro until X-Studio flipped out on me when I tried saving a script I'd updated for FL. While loops make me sad in the head.

That said, thanks for the update. The in-game editor is pretty cumbersome even with FL's improvements so it was nice to go back to X-Studio.
I made a couple of X3 mods | Colour By Race | True Relations

User avatar
N8M4R3
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 399
Joined: Fri, 24. Nov 06, 15:48
x4

Re: X-Studio Script Editor - unofficial update for X3FL

Post by N8M4R3 » Sat, 10. Jun 23, 16:43

Hi Deniskos,
thank you for the continuous updates of the X-Studio for FL!

I've noticed that there is a problem when the program interface is switched to german and you want to set the game directory. Then there isn't a FL Option to choose from available. Only the four options till to AP are available. But if you set the game directory with the english interface before and then switch to german interface, it seems to work. It's not a big thing when you know about it and i also don't really need a german interface personally but maybe you can fix this or disable the option to switch the interface language that no one else ran into this thing.
Neue Erweiterung für X3 verfügbar: Farnham's Legacy | +Optional: weitere Verbesserungen im inoffiziellen Patch v1.3.14 *** Modified*** :khaak: :thumb_up:
Diese Woche im Angebot: HUD-GUI-Mix (FL) | Text-DB 0001-L049 (FL) | Textkorrekturen & Verbesserungen (FL)
Weitere Veröffentlichungen hier: N8workX
Nützliches Tool für nicht mehr vorhandene Downloads: web.archive.org
Externes Archiv für MOD/SCR Ressourcen: xdownloads.co.uk | code.google.com/archive/p/x3tcscripts/

Deniskos
Posts: 153
Joined: Wed, 11. Jun 08, 21:40
x4

Re: X-Studio Script Editor - unofficial update for X3FL

Post by Deniskos » Wed, 21. Jun 23, 11:38

Hello!
This is not only my merit. Cycrow has been very helpful.
Together with the next update I will post the source code, maybe someone will take it and fix the macro system. But everything is very difficult there.

User avatar
Hairless-Ape
Posts: 321
Joined: Wed, 6. Nov 02, 20:31
xr

Re: X-Studio Script Editor - unofficial update for X3FL

Post by Hairless-Ape » Fri, 25. Aug 23, 23:38

I've tried X-Studio-v1.08_X3FL-v1.3.8, and also another version of X-Studio for FL made by Cycrow and the first thing I tried to view for either was \addon2\scripts\!patch.pck.
In both cases, I get a bunch of "<Unrecognised Command>" lines just before the bottom.
Then I looked at \addon2\scripts\!setup.x3fl.pck and it showed quite a few mis-formatted lines that all start with "register hotkey ....". The editor highlights these lines as being incorrect format.


I'm wondering if there's an updated Custom.Syntax.txt file I should be using?


Or perhaps there's a better tool to use for FL other than X-Studio?
Perhaps visual studio is better?

Welcome all opinions.

Thanks.
Out of my mind. Back in 5 minutes.

Deniskos
Posts: 153
Joined: Wed, 11. Jun 08, 21:40
x4

Re: X-Studio Script Editor - unofficial update for X3FL

Post by Deniskos » Sun, 27. Aug 23, 18:37

Hairless-Ape wrote:
Fri, 25. Aug 23, 23:38
I've tried X-Studio-v1.08_X3FL-v1.3.8, and also another version of X-Studio for FL made by Cycrow and the first thing I tried to view for either was \addon2\scripts\!patch.pck.
In both cases, I get a bunch of "<Unrecognised Command>" lines just before the bottom.
This version does not display commands from the latest game patch, such as:

Code: Select all

<t id="3252">%0set capital sector: %1</t>
Hairless-Ape wrote:
Fri, 25. Aug 23, 23:38
Then I looked at \addon2\scripts\!setup.x3fl.pck and it showed quite a few mis-formatted lines that all start with "register hotkey ....". The editor highlights these lines as being incorrect format.
I normally open this script, no problems.

Deniskos
Posts: 153
Joined: Wed, 11. Jun 08, 21:40
x4

Re: X-Studio Script Editor - unofficial update for X3FL

Post by Deniskos » Sun, 27. Aug 23, 19:44

Updated editor to version X-Studio-v1.08_X3FL-v1.3.10
Added all new commands from [MOD] Unoffical Patch : V1.3.10 : 2023-07-01
Spoiler
Show

Code: Select all

<t id="3237">%0get random face: race=%1, subrace=%2, female=%3</t>
<t id="3238">%0add face: id=%1, female=%2, subrace=%3</t>
<t id="3239">%0remove face: id=%1, female=%2, subrace=%3</t>
<t id="3240">%1%0get faces: female=%2, subrace=%3</t>
<t id="3241">%1%0get face from id: %2, female=%3, subrace=%4</t>
<t id="3242">%0 %1 &lt;&lt; %2</t>
<t id="3243">%0 %1 &gt;&gt; %2</t>
<t id="3244">%0get matrix from angles: alpha=%1, beta=%2, gamma=%3</t>
<t id="3245">%0get angles from vector: x=%1, y=%2, z=%3</t>
<t id="3246">%0get angles from matrix: %1</t>
<t id="3247">%0matrix multiple: %1 * %2</t>
<t id="3248">%0matrix multiple inverse: %1 * %2</t>
<t id="3249">%0rotate vector: %0, alpha=%1, beta=%2</t>
<t id="3250">%0rotate vector inverse: %0, alpha=%1, beta=%2</t>
<t id="3251">%1%0is capital sector</t>
<t id="3252">%0set capital sector: %1</t>

User avatar
Hairless-Ape
Posts: 321
Joined: Wed, 6. Nov 02, 20:31
xr

Re: X-Studio Script Editor - unofficial update for X3FL

Post by Hairless-Ape » Mon, 28. Aug 23, 03:23

I loaded up V1.3.10 you just published and tried again.

While it seems able to load "!setup.x3fl.pck" ok this time and shows no errors at that moment (which is great). However,
if I do something as simple as add 1 blank line and try to save the modified file, it gives syntax errors.

Compiling MSCI script '!setup.x3fl.pck'
Checking syntax of commands in '!setup.x3fl' and their compatibility with X3 Farnham's Legacy
Unrecognized or incompatible script command on line 34 : '$st = $st.ex[$i]'
Unrecognized or incompatible script command on line 98 : '$sector = $sectors[$i]'
more...
Compilation aborted due to syntax errors in script commands

My Application Preferences show it is properly set to X3 Farnham's Legacy and it recognizes the proper \adon2\scripts folder.
Perhaps I'm missing something?
Out of my mind. Back in 5 minutes.

Post Reply

Return to “X³: Farnham's Legacy - Scripts and Modding”