Discussion and information relevant to creating special missions, new ships, skins etc.
Moderators: winston , another_commander
Lone_Wolf
---- E L I T E ----
Posts: 613 Joined: Wed Aug 08, 2007 10:59 pm
Location: Netherlands
Post
by Lone_Wolf » Tue Aug 12, 2025 11:18 am
I've been testing several ships lately from a normal and got tired searching where they were fore sale to start the testing .
Inspired by
https://wiki.alioth.net/index.php/Lave_Initial_Shipyard I started my own version .
Code: Select all
"use strict";
this.name = "LaveCustomStart";
this.author = "Lone_Wolf";
this.copyright = "2025 Lone_Wolf";
this.description = "Setup some things.";
this.licence = "CC BY-NC-SA 4.0";
//-------------------------------------------------------------------------------------------------------------
this.startUpComplete = function () {
// only do this if we're in Lave
if (galaxyNumber == 0 && system.ID == 7 ) {
if (worldScripts.ferdelance3G_populator) {
system.mainStation.addShipToShipyard({
short_description: "FDL 3G + turrets: Standard customer model. Price 113000 ₢.",
shipdata_key: "ferdelance3G_playerPlusModelWithTurrets",
price: 113000,
personality: Math.floor(Math.random() * 32768),
});
};
};
// make sure we don't try this again.
delete this.startUpComplete;
}
The price of 113000 is exactly the trade-in value of the default cobra MKIII so you're just starting with another ship.
Another ship I want to add doesn't have any scripts.
Is there a way to verify is a specific oxp ship is available ?
OS : Arch Linux 64-bit - rolling release
From: The Netherlands, Europe
OXPs :
My user page
(needs updating)
Retired, occasionally active
Wildeblood
---- E L I T E ----
Posts: 2856 Joined: Sat Jun 11, 2011 6:07 am
Location: Nova Hollandia
Contact:
Post
by Wildeblood » Tue Aug 12, 2025 11:33 am
Lone_Wolf wrote: ↑ Tue Aug 12, 2025 11:18 am
Another ship I want to add doesn't have any scripts.
Is there a way to verify is a specific oxp ship is available ?
Do you need to bother verifying first, if it's just for your own testing? Does addShipToShipyard fail quietly, or cause an exception and halt the script?
"Must keep this response efficient to preserve remaining context."
phkb
Impressively Grand Sub-Admiral
Posts: 5369 Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.
Post
by phkb » Tue Aug 12, 2025 11:57 am
Lone_Wolf wrote: ↑ Tue Aug 12, 2025 11:18 am
Is there a way to verify is a specific oxp ship is available ?
Do this:
Code: Select all
var newship = Ship.shipDataForKey("ship_key_of_oxp_ship");
if (newship) {
// the ship is present - add it to the shipyard
}
Lone_Wolf
---- E L I T E ----
Posts: 613 Joined: Wed Aug 08, 2007 10:59 pm
Location: Netherlands
Post
by Lone_Wolf » Tue Aug 12, 2025 12:39 pm
Wildeblood wrote: ↑ Tue Aug 12, 2025 11:33 am
Do you need to bother verifying first, if it's just for your own testing? Does addShipToShipyard fail quietly, or cause an exception and halt the script?
It fails silently and you have to check log to find out why it failed. Also I try to keep ship oxps to a minimum so move them in/out frequently.
@phkb: works fine.
I'm setting player.name now also, next question :
I'd prefer to set illegal goods to "only slaves" . Is it possible to set a missionvar for another oxp ?
IF not, can oxps use Library Config to set the value ?
OS : Arch Linux 64-bit - rolling release
From: The Netherlands, Europe
OXPs :
My user page
(needs updating)
Retired, occasionally active
phkb
Impressively Grand Sub-Admiral
Posts: 5369 Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.
Post
by phkb » Tue Aug 12, 2025 10:05 pm
Lone_Wolf wrote: ↑ Tue Aug 12, 2025 12:39 pm
I'd prefer to set illegal goods to "only slaves"
Create a "trade-goods.plist" file in your Config folder, and put this code in:
Code: Select all
{
"narcotics" = {
"legality_export" = 0;
"legality_import" = 0;
};
"firearms" = {
"legality_export" = 0;
"legality_import" = 0;
};
}
You could also do it via a market script. See the Smugglers OXP for an example.
Lone_Wolf wrote: ↑ Tue Aug 12, 2025 12:39 pm
Is it possible to set a missionvar for another oxp ?
Absolutely. Mission variables are global and writable, so yeah, go nuts! (But don't tell anyone I said that.)
phkb
Impressively Grand Sub-Admiral
Posts: 5369 Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.
Post
by phkb » Tue Aug 12, 2025 10:23 pm
I should add: Go nuts on anything local, but expect OXP's to break if you change mission variables outside of the OXP itself. Sometimes (often, actually), mission variables are changed in a particular sequence, or multiple variables are changed together, and so changing one will potentially break the OXP.
And definitely don't release an OXP that plays with another OXP's mission variables. Definitely bad form, that one.
Lone_Wolf
---- E L I T E ----
Posts: 613 Joined: Wed Aug 08, 2007 10:59 pm
Location: Netherlands
Post
by Lone_Wolf » Wed Aug 13, 2025 12:45 pm
Understood, If this ever gets released it will not have such things in it.
OS : Arch Linux 64-bit - rolling release
From: The Netherlands, Europe
OXPs :
My user page
(needs updating)
Retired, occasionally active