scripting help x3ap

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

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

Gandalf The White
Posts: 2185
Joined: Sat, 9. Nov 02, 12:21
x3

scripting help x3ap

Post by Gandalf The White » Sat, 9. Mar 19, 01:21

hi all,

for those that might not know i'm 1 of the blind players that have started playing this game. i did play these games years ago when i had a little sight but this has since gone.
some time ago, someone started writing some scripts that helped us play the game. i do use these scripts and they work well. they output to a text file certain bits of in game information. i do have these scripts for people to see if they so wish.

but my problem is that the person who was writing these scripts has since stopped developing them sadly. so my request is that if i share these scripts with someone who can write scripts would they be willing to write scripts that will help us? i can share the scripts using dropbox.
the reason why i am saying that i would share these scripts is so that people can see how the currant ones have been written so my hope is that would help them to continue on.
many thanks for reading and i hope someone can help with this.
take care all.
some who deserve life receive death. Others who deserve death receive life. Can you give it to them? Don't be eager to deal out death in judgement, for not even the wise can see all ends.


Xenon_Slayer
EGOSOFT
EGOSOFT
Posts: 13088
Joined: Sat, 9. Nov 02, 11:45
x4

Re: scripting help x3ap

Post by Xenon_Slayer » Sat, 9. Mar 19, 11:40

Joubarbe wrote:
Sat, 9. Mar 19, 08:42
"lol"
If you don't have something constructive to add, why bother posting?

@Gandalf
Do you have a link to the original thread for these helper scripts? It would be good if there was expressed permission from the original author for someone to continue development of their scripts. That said, I think several people have created similar scripts in the past. I did so last year for game data to display in OBS for streaming, so no reason someone can't start from scratch.

Maybe let us know what format the data has to be in and what data you want exported and I expect someone will lend a hand.
Come watch me on Twitch where I occasionally play several of the X games

Gandalf The White
Posts: 2185
Joined: Sat, 9. Nov 02, 12:21
x3

Re: scripting help x3ap

Post by Gandalf The White » Sat, 9. Mar 19, 12:51

hi xenon.

the scripts were never posted here. they were shared through dropbox. the guy has gone off air as it were or so it seems.

basically he exported trade information to a text file. also sector info. by that i mean the sector map. including coords of each stationary object. gates asteroids stations/factories. sadly he couldn't get ships to show up though. that may have been useful especially if there were enemy ships near to your location or your target location.
he also created a hotkey script so as long as you have the trade extension you can hit a key on a targetted station and it would give the trade information. sadly he hadn't worked out a way to make this work with other sectors. by that i mean assuming you have navsats or advanced sats in sectors you couldn't just target a sector and make the script export that information. that would be useful if that were possible.
with the trade script he did, it included the following information:
trade price currant and average. didn't always work though.
volume of product. how much room a single unit of a given commodity takes up in your cargo hold. for example, energy cells volume is 1.
the amount of room in your cargo hold.
your currant location and amount of credits.

the other sorts of information i would need and this wasn't done is factory information. IE profit and loss cycle times etc. unfortunately when i try and run the windows OCR to try and read this with a screen reader it doesn't work.
the biggest problem with these scripts is that they don't display the information in order. by that i mean the order that it's displayed in game. this is a problem when for example you're in an equipment dock and you wish to see what's on offer and for how much, some of the items like the trade command software for example doesn't seem to have a (spoken entry) for it. so it's not like you can look at the trade script information, say ok the thing you want is so many arrow presses down then you're highlighting it.
another problem i'm having is with the mineral scanner. i can't always get the yields and resource type on asteroids to show up with using OCR. so that can take quite a bit of time to scan 1 asteroid. i haven't tried the freight scanner as of yet but i'm assuming that this is going to come up with the same problem.
i would also love to know the currant coords of my ship. so i can determine where abouts in a sector i am and what i am near to. although i'm wondering if a relative textual map can be exported to a file so it shows your currant coords and what is near to you? this would be useful if it were possible.
like i say i can supply the scripts so people can see how the scripts i have were written to work.
thanks again for reading.
some who deserve life receive death. Others who deserve death receive life. Can you give it to them? Don't be eager to deal out death in judgement, for not even the wise can see all ends.

