[RELEASE] New Cargoes OXP (1.2.3 released 9 February 2013)

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: [RELEASE] New Cargoes OXP (1.2.2 released 4 February 201

Post by cim »

Hmm... not sure how those undefined's got there, but they'll be the cause of the problem. Probably you need to delete that variable from your save game (you'll lose other regional price variations, but that should sort itself out within a few weeks of game time).

I'll have a look at improving the checking on save/load for that sort of thing.
User avatar
Solonar
Deadly
Deadly
Posts: 174
Joined: Sun Dec 04, 2011 4:04 am
Location: Galaxy 2 - Space Truckin

Re: [RELEASE] New Cargoes OXP (1.2.2 released 4 February 201

Post by Solonar »

We had the same thing in mind. I decided to experiment and delete all the save game data associated with new cargoes and remove the trader net equipment to attempt a restart of this OXP. After doing so it seemed to resolve all my issues. The newsies are displaying normal again and I am able to view special cargoes at the F4 screen of OXP stations.
Image

SolarTech proudly presents the Plasma Turret Regulator Device Apparatus, aka the Turret Toggler
User avatar
Keeper
---- E L I T E ----
---- E L I T E ----
Posts: 273
Joined: Fri Feb 01, 2013 7:44 am
Location: Indian Hills, Nevada, USA

Re: [RELEASE] New Cargoes OXP (1.2.2 released 4 February 201

Post by Keeper »

Just got this OXP the other day. Saw someone looking for Zero-G Hockey Sticks and willing to pay over 2500 per ton. Saw that the neighbouring planet was known for Zero-G Hockey. Took the contract. One jump over, bought the sticks for something like 125 each. One jump back, sold them. Instant 60000-credit profit.

Seems a bit much. Surely this dude could have paid the kind of nominal passenger fees we see for the one-jump trip to buy these things, then the similarly nominal cargo transport fee for the one-jump trip to haul 'em back!

Maybe I just got extremely lucky...
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: [RELEASE] New Cargoes OXP (1.2.2 released 4 February 201

Post by cim »

You did get lucky, but also sounds like a bug. Can you remember which planets?
User avatar
Keeper
---- E L I T E ----
---- E L I T E ----
Posts: 273
Joined: Fri Feb 01, 2013 7:44 am
Location: Indian Hills, Nevada, USA

Re: [RELEASE] New Cargoes OXP (1.2.2 released 4 February 201

Post by Keeper »

Looked it up. The buyer was on Bemaera. The sticks were from Esesla, one jump away. Galaxy 1.
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: [RELEASE] New Cargoes OXP (1.2.3 released 9 February 201

Post by cim »

Thanks. 1.2.3 has now been released to fix the pricing bug.
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2453
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:

Re: [RELEASE] New Cargoes OXP (1.2.3 released 9 February 201

Post by Wildeblood »

cim,

A problem with New Cargoes is that its simulated trades aren't notified to scripts that monitor trading by listening for playerBoughtCargo or playerSoldCargo events. Any cargo added to the manifest by New Cargoes appears to be scooped freebies, rather than expensive purchases.

I had a similar issue with Autotrade, of course, where I have four functions that simulate trading. I previously had code like this, tacked into each of those functions:-

Code: Select all

		if (worldScripts["AI Trading Assistant"])
			{
			worldScripts["AI Trading Assistant"].playerSoldCargo(cargo, saleQuantity, price);
			}
		if (worldScripts["market_observer"])
			{
			worldScripts["market_observer"].playerSoldCargo(cargo, saleQuantity, price);
			}
I've now replaced that with a notifyOtherScripts function, so the mess above gets replaced with:-

Code: Select all

		this.$notifyOtherScripts("sold", cargo, saleQuantity, price);
The notifyOtherScripts function compiles a list of all other world scripts that are listening for playerBoughtCargo or playerSoldCargo the first time it is called. The whole kaboodle looks like this:-

Code: Select all

/* 		OTHER SCRIPTS THAT MONITOR TRADING (WHITE LIST)

	$pleaseNotify is normally compiled automatically, and includes all scripts which 
	monitor playerBoughtCargo or playerSoldCargo. But, if other scripts are causing 
	problems, you can un-comment this white-list and only the included script names 
	will be notified of automatic trades. */

// this.$pleaseNotify = ["AI Trading Assistant","market_observer"];

Code: Select all

/* NOTIFY OTHER SCRIPTS ABOUT TRADES PERFORMED */

this.$notifyOtherScripts = function(type, cargo, quantity, price)
	{
	if (!this.$pleaseNotify)
		{
		this.$makePleaseNotifyList();
		}
	var scriptName;
	for (var i = 0; i < this.$pleaseNotify.length; i++)
		{
		scriptName = this.$pleaseNotify[i];
		if (worldScripts[scriptName])
			{
			if (type === "bought" && worldScripts[scriptName].playerBoughtCargo)
				{
				worldScripts[scriptName].playerBoughtCargo(cargo, quantity, price);
				}
			if (type === "sold" && worldScripts[scriptName].playerSoldCargo)
				{
				worldScripts[scriptName].playerSoldCargo(cargo, quantity, price);
				}
			}
		}
	}

Code: Select all

this.$makePleaseNotifyList = function()
	{
	var scriptNames = [], scriptName;
	for (var i = 0; i < worldScriptNames.length; i++)
		{
		scriptName = worldScriptNames[i];
		if (worldScripts[scriptName].playerBoughtCargo || worldScripts[scriptName].playerSoldCargo)
			{
			scriptNames.push(scriptName);
			}
		}
	this.$pleaseNotify = scriptNames;
	}
So,
1.) Is there a better way to go about this?
2.) Could you add something similar to your attemptPurchase and attemptSale functions to notify Trading Assistant and other trade monitoring scripts about the cargo you are adding and removing from the manifest?
In your heart, you know it's flat.
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: [RELEASE] New Cargoes OXP (1.2.3 released 9 February 201

Post by cim »

1) No, looks like a sensible way to go about it.
2) Yes. Though, should it just call their playerBoughtCargo functions with the generic type of the good, or should it call a different function with the specific good ID instead? Or both? I'll have a think about it and put something together.
User avatar
FSOneblin
---- E L I T E ----
---- E L I T E ----
Posts: 460
Joined: Tue Oct 30, 2007 12:15 am
Location: Yes, That is True

Re: [RELEASE] New Cargoes OXP (1.2.3 released 9 February 201

Post by FSOneblin »

Hey Cim! I love your OXP! It adds so much to the oolite world! Thanks for creating it!

I was wondering if anyone made an idiots handbook to trading in advanced cargos? Just something telling what the imports and exports of planets are. If such a handbook for impatient idiots has not been created, would you be offended at all if I created it, or do you think such an object would take away from what you wanted the "New Cargos Experience" to be?
Don't panic

Now an "adult!"
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: [RELEASE] New Cargoes OXP (1.2.3 released 9 February 201

Post by cim »

FSOneblin wrote:
I was wondering if anyone made an idiots handbook to trading in advanced cargos? Just something telling what the imports and exports of planets are.
No, not as far as I know. With the number of cargoes and planets, that's going to be a big handbook, but I expect a lot of people might find it useful.
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16081
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: [RELEASE] New Cargoes OXP (1.2.3 released 9 February 201

Post by Cody »

cim wrote:
... that's going to be a big handbook, but I expect a lot of people might find it useful.
<chortles> An addition for the ship's library, perhaps?
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
Solonar
Deadly
Deadly
Posts: 174
Joined: Sun Dec 04, 2011 4:04 am
Location: Galaxy 2 - Space Truckin

Re: [RELEASE] New Cargoes OXP (1.2.3 released 9 February 201

Post by Solonar »

I took screen shots, 'lots' of screen shots, of the special cargoes listings and have a comprehensive archive of special cargoes in all eight galaxies. That would be a good way to start collecting such a list.
Image

SolarTech proudly presents the Plasma Turret Regulator Device Apparatus, aka the Turret Toggler
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16081
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: [RELEASE] New Cargoes OXP (1.2.3 released 9 February 201

Post by Cody »

Solonar wrote:
I took screen shots, 'lots' of screen shots, of the special cargoes listings and have a comprehensive archive of special cargoes in all eight galaxies.
Bravo! The immersion and dedication that this game inspires never ceases to amaze me!
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
Diziet Sma
---- E L I T E ----
---- E L I T E ----
Posts: 6312
Joined: Mon Apr 06, 2009 12:20 pm
Location: Aboard the Pitviper S.E. "Blackwidow"

Re: [RELEASE] New Cargoes OXP (1.2.3 released 9 February 201

Post by Diziet Sma »

cim wrote:
FSOneblin wrote:
I was wondering if anyone made an idiots handbook to trading in advanced cargos? Just something telling what the imports and exports of planets are.
No, not as far as I know. With the number of cargoes and planets, that's going to be a big handbook, but I expect a lot of people might find it useful.
I for one most certainly would!

I've toyed with the idea of such a handbook myself, but never made an attempt, as it would be a massive undertaking..
Solonar wrote:
I took screen shots, 'lots' of screen shots, of the special cargoes listings and have a comprehensive archive of special cargoes in all eight galaxies. That would be a good way to start collecting such a list.
Now that's impressive! 8)

<subtle hint mode>
Is it in a shareable condition?
</subtle hint mode>
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
User avatar
FSOneblin
---- E L I T E ----
---- E L I T E ----
Posts: 460
Joined: Tue Oct 30, 2007 12:15 am
Location: Yes, That is True

Re: [RELEASE] New Cargoes OXP (1.2.3 released 9 February 201

Post by FSOneblin »

Solonar wrote:
I took screen shots, 'lots' of screen shots, of the special cargoes listings and have a comprehensive archive of special cargoes in all eight galaxies. That would be a good way to start collecting such a list.
Indeed it would! That's what I've started doing, as I've just been playing oolite all day. As other commanders have suggested, is it possible for you to upload the screenshots to a file sharing site? That would make this task much easier.
Don't panic

Now an "adult!"
Post Reply