Page 15 of 18

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

Posted: Wed Feb 06, 2013 8:49 pm
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.

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

Posted: Wed Feb 06, 2013 9:32 pm
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.

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

Posted: Sat Feb 09, 2013 7:47 am
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...

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

Posted: Sat Feb 09, 2013 8:00 am
by cim
You did get lucky, but also sounds like a bug. Can you remember which planets?

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

Posted: Sat Feb 09, 2013 8:25 am
by Keeper
Looked it up. The buyer was on Bemaera. The sticks were from Esesla, one jump away. Galaxy 1.

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

Posted: Sat Feb 09, 2013 10:58 am
by cim
Thanks. 1.2.3 has now been released to fix the pricing bug.

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

Posted: Sat Feb 16, 2013 2:43 pm
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?

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

Posted: Sat Feb 16, 2013 3:03 pm
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.

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

Posted: Sat Jun 08, 2013 7:22 pm
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?

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

Posted: Sat Jun 08, 2013 8:03 pm
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.

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

Posted: Sat Jun 08, 2013 8:19 pm
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?

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

Posted: Sat Jun 08, 2013 11:04 pm
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.

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

Posted: Sat Jun 08, 2013 11:10 pm
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!

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

Posted: Sun Jun 09, 2013 12:23 am
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>

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

Posted: Sun Jun 09, 2013 1:09 am
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.