Gandalf The White
Posts: 2185
Joined: Sat, 9. Nov 02, 12:21
x3

Re: scripting help x3ap

Post by Gandalf The White » Sat, 9. Mar 19, 21:38

hi again xenon.
i've just spoken to the guy and he said that's fine feel free to share and adapt.
some who deserve life receive death. Others who deserve death receive life. Can you give it to them? Don't be eager to deal out death in judgement, for not even the wise can see all ends.

User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 24950
Joined: Sun, 2. Apr 06, 16:38
x4

Re: scripting help x3ap

Post by X2-Illuminatus » Sun, 10. Mar 19, 09:29

Then please post a link to the script files, so we can see what needs to be added / improved.
Nun verfügbar! X3: Farnham's Legacy - Ein neues Kapitel für einen alten Favoriten

Die komplette X-Roman-Reihe jetzt als Kindle E-Books! (Farnhams Legende, Nopileos, X3: Yoshiko, X3: Hüter der Tore, X3: Wächter der Erde)

Neuauflage der fünf X-Romane als Taschenbuch

The official X-novels Farnham's Legend, Nopileos, X3: Yoshiko as Kindle e-books!

Gandalf The White
Posts: 2185
Joined: Sat, 9. Nov 02, 12:21
x3

Re: scripting help x3ap

Post by Gandalf The White » Sun, 10. Mar 19, 12:09

some who deserve life receive death. Others who deserve death receive life. Can you give it to them? Don't be eager to deal out death in judgement, for not even the wise can see all ends.

Gandalf The White
Posts: 2185
Joined: Sat, 9. Nov 02, 12:21
x3

Re: scripting help x3ap

Post by Gandalf The White » Sun, 10. Mar 19, 13:15

that address should work. if not then i'll have to try something else.
some who deserve life receive death. Others who deserve death receive life. Can you give it to them? Don't be eager to deal out death in judgement, for not even the wise can see all ends.

User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 24950
Joined: Sun, 2. Apr 06, 16:38
x4

Re: scripting help x3ap

Post by X2-Illuminatus » Sun, 10. Mar 19, 22:27

The link works. However, there are several script packages and files, so hopefully I've downloaded the correct one ("X3TC Accessibility V0.2.zip" with another "X3TC Accessibility V0.2" folder inside).

I made the following changes:
- When changing sectors, logfile 250 now also contains the ships in the current sector. First comes the ship list, afterwards the stationary object list. Both lists are sorted by the distance to the playership. I also added the relation and distance information to each item in that list.

- The hotkey should now write wares bought/sold at a station (including docks, shipyards and factories) in the correct order to logfile 150. I fixed some smaller errors so that volume and price info should be correctly logged now, and I also added the cargo class of each ware.

Download here:
X3TC_Accessibility 0.3.zip
(I hope this works.)

Alternative Download: Click here (Not a direct link though, the actual download link is below the "Thanks for visiting XDownloads, here is your file:" line.)

For Installation: extract to your addon\scripts folder. This will overwrite existing files and add a new one.

Let me know, if this works for you or whether things need to be changed.

-----------------------------

I guess for the other things you mentioned it would be best to add different functionalities to the hotkey depending what target you have selected:
- If no target is selected, write the position of your current ship and distance, position and other ships (and stations?) to a logfile
- If an asteroid is selected, write position, distance, and resource and yield information to a logfile (provided you have a mineral scanner installed)
- If a ship is selected, write its position (and distance), relation and the content of its cargo room to a logfile (provided you have a freight scanner installed)
- If a factory is selected, write its ware information and production information to a logfile

Anything else? Also should this always be the same logfile or different ones? What about restrictions, besides software? (Should freight scanning without law enforcement licence be illegal? Should the mineral and freight scanning be limited in range?)
You do not have the required permissions to view the files attached to this post.
Nun verfügbar! X3: Farnham's Legacy - Ein neues Kapitel für einen alten Favoriten

Die komplette X-Roman-Reihe jetzt als Kindle E-Books! (Farnhams Legende, Nopileos, X3: Yoshiko, X3: Hüter der Tore, X3: Wächter der Erde)

Neuauflage der fünf X-Romane als Taschenbuch

The official X-novels Farnham's Legend, Nopileos, X3: Yoshiko as Kindle e-books!

