Tabbed Cargo Holds

A place to discuss mods in development and concepts for new mods.
Post Reply
relanat
Militia Captain
Militia Captain
Posts: 941
Joined: Tue Nov 05, 2013 9:56 am

Attached is a Tabbed Cargo Hold mod which does as Latheos suggested in this topic https://forums.kronosaur.com/viewtopic.php?f=3&t=8102. It overwrites game dockscreen 'dsCargoHold'. Be advised there hasn't been much testing of the mod.

It gives a tabbed playership cargo hold with:
Usable,
Weapons,
Armor,
Devices (weapons excluded),
Ammo and
All tabs.
A "General" tab as well as those listed in the other topic has been added. "General" has everything except armor, devices and ammo and could probably exclude "Usable " as well.

"Damaged" is another option but is probably more applicable to looting (see below).



Also attached is some code that gives tabbed cargo holds to EI Freighter Autons (based on 1.8a2 code). NOTE THIS IS NOT A MOD, It's just the code directly related to the cargo hold. For the mod see this topic http://forums.kronosaur.com/viewtopic.php?f=24&t=8377 (the xelerus version is broken) or download from xelerus.

This code could be the basis of tabbed mules, crates and dead stations.

A quick summary (if I've got it right):
dsRPGLoot needs to be overwritten or replaced with a custom dockscreen.
ListOptions= criteria must be "*".
Then create a lambda like rpgD789FreighterCreateCargoHoldTabs (attached) and use whichever categories you like. See game lambda rpgCreateBuyItemTabs in Transcendence_Source as well as the lambda in the attached mod for more examples.
Run that lambda inside the ListOptions XML.

Put the lambda in a <Globals> block.

The function list shows item criteria which can be used in the lambda categories.


A modified copy of dsRPGJettison is also included which allows cargo space to be shown all the time. Standard game dsRPGJettison only shows cargo space in non-playership objects if there is less than 200 tons of space left. Only relevant to really large mules, drones or freighters/ships with holds larger than 200 tons.
Attachments
Tabbed Cargo Hold.xml
(5.81 KiB) Downloaded 252 times
example code for tabs NOT A MOD.xml
(8.22 KiB) Downloaded 266 times
Last edited by relanat on Sat Nov 04, 2017 12:12 am, edited 1 time in total.
Stupid code. Do what I want, not what I typed in!
relanat
Militia Captain
Militia Captain
Posts: 941
Joined: Tue Nov 05, 2013 9:56 am

Some more example code. This taken from an incomplete storage station mod which creates two categories of the station inventory using 'objSetItemData' (thanks to NMS for code help).

The player stores items in the station.
Items in the station inventory are, by default, held in the station but can be selected to be transfered to another system by a NPC freighter.
If the item is selected for transfer then it gets 'itemdata 'transfer' added to it and appears in the 'Transfer' tab, otherwise it stays in the 'Store' tab.
Attachments
more tab code examples NOT A MOD.xml
(1.71 KiB) Downloaded 248 times
Stupid code. Do what I want, not what I typed in!
relanat
Militia Captain
Militia Captain
Posts: 941
Joined: Tue Nov 05, 2013 9:56 am

The same mod but instead of overwriting the whole screen it uses XML functions to change the <ListOptions> code.

'list=' is changed from '*U to '*
and a line of code

Code: Select all

(rpgD789TabbedCargoHold)
is inserted using xmlSetText.

'Ctrl-click' the "All" tab when you first enter the cargo hold screen and next time you enter the screen the tabs will mimic normal list order. (In the first screen the "General" tab gets shunted to second place but only in that first screen when you 'Ctrl-click' "All".)

I plan on writing a short tutorial on how I did it as it's small enough to understand easily and I can pass on what I learnt.
Attachments
XMLTabbedCargoHold.xml
(3.46 KiB) Downloaded 249 times
Stupid code. Do what I want, not what I typed in!
Post Reply