[SCR] Ship Browser v1.2 - In Game Ship Comparison Tool [UPDATED: 11/2/2014]

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

zanzal
Posts: 309
Joined: Sat, 15. Sep 12, 07:42
x3tc

Post by zanzal » Mon, 3. Nov 14, 22:52

gilboa wrote:How do I access the information page?
Hello Gilboa,

In the screenshots on the intro post you should actually see 'Ship Browser v1.2' as the title for the window if you are running the latest version. If you are running v1.2 then you can select a ship shown in your Ship Browser results by clicking/pressing enter on that ship and it will bring up a Ship Details sub menu.

gilboa
Posts: 260
Joined: Sat, 28. Apr 07, 10:33
x4

Post by gilboa » Mon, 3. Nov 14, 23:06

Viliae wrote:Welcome

Stupid question: Have upgrade script and t-file :?:

I've just press enter on ship of my choice.
No go.
Using 1.2 :(

- Gilboa
X2 Linux (LGP).
Heavily modified X3:R Linux w/ XTM (LGP).
Heavily modified X3:TC w/ XRM (under wine).
Heavily modified X3:AP Linux w/ XRM.
Modified X4 Linux w/ VRO.
Machine: 2 x E5-2658V2, 32G, 8TB RAID10, 1080GTX, Dell UP3216Q 4K LCD.
OS: Fedora 33/x86_64.

zanzal
Posts: 309
Joined: Sat, 15. Sep 12, 07:42
x3tc

Post by zanzal » Mon, 3. Nov 14, 23:07

Viliae wrote:But now this is something what everybody should have, especially if he/she play modified game with many many ships.
Information screen - this is M A S T E R P I E C E, it's working like charm especially when you find\board ship and start planning his armament.
Yeah I'm pretty psyched up about it too. The next revision which I'll start working on in next week should improve the concept further.

zanzal
Posts: 309
Joined: Sat, 15. Sep 12, 07:42
x3tc

Post by zanzal » Mon, 3. Nov 14, 23:15

gilboa wrote:No go.
Using 1.2 :(
I notice you are running Linux in your sig, is it possible you are not using AP v3.0? If your running an older AP that could be an issue.

gilboa
Posts: 260
Joined: Sat, 28. Apr 07, 10:33
x4

Post by gilboa » Tue, 4. Nov 14, 07:39

Hi,

Linux has the latest X3AP version: 3.1.2013.
I'll double check if the title of the ship browser has 1.2 in it...

Thanks again for the help.
X2 Linux (LGP).
Heavily modified X3:R Linux w/ XTM (LGP).
Heavily modified X3:TC w/ XRM (under wine).
Heavily modified X3:AP Linux w/ XRM.
Modified X4 Linux w/ VRO.
Machine: 2 x E5-2658V2, 32G, 8TB RAID10, 1080GTX, Dell UP3216Q 4K LCD.
OS: Fedora 33/x86_64.

zanzal
Posts: 309
Joined: Sat, 15. Sep 12, 07:42
x3tc

Post by zanzal » Wed, 5. Nov 14, 04:09

Gilboa,

I would like you to test something for me:

Start a new game and open up the ship browser and see if the ship details screen works as expected. If it does work in a new game but doesn't work in an existing save then please let me know.

A few weeks ago, I noticed a potential for a small glitch. I fixed it in 1.2, but the type of glitch is very strange and maybe it is related to the issue you have. If you have the glitch then it would only manifest in existing games but work fine in new games.

Let me know.
Last edited by zanzal on Wed, 5. Nov 14, 07:57, edited 1 time in total.

gilboa
Posts: 260
Joined: Sat, 28. Apr 07, 10:33
x4

Post by gilboa » Wed, 5. Nov 14, 07:23

Please ignore, what remained of my brain after 14 hours of work seems to be incapable of installing v1.2 correctly.
Once I fixed the installation, script works just fine.

Thanks again and sorry (again) for the noise.

BTW, the information screen is indeed a masterpiece!
X2 Linux (LGP).
Heavily modified X3:R Linux w/ XTM (LGP).
Heavily modified X3:TC w/ XRM (under wine).
Heavily modified X3:AP Linux w/ XRM.
Modified X4 Linux w/ VRO.
Machine: 2 x E5-2658V2, 32G, 8TB RAID10, 1080GTX, Dell UP3216Q 4K LCD.
OS: Fedora 33/x86_64.

User avatar
dizzy
Posts: 1019
Joined: Sun, 26. Sep 10, 06:00
x4

Post by dizzy » Thu, 6. Nov 14, 01:30

This looks like exactly what I was looking for, I'm playing Xtended 2.2b on X3TC and it's so hard to compare ships (go back and forth between their entries in the Encyclopedia, then try to remember the values, then quickly go to the other one and try to replay them, then go back, wtf). And there's no online resource like with the vanilla ships.

However, from the screenshots (I haven't yet tried your script), it looks like it's showing a bunch of stuff I don't care of (like cargo class and cargo size, the latter takes 2 columns for the min/max which btw, you could use a single column and show a range like 11000-15000) while it's missing the actual stuff I do care of (number of shields, shield recharge rate, weapon energy capacity, weapon recharge rate). Note that in xtended, there are about 6 different types for each shield size (so an M7 with Huge shields can have all sorts of combinations of different types of Huge shields). This is why it's important to be able to compare that this M7 takes 11 shields vs this other M7 which takes 7 instead of looking at the shield energy that your script is displaying in the screenshots (the shield energy depends on the actual shield bought/installed on the ship, in xtended some shield types trade more capacity for slower recharge rate and viceversa).

Could you make it possible so that the columns displayed on the first screen (which are the most important to be able to compare ships quickly) are configurable? So that we can remove what we don't care about and add what we want?

Or any other way that would allow me to see in the first screen the following:
- weapon energy capacity
- weapon recharge rate
- number of shields
- shield recharge rate

Thanks!

zanzal
Posts: 309
Joined: Sat, 15. Sep 12, 07:42
x3tc

Post by zanzal » Thu, 6. Nov 14, 06:05

Greetings memeics, regarding making the first page configurable, I am going to have to decline at this time. I'll think about it, but its not likely to ever be a feature. I will be rethinking my page layout in the future a little bit, but I don't really think my improvements would be what you are looking for. Most of the improvements I'll be making will be to the Ship Details screen and that won't be available in the TC edition.

My recommendation would be to modify the script to suit your preferences. If you were up for it, you can even use the Ship Browser as a starting point for your very own "X-Tended Ship Browser." I did release a version for TC that should work as a good starting point. You may also be able to backport the AP version.

Regarding shield and laser recharge rates, I haven't had any success getting either values using MCSI. I am pretty sure the only way to get the information at this point would be to use a python/some other language script to convert the data in TShips.txt to a custom t file. I may do myself this in the future, but it would be an optional thing for advanced users and not part of the core mod.

User avatar
dizzy
Posts: 1019
Joined: Sun, 26. Sep 10, 06:00
x4

Post by dizzy » Thu, 6. Nov 14, 22:05

Thanks for your answer, I'm delaying having to buy AP because it's Steam only and I abhor Steam and DRM in general (one of the main reasons I play the X3 games is because of their DRM-free releases for everything up to and including X3:TC).

About the shield/laser recharge rates, what does "power generator" stand for in this command:
x <RetVar> = <RefObj> get power generator

Is there an official way to get a list of all scripting commands or does Egosoft expect people to just guess them or take them by reading the official script sources?

zanzal
Posts: 309
Joined: Sat, 15. Sep 12, 07:42
x3tc

Post by zanzal » Fri, 7. Nov 14, 06:31

memeics wrote:x <RetVar> = <RefObj> get power generator
I don't think it is documented, but it is the shield generator strength in MW. You can look in the MCSI subforum for help on commands.

User avatar
dizzy
Posts: 1019
Joined: Sun, 26. Sep 10, 06:00
x4

Post by dizzy » Fri, 7. Nov 14, 20:30

I installed the mod last night, it's amazing, all large mod authors should definitely recommend this because public resources don't work for comparing ships on their mods.

The weapons mode gives me everything I need. The shield capacity is a good proxy for the number of shields (because you compute it as a multiple of base shield type capacity x shield number) so I can still compare them reasonably. You already include the laser battery and shield recharge rate. I don't remember if you include weapon recharge rate but I could live without one missing detail. So, anyway, your script is very useful and does cover almost everything I was asking for already, sorry for the spam.

zanzal
Posts: 309
Joined: Sat, 15. Sep 12, 07:42
x3tc

Post by zanzal » Sat, 8. Nov 14, 10:55

Thanks, I am glad you found it useful.

BlackArchon
Posts: 1016
Joined: Wed, 4. Feb 04, 17:37
xr

Post by BlackArchon » Mon, 10. Nov 14, 21:26

Thanks for this new version! :)

In the detailed ship view, is there a way to see where the turrets are? For example the Split Komodo has a rather unusual turret layout (two arrays on the front, but none at the top and the bottom), but this fact cannot be observed in this view.

I would also wish to see a total count of capital ship weapons per ship - this would make the choice for sector defenses easier because only pure firepower counts in OOS fights.

User avatar
dizzy
Posts: 1019
Joined: Sun, 26. Sep 10, 06:00
x4

Post by dizzy » Mon, 10. Nov 14, 23:01

Sorry of I'm asking something stupid, but how can I view ship details (or get into that detail page)? I use the first page to directly compare ships and change the filters for the list. All that works very well. But then if I go on a displayed ship row and press Enter or click on it nothing happens.

Or that feature isn't available for the TC version of your script?

zanzal
Posts: 309
Joined: Sat, 15. Sep 12, 07:42
x3tc

Post by zanzal » Tue, 11. Nov 14, 02:18

The first version of the ship browser (1.0) was the final version for TC. I use a lot of AP specific commands.

User avatar
Urschleim
Posts: 935
Joined: Wed, 10. Jan 07, 12:34
x4

Post by Urschleim » Tue, 11. Nov 14, 12:09

Great Script, thx alot !!!!

User avatar
dizzy
Posts: 1019
Joined: Sun, 26. Sep 10, 06:00
x4

Post by dizzy » Thu, 13. Nov 14, 09:32

OK, I found an issue (using latest TC version on XTC 2.2b): it doesn't list the OTAS ships.

In XTC, the OTAS ships belong to "Friendly Race" and are produced by "OTAS Shipyard" which also belongs to "Friendly Race" but is hosted in an Argon core sector (Sirius III). It also requires reputation with the Argon to buy them.

So I thought, maybe there's an issue with this script and "Friendly Race" ships in general. I debugged it by adding lots of "write to player logbook" lines but eventually the cause was surprising: it appears that if you query for the list of shipyards using the well known "get station array: of race $race class/type={Shipyard 2037}" it just doesn't list anything for "Friendly Race". Even weirder, the OTAS Shipyard is listed if you query for the shipyards using race "Argon 1". Not sure why the scripting engine in the game behaves this way, the OTAS Shipyard clearly belongs to "Friendly Race 13" (in XEditor2 for example). Maybe the game engine gets confused by the fact that the OTAS Shipyard is present in an Argon sector so it's listing it if you query for Argon stations.

ANYWAY, the fix is kinda of a hack (I'm open to suggestions), essentially if I detect that the ship race is "Friendly Race 13" then I make sure I query for shipyards for "Argon 1" instead. In your script I have changed these lines:

Code: Select all

find_closest_known_shipyard:
$syrace = $ship.race
if $syrace == {Friendly Race 13}
  * OTAS shipyards are found by searching for Argon shipyards, no idea why.
  $syrace = {Argon 1}
end

$station.list = get station array: of race $syrace class/type={Shipyard 2037}
...
EDIT: looking at v1.1 (AP only) changelong, this actually would have also fixed the issue as the problem is present when trying to find where to buy the ship and doesn't exist otherwise:
+ Changed rules so that being known to the player will allow the ship to be shown rather than requiring the player to know where to purchase the ship.

I may look into your v1.1 code and try to replicate that part in v1.0 (TC compatible) if it's not hard.

zanzal
Posts: 309
Joined: Sat, 15. Sep 12, 07:42
x3tc

Post by zanzal » Thu, 13. Nov 14, 14:31

The changelog refers to a mistake I made early on thinking -> is known applied to wares.

So I would often write it like:

Code: Select all

if $ware.item -> is known
end
The correct way to check and see if a player knows about a ware (ship types are wares too) is:

Code: Select all

if has $ware.item been discovered
end
Of course it is now obvious too me that I should have realized that the -> is known can only apply to object instances and can't work on things like races and wares. I discovered the mistake and the fix shortly after releasing the AP version of the ship browser, so I don't know whether the TC one has the issue or not, but I did fix it for the AP version in 1.1.

The OTAS issue you have with TC is very similar to the ATF/Terran issue. If ATF ships can be purchased in XTC you might notice the same thing.

User avatar
dizzy
Posts: 1019
Joined: Sun, 26. Sep 10, 06:00
x4

Post by dizzy » Thu, 13. Nov 14, 21:10

Thanks for the info. I changed the code where it decided to display a ship only if "spoiler mode" enabled OR if it found a homebase for it with displaying it if "spoiler mode" enabled OR if it was discovered. My previous fix to find OTAS ships by searching for Argon shipyards is still useful at least for the "general" page where it tells you where to buy it from.

However, with this last change it now also lists ATF ships (which in XTC can't be bought anywhere). It's kind of arbitrary if this is useful or not, it's not useful if you are researching for ships to add to your fleet (you can't buy ATF ships and I don't think you can cap ATF ships in XTC) but may be of some use if you are comparing ships overall.

It's also missing some data for some of these new ships that are showing now (data like weapons capacity, shields, etc). I guess I'll just revert this last change to only show ships that have a known shipyard.

One thing I'm curious is how my change relates to vanilla X3:TC game. Does your ship browser display OTAS ships in the vanilla game? I'd be surprised if it does :) If it doesn't, you should include my fix in the TC version of your script since it's useful outside of the xtended mod.

Post Reply

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