Gandalf The White
Posts: 2185
Joined: Sat, 9. Nov 02, 12:21
x3

Re: scripting help x3ap

Post by Gandalf The White » Mon, 11. Mar 19, 12:07

absolutely brilliant thank you! that works perfectly. sorry i would have come on sooner accept that i got locked out of my forum account and needed help to get it unlocked. but yes that is great. thanks.
with the sector map script is there a way of linking that to a hotkey so it can be generated at any given time? right now it works only when you enter sectors.
some who deserve life receive death. Others who deserve death receive life. Can you give it to them? Don't be eager to deal out death in judgement, for not even the wise can see all ends.

Gandalf The White
Posts: 2185
Joined: Sat, 9. Nov 02, 12:21
x3

Re: scripting help x3ap

Post by Gandalf The White » Mon, 11. Mar 19, 12:15

with regards to your other ideas i like them. i was wondering could the map for example be split into ships and station logfiles respectively? lol it's a shame those files can't be labled in such a way like it's part of the game readout lol. just for rp purposes :) hahaha.
i didn't realise that you could script a hotkey to perform multiple functions. if that could be done then excellent. so asteroid yield factory yield etc that would work great.
could for example, a script be made to output the text on the hud? so you can see your distants to your target? also for other screens that aren't so easy to read. could a hotkey be scripted to well be pressed in lets say any screen which would then output that screen in textual format in order?
some who deserve life receive death. Others who deserve death receive life. Can you give it to them? Don't be eager to deal out death in judgement, for not even the wise can see all ends.

User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 24950
Joined: Sun, 2. Apr 06, 16:38
x4

Re: scripting help x3ap

Post by X2-Illuminatus » Mon, 11. Mar 19, 20:49

Gandalf The White wrote:
Mon, 11. Mar 19, 12:15
absolutely brilliant thank you!
You're welcome. :)

I made another few changes:

- I separated ship and stationary object list, when logging sector map information. The ship list is written to logfile 249, the stationary object list to logfile 250.

- I added a log with information about the currently targeted asteroid. This only works if the Mineral scanner is installed on your ship.

- The hotkey now logs information depending on the target:
• If no target is selected, it writes the sector map information to logfiles 249 and 250 respectively
• If a station is selected, it writes the ware information, as before, to logfile 150
• If an asteroid is selected, it writes the sector, sector position, resource, yield and distance to the playership to logfile 150

Download here:
X3TC_Accessibility 0.35.zip

Alternative Download: Click here (Not a direct link though, the actual download link is below the "Thanks for visiting XDownloads, here is your file:" line.)

For Installation: extract to your addon\scripts folder. This will overwrite the existing files (whereby only two were changed) and add a new one.

Again, please tell me if this works for you or whether there need to be any changes.

----------------------

I'll try to add the other things like ship cargo information and factory production information in the next days.

Regarding your question about the hud output: That unfortunatly doesn't work. A script cannot know what menu is opened, and it cannot read information from a menu directly. So you will usually have to get the information via other script commands and write them in the desired format to a logfile.
You do not have the required permissions to view the files attached to this post.
Nun verfügbar! X3: Farnham's Legacy - Ein neues Kapitel für einen alten Favoriten

Die komplette X-Roman-Reihe jetzt als Kindle E-Books! (Farnhams Legende, Nopileos, X3: Yoshiko, X3: Hüter der Tore, X3: Wächter der Erde)

Neuauflage der fünf X-Romane als Taschenbuch

The official X-novels Farnham's Legend, Nopileos, X3: Yoshiko as Kindle e-books!

Gandalf The White
Posts: 2185
Joined: Sat, 9. Nov 02, 12:21
x3

Re: scripting help x3ap

Post by Gandalf The White » Mon, 11. Mar 19, 22:40

ok that addition works brilliantly. thank you so much for all you've done so far.
some who deserve life receive death. Others who deserve death receive life. Can you give it to them? Don't be eager to deal out death in judgement, for not even the wise can see all ends.

Gandalf The White
Posts: 2185
Joined: Sat, 9. Nov 02, 12:21
x3

Re: scripting help x3ap

Post by Gandalf The White » Tue, 12. Mar 19, 00:19

