updateGeneralCommodityDefinition triggering

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2553
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

updateGeneralCommodityDefinition triggering

Post by spara » Sat Aug 20, 2016 2:04 pm

I'm tweaking primary markets and have edited the trade-goods.plist to have a market script for the goods. In that market script I have

Code: Select all

this.updateGeneralCommodityDefinition = function(goodDefinition, station, system) {
	
	//only change the primary market and don't touch alien items.
	if (station || goodDefinition.key === "alien_items") {
		return goodDefinition;
	}
And later on a logger that triggers when the script is being executed. For some reason the script gets triggered twice per system and it seems that it triggers for a hermit. The quantities seem to match a hermit. The station parameter is null though. According to the wiki the script should be run once with null station when the system is created and later on with station as a parameter.

Is there something wrong somewhere or am I missing something?

User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2553
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Re: updateGeneralCommodityDefinition triggering

Post by spara » Sun Aug 21, 2016 7:56 am

A bit more data. I jumped from Lave to Leesti and logged the system parameter. And it was interesting.

Code: Select all

10:51:30.310 [test]: 55
10:51:30.310 [test]: 55
10:51:30.310 [test]: 55
10:51:30.310 [test]: 55
10:51:30.310 [test]: 55
10:51:30.311 [test]: 55
10:51:30.311 [test]: 55
10:51:30.311 [test]: 55
10:51:30.311 [test]: 55
10:51:30.311 [test]: 55
10:51:30.311 [test]: 55
10:51:30.312 [test]: 55
10:51:30.312 [test]: 55
10:51:30.312 [test]: 55
10:51:30.312 [test]: 55
10:51:30.312 [test]: 55
10:51:30.312 [test]: 55
10:51:31.014 [test]: 171
10:51:31.017 [test]: 144
10:51:31.026 [test]: 135
10:51:31.033 [test]: 254
10:51:31.037 [test]: 150
10:51:31.044 [test]: 18
10:51:31.055 [test]: 18
10:51:31.062 [test]: 121
10:51:31.066 [test]: 229
The first 55s are as they should be, one for each commodity, but those last ones?

Post Reply