Limit equipment for a vessel
Moderators: winston, another_commander
- DavidKroc
- Competent
- Posts: 39
- Joined: Thu Jan 02, 2025 10:20 am
- Location: Onrira Orbital Shipyards
- Contact:
Limit equipment for a vessel
Hello,
I'm trying to find out if there is a mechanism in shipyard.plist or shipdata.plist to prevent the purchase of standard equipment, a bit like what incompatible_with_equipment does in equipment.plist.
My idea is to prevent the Sidewinder NG from being fitted with a military laser (for example) because there isn't enough room in such a small vessel to mount it.
How can I do that?
Do I have to create a "virtual" equipment, equip by default all Sidewinder NG with it and list all wanted forbidden equipment as incompatible_with_equipment or is there a more elegant way?
I'm trying to find out if there is a mechanism in shipyard.plist or shipdata.plist to prevent the purchase of standard equipment, a bit like what incompatible_with_equipment does in equipment.plist.
My idea is to prevent the Sidewinder NG from being fitted with a military laser (for example) because there isn't enough room in such a small vessel to mount it.
How can I do that?
Do I have to create a "virtual" equipment, equip by default all Sidewinder NG with it and list all wanted forbidden equipment as incompatible_with_equipment or is there a more elegant way?
Re: Limit equipment for a vessel
You have already done this with several pieces of equipment in your shipyard.plist for this ship. The equipment you have commented out ( // preceding the item) in the optional_equipment section of the code will prevent your ship from being able to purchase that equipment. Alternatively you could simply not include the commented out items by deleting them from the array. Do the same with the Military Laser and it will not be available for your ship.
Edit
Yikes !!
Ignore this post as the next one in the thread proves me wrong. Went looking for an answer and misinterpreted what was read.
Edit
Yikes !!
Ignore this post as the next one in the thread proves me wrong. Went looking for an answer and misinterpreted what was read.
Last edited by Nite Owl on Mon Mar 10, 2025 7:10 pm, edited 1 time in total.
Humor is the second most subjective thing on the planet
Brevity is the soul of wit and vulgarity is wit's downfall
Good Night and Good Luck - Read You Soon
Brevity is the soul of wit and vulgarity is wit's downfall
Good Night and Good Luck - Read You Soon
- Wildeblood
- ---- E L I T E ----
- Posts: 2579
- Joined: Sat Jun 11, 2011 6:07 am
- Location: Nova Hollandia
- Contact:
Re: Limit equipment for a vessel
That can't be right, or no OXP equipment would work. TheNite Owl wrote: ↑Sun Mar 09, 2025 4:46 pmYou have already done this with several pieces of equipment in your shipyard.plist for this ship. The equipment you have commented out ( // preceding the item) in the optional_equipment section of the code will prevent your ship from being able to purchase that equipment. Alternatively you could simply not include the commented out items by deleting them from the array. Do the same with the Military Laser and it will not be available for your ship.
optional_equipment
field in shipyard.plist controls what could be found already installed on ships for sale in a shipyard, but doesn't affect players later purchasing equipment."There are large, white swans, and there are small, black swans," he explained, "But there are no medium-sized swans, and there are no grey swans. The non-existence of grey swans mitigates against belief in Mr Darwin's theory."
- Wildeblood
- ---- E L I T E ----
- Posts: 2579
- Joined: Sat Jun 11, 2011 6:07 am
- Location: Nova Hollandia
- Contact:
Re: Limit equipment for a vessel
That somewhat goes against the spirit of the game; there's a clue in the phrase "standard equipment".
Ah, now that is based on a mistaken premise. As you can clearly see here, a military laser, which uses a spherical laser multiplier:-DavidKroc wrote: ↑Sun Mar 09, 2025 1:14 pmMy idea is to prevent the Sidewinder NG from being fitted with a military laser (for example) because there isn't enough room in such a small vessel to mount it.

- is actually physically smaller than a pulse laser, which uses a linear laser multiplier:-

I can think of another way, which is to use an equipment over-ride to attach a condition script to the military laser, but that is not more elegant. What you suggest should work, so I'm certain it can be done, one way or another.

I would direct this question to another_commander, who might know of a less-used shipdata key that does what you want.
"There are large, white swans, and there are small, black swans," he explained, "But there are no medium-sized swans, and there are no grey swans. The non-existence of grey swans mitigates against belief in Mr Darwin's theory."
- DavidKroc
- Competent
- Posts: 39
- Joined: Thu Jan 02, 2025 10:20 am
- Location: Onrira Orbital Shipyards
- Contact:
Re: Limit equipment for a vessel
I don't know where these images come from and if they can be considered as proof, but I still have the impression that the military laser is closer to the ceiling (therefore bigger) than the beam laser. But never mind.
I've tried my virtual equipment idea and so far it's not working. In fact, incompatible_with_equipment doesn't seem to work at all in Oolite 1.90 (I'll have to look into this).

I've tried my virtual equipment idea and so far it's not working. In fact, incompatible_with_equipment doesn't seem to work at all in Oolite 1.90 (I'll have to look into this).
- Cholmondely
- Archivist
- Posts: 5663
- Joined: Tue Jul 07, 2020 11:00 am
- Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
- Contact:
Re: Limit equipment for a vessel
The Wildebloodian prodding of AI, meseems.
Nevermind. What else would you really like to do to your OXP?
Comments wanted:
•Missing OXPs? What do you think is missing?
•Lore: The economics of ship building How many built for Aronar?
•Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
•Missing OXPs? What do you think is missing?
•Lore: The economics of ship building How many built for Aronar?
•Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
- DavidKroc
- Competent
- Posts: 39
- Joined: Thu Jan 02, 2025 10:20 am
- Location: Onrira Orbital Shipyards
- Contact:
Re: Limit equipment for a vessel
As the Sidewinder NG is very small (21 x 4 x 15 m) for 11,500 kg, this means very little free space inside (especially since Spalder and Starblaze had to add a Witchdrive inside). My idea was therefore to prohibit the installation of big standard equipments from vanilla game or most popular OXPs.
This include :
- Fuel Scoops
- ExtraFuelTanks
- Fuel Collector
- Repair Bots
- Retro Rockets
- Shield Equalizer And Capacitors
- Shield Cycler
- Teleportation Drive
- Cholmondely
- Archivist
- Posts: 5663
- Joined: Tue Jul 07, 2020 11:00 am
- Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
- Contact:
Re: Limit equipment for a vessel
Fuel Scoops are almost a necessity for the Stranger's World variant of Oolite. And they usually fit "outside" the ship with alterations to the cargo bay "inside", if I understand correctly. With no cargo bay, they would only act as fuel scoops, not cargo scoops, so most of those alterations become irrelevant.DavidKroc wrote: ↑Tue Mar 11, 2025 5:51 pmAs the Sidewinder NG is very small (21 x 4 x 15 m) for 11,500 kg, this means very little free space inside (especially since Spalder and Starblaze had to add a Witchdrive inside). My idea was therefore to prohibit the installation of big standard equipments from vanilla game or most popular OXPs.
This include :I'm not sure about the Escape pod (but as it is fitted such that it completely encloses the flight deck, it might be possible to add it) and the list of laser / News Lasers to forbid because they couldn't fit into the same slot as the standard beam laser.
- Fuel Scoops
- ExtraFuelTanks
- Fuel Collector
- Repair Bots
- Retro Rockets
- Shield Equalizer And Capacitors
- Shield Cycler
- Teleportation Drive
And do Fuel Collector and Repair Bots even work if one has no cargo bay? They might not even be purchasable anyways.
Comments wanted:
•Missing OXPs? What do you think is missing?
•Lore: The economics of ship building How many built for Aronar?
•Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
•Missing OXPs? What do you think is missing?
•Lore: The economics of ship building How many built for Aronar?
•Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
- phkb
- Impressively Grand Sub-Admiral
- Posts: 4888
- Joined: Tue Jan 21, 2014 10:37 pm
- Location: Writing more OXPs, because the world needs more OXPs.
Re: Limit equipment for a vessel
There are a few existing mods that limit the equipment in some way.
- Ship Configuration (by me, shameless plug) implements the idea of each ship having a different amount of space available for installing equipment.
- Telescope Extender (by Norby) has equipment that is limited to ships of a certain size. Same for Towbar.
In most cases, they are setting the condition_script property of the equipment, and doing the check in that code for whether the equipment can be installed. As you'd be working with existing equipment, you'd need to utilise the equipment-overrides.plist file so you could apply your condition_script to them.
- Ship Configuration (by me, shameless plug) implements the idea of each ship having a different amount of space available for installing equipment.
- Telescope Extender (by Norby) has equipment that is limited to ships of a certain size. Same for Towbar.
In most cases, they are setting the condition_script property of the equipment, and doing the check in that code for whether the equipment can be installed. As you'd be working with existing equipment, you'd need to utilise the equipment-overrides.plist file so you could apply your condition_script to them.
- Wildeblood
- ---- E L I T E ----
- Posts: 2579
- Joined: Sat Jun 11, 2011 6:07 am
- Location: Nova Hollandia
- Contact:
Re: Limit equipment for a vessel
That's what I said!phkb wrote: ↑Sat Mar 15, 2025 5:59 amIn most cases, they are setting the condition_script property of the equipment, and doing the check in that code for whether the equipment can be installed. As you'd be working with existing equipment, you'd need to utilise the equipment-overrides.plist file so you could apply your condition_script to them.
"There are large, white swans, and there are small, black swans," he explained, "But there are no medium-sized swans, and there are no grey swans. The non-existence of grey swans mitigates against belief in Mr Darwin's theory."
- phkb
- Impressively Grand Sub-Admiral
- Posts: 4888
- Joined: Tue Jan 21, 2014 10:37 pm
- Location: Writing more OXPs, because the world needs more OXPs.
Re: Limit equipment for a vessel
Ah! And here I was thinking I had something unique to contribute. Ah well. Such is life.
- DavidKroc
- Competent
- Posts: 39
- Joined: Thu Jan 02, 2025 10:20 am
- Location: Onrira Orbital Shipyards
- Contact:
Re: Limit equipment for a vessel
I'm going to drop this idea. Bulky equipment already uses cargo space (and the Sidewinder NG has none, so it can't install them) and some others require a minimum ship weight to install them. I'll settle for that.
- DavidKroc
- Competent
- Posts: 39
- Joined: Thu Jan 02, 2025 10:20 am
- Location: Onrira Orbital Shipyards
- Contact:
Re: Limit equipment for a vessel
Even if I dropped this idea for the moment, I kept on working on this and discovered incompatible_with_equipment is completely ignored by Oolite.
So I chose another option: include an Equipment-overrides.plist file in the OXP and block unwanted equipment with a condition_script.
Here's the sample content of Equipment-overrides.plist:
And here's the content of equip_conditions.js (based on the condition script in RedSpear new_lasers):
According to the tests I've carried out, it works correctly.
So I chose another option: include an Equipment-overrides.plist file in the OXP and block unwanted equipment with a condition_script.
Here's the sample content of Equipment-overrides.plist:
Code: Select all
{
"EQ_ESCAPE_POD" = {
condition_script = "equip_conditions.js";
};
"EQ_FUEL_SCOOPS" = {
condition_script = "equip_conditions.js";
};
}
Code: Select all
this.name = "equip_conditions";
this.description = "conditions for Sidewinder NG";
"use strict";
this.allowAwardEquipment = function(equipment, ship, context) // **changed by phkb - credit and thanks to him.
{
if (ship.shipClassName == "Sidewinder NG" && equipment == "EQ_FUEL_SCOOPS")
{
//log(this.name, "FUEL_SCOOPS BLOCKED");
return false;
}
if (ship.shipClassName == "Sidewinder NG" && equipment == "EQ_ESCAPE_POD")
{
return false;
}
// remainder from oolite-conditions.js
// OXP hook to allow stations to forbid specific equipment
if (context == "purchase" && player.ship.dockedStation && player.ship.dockedStation.scriptInfo["oolite-barred-equipment"])
{
if (player.ship.dockedStation.scriptInfo["oolite-barred-equipment"].indexOf(equipment) != -1)
{
return false;
}
}
// OXP hook to allow ships to forbid specific "available to all" equipment
if (ship.scriptInfo && ship.scriptInfo["oolite-barred-equipment"] && ship.scriptInfo["oolite-barred-equipment"].indexOf(equipment) != -1)
{
return false;
}
// otherwise allowed
return true;
}
- Wildeblood
- ---- E L I T E ----
- Posts: 2579
- Joined: Sat Jun 11, 2011 6:07 am
- Location: Nova Hollandia
- Contact:
Re: Limit equipment for a vessel
That sounds familiar.
Choose a less obvious filename, please, DK.condition_script = "equip_conditions.js";
condition_script = "dk_equip_conditions.js";
"There are large, white swans, and there are small, black swans," he explained, "But there are no medium-sized swans, and there are no grey swans. The non-existence of grey swans mitigates against belief in Mr Darwin's theory."
- DavidKroc
- Competent
- Posts: 39
- Joined: Thu Jan 02, 2025 10:20 am
- Location: Onrira Orbital Shipyards
- Contact:
Re: Limit equipment for a vessel
Good advice. Thanks.
Done:
condition_script = "davidkroc_equip_cond.js";