another thought to the map script, firstly could the currant coords of your ship be displayed at the top with the sector name? secondly when it comes to other objects could we have stuff like cargo containers also showing or is that not possible?
some who deserve life receive death. Others who deserve death receive life. Can you give it to them? Don't be eager to deal out death in judgement, for not even the wise can see all ends.

Gandalf The White
Posts: 2185
Joined: Sat, 9. Nov 02, 12:21
x3

Re: scripting help x3ap

Post by Gandalf The White » Thu, 14. Mar 19, 22:08

hi again,

just to let you know that your additions are still working and doing well. thank you for all you've done so far. do you have any ideas about the other things?
some who deserve life receive death. Others who deserve death receive life. Can you give it to them? Don't be eager to deal out death in judgement, for not even the wise can see all ends.

User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 24950
Joined: Sun, 2. Apr 06, 16:38
x4

Re: scripting help x3ap

Post by X2-Illuminatus » Fri, 15. Mar 19, 23:23

Sorry, busy week. So only some small changes for now:

- The position of your current ship is now written to logfiles 249 and 250 directly at the beginning, next to the sector name.

- At the end of logfile 250 flying ware containers (i.e. containers in space with a ware inside) are listed, sorted by distance to your ship. The list includes the following information:
• name of the ware in the ware container
• Amount of the ware
• Volume
• Transport class
• Whether you can transport the ware with your ship, and if so how many units you could carry at a max.
• Distance to the ware container, including coordinates.

(The list, including the headline "Container in space", is only logged, if there are actually containers in the current sector. You can test this by throwing something out of your ship's cargo room.)

Download here:
v0.36.zip

Alternative Download: Click here (Not a direct link though, the actual download link is below the "Thanks for visiting XDownloads, here is your file:" line.)

For Installation: extract to your addon\scripts folder. This will overwrite the existing files (whereby only one was changed this time).

Again, please tell me if this works for you or whether there need to be any changes.

Please note: I'm away from tomorrow for a week (Saturday, 16th March, to Saturday, 23th March). I'll look into adding the other things, when I'm back.
You do not have the required permissions to view the files attached to this post.

Gandalf The White
Posts: 2185
Joined: Sat, 9. Nov 02, 12:21
x3

Re: scripting help x3ap

Post by Gandalf The White » Sat, 16. Mar 19, 01:25

hey thanks. i'll test these tomorrow. i'm going to go to bed in a minute or 2. so i don't really want to launch now otherwise i'll lose track of time and oops it's daytime!!!!! so yes i'll test tomorrow and write back.
some who deserve life receive death. Others who deserve death receive life. Can you give it to them? Don't be eager to deal out death in judgement, for not even the wise can see all ends.

Gandalf The White
Posts: 2185
Joined: Sat, 9. Nov 02, 12:21
x3

Re: scripting help x3ap

Post by Gandalf The White » Sun, 17. Mar 19, 00:39

hi there.

just to let you know that i have briefly tested the scripts and they seem to be working fine. thank you again.
some who deserve life receive death. Others who deserve death receive life. Can you give it to them? Don't be eager to deal out death in judgement, for not even the wise can see all ends.

Gandalf The White
Posts: 2185
Joined: Sat, 9. Nov 02, 12:21
x3

Re: scripting help x3ap

Post by Gandalf The White » Wed, 20. Mar 19, 11:20

hi,

thanks again for those additions they work really well.

i was thinking, providing the ship in question has the right equipment could we get ship scan information as well? ships that we decide to scan? also our own ship report as well considering that if we take damage we don't know the extent of it. so it would be useful to have that info.
some who deserve life receive death. Others who deserve death receive life. Can you give it to them? Don't be eager to deal out death in judgement, for not even the wise can see all ends.

Gandalf The White
Posts: 2185
Joined: Sat, 9. Nov 02, 12:21
x3

eRe: scripting help x3ap

Post by Gandalf The White » Mon, 25. Mar 19, 01:27

hi,

i was just thinking, the command that shows you the message that shows ships coming to your factory to buy/sell could this be generated into a text file somehow?
some who deserve life receive death. Others who deserve death receive life. Can you give it to them? Don't be eager to deal out death in judgement, for not even the wise can see all ends.

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”