[Question] Adding units to a ship (answered)
Moderators: Scripting / Modding Moderators, Moderators for English X Forum
-
- Posts: 165
- Joined: Mon, 15. May 06, 20:13
[Question] Adding units to a ship (answered)
Edit: Thanks to Berserk Knight! The short answer is: UNITS == DRONES. Even though marines are people (you'd think), they are added under the <unit> tag and thus are handled like drones. They will only be added to the ship if it has a drone bay!
Hi,
For a mod I'm making, I have been trying to add internal defences to a ship. Unfortunately to no avail so far.
If you take a look at ships.xml, some of the ships have a <units> block which defines random amounts of units a new ship comes with. That would be attack, defense, welder (build URV) and other URV units.
I have tried to add the same block to ships that don't have it and thereby add internal defenses to the ship. (First strange thing: The original ships.xml references the units as 'attack', 'defence' and 'welder', while scripts reference them as 'unitcategory.welder' etc.) In addition to 'defence' also 'unitcategory.marine' is counted towards defenses during boarding.
I noticed that the objects I have been trying to upgrade always have $object.units.maxcount -> 0 while other ships like the Taranis have maxcount -> 150. I was wondering if the failed attempts to add units are because the ships have this limitation. Then of course I would be interested in how to change this limit on the designated ships.
Cheers
Last edited by Atrocious on Fri, 13. Jun 14, 20:46, edited 1 time in total.
-
- Posts: 37
- Joined: Fri, 12. May 06, 19:59
I have seen some people put out boarding calculations on the forum and what you've found would explain why military ships take more marines than freighters. It may be hardwired into the ships original description and unchangeable.
I would love to see a mod that adds marine counts onto ships! I'm honestly still waiting for X Rebirth: Marines to come out. I would love to board a taranis, fighting my way to the bridge while Yisha is flying the skunk taking out targets and telling me objectives to hit. It'll never happen but I can dream
I would love to see a mod that adds marine counts onto ships! I'm honestly still waiting for X Rebirth: Marines to come out. I would love to board a taranis, fighting my way to the bridge while Yisha is flying the skunk taking out targets and telling me objectives to hit. It'll never happen but I can dream

-
- Posts: 398
- Joined: Tue, 17. Dec 13, 01:34
-
- Posts: 165
- Joined: Mon, 15. May 06, 20:13
Berserk Knight, I've been looking at the Boarding.xml and I'm pretty sure that I've seen a calculation for unitcategory.marine per mk level to add to the defense level (not looking at the code right now). However, I think you're right that no npc ship has them on board.
Regardless of marines or not, npc carriers seem to have mk 1, 3 and 5 levels of 'defence' on them. So I am trying to add the same levels to other ships, but the units.maxcount is always 0 on them.
Regardless of marines or not, npc carriers seem to have mk 1, 3 and 5 levels of 'defence' on them. So I am trying to add the same levels to other ships, but the units.maxcount is always 0 on them.
-
- Posts: 398
- Joined: Tue, 17. Dec 13, 01:34
Ah, sorry, my mistake. The marines do count. (Must've missed those 3~4 lines.)
...Looking again, they don't get any bonuses from the defending ship's DO for some reason. (Scratches head.)
The regular combat drones are in the "defence" category, and the "attack" is the Assault URV.
Which ships are you trying to add those to?
If units.maxcount is returning 0, it could be that drone bays don't exist.
There are several ships that don't have them.
...Looking again, they don't get any bonuses from the defending ship's DO for some reason. (Scratches head.)
The regular combat drones are in the "defence" category, and the "attack" is the Assault URV.
Which ships are you trying to add those to?
If units.maxcount is returning 0, it could be that drone bays don't exist.
There are several ships that don't have them.
-
- Posts: 165
- Joined: Mon, 15. May 06, 20:13
Yes, they don't get bonuses, probably to make it not too hard for the attacker. Combined with the combat drones the defense level could become pretty high otherwise.
Speaking of drones: I did not realize that 'defence' units are actually drones and as such need a drone bay. I've been thinking of them as 'invisible marines' for an internal defense rating. This may be the crucial hint I've been looking for!
I tried to add internal defenses to Xenon L and K and I think they really might not have drone bays. Looking forward to test this out later. Thank you!
Speaking of drones: I did not realize that 'defence' units are actually drones and as such need a drone bay. I've been thinking of them as 'invisible marines' for an internal defense rating. This may be the crucial hint I've been looking for!
I tried to add internal defenses to Xenon L and K and I think they really might not have drone bays. Looking forward to test this out later. Thank you!
-
- Posts: 165
- Joined: Mon, 15. May 06, 20:13
You were right, the marines aren't added because they are handled like drones and the ship didn't have a drone bay. Thanks again!
Also, the unitmap.xml explains a lot. Unfortunately I hadn't seen it earlier:
Also, the unitmap.xml explains a lot. Unfortunately I hadn't seen it earlier:
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<units>
<unit category="transport" mk="1" macro="units_size_xs_transp_empty_macro"/>
<unit category="transport" mk="1" macro="units_size_xs_transp_pickup_macro" tags="pickup"/>
<unit category="transport" mk="1" macro="units_size_xs_transp_generic_macro" tags="container"/>
<unit category="transport" mk="1" macro="units_size_xs_transp_food_macro" tags="bulk"/>
<unit category="transport" mk="1" macro="units_size_xs_transp_energy_macro" tags="energy"/>
<unit category="transport" mk="1" macro="units_size_xs_transp_liquid_macro" tags="liquid"/>
<unit category="transport" mk="1" macro="units_size_xs_personal_transporter_4_macro" tags="passenger"/>
<unit category="orecollector" mk="1" macro="units_size_drone_rubble_collector_mk1_macro"/>
<unit category="orecollector" mk="2" macro="units_size_drone_rubble_collector_mk2_macro"/>
<unit category="gascollector" mk="1" macro="units_size_drone_liquid_collector_mk1_macro"/>
<unit category="gascollector" mk="2" macro="units_size_drone_liquid_collector_mk2_macro"/>
<unit category="welder" mk="1" macro="units_size_xs_welder_drone_macro"/>
<unit category="attack" mk="1" macro="units_size_xs_wardrone_macro"/>
<unit category="defence" mk="1" macro="units_size_drone_attackdrone_impulse_mk1_macro"/>
<unit category="defence" mk="2" macro="units_size_drone_attackdrone_impulse_mk2_macro"/>
<unit category="defence" mk="3" macro="units_size_drone_attackdrone_plasma_mk1_macro"/>
<unit category="defence" mk="4" macro="units_size_drone_attackdrone_plasma_mk2_macro"/>
<unit category="defence" mk="5" macro="units_size_drone_missiledrone_dumbfire_mk1_macro"/>
<unit category="defence" mk="6" macro="units_size_drone_missiledrone_dumbfire_mk2_macro"/>
<unit category="police" mk="1" macro="units_size_xs_albion_police_car_macro"/>
<unit category="police" mk="1" macro="units_size_xs_albion_police_car_macro" factions="albionenergy beryll heartofalbion leddaindustrial nolimits plutarch wholesomefoods"/>
<unit category="police" mk="1" macro="units_size_xs_devris_police_car_macro" factions="canteran"/>
<unit category="police" mk="1" macro="units_size_xs_omicron_police_car_macro" factions="aquarius argongovernment chow frantonpharma jonferson sonraenergy"/>
<unit category="marine" mk="1" macro="character_argon_male_marine_mk1_macro"/>
<unit category="marine" mk="2" macro="character_argon_male_marine_mk2_macro"/>
<unit category="marine" mk="3" macro="character_argon_male_marine_mk3_macro"/>
<unit category="guard" mk="1" macro="testnpc"/>
</units>