"use strict";
this.name = "In_System_Trader";
this.author = "DrTripsa";
this.copyright = "2013 Rob Hess";
this.licence = "CC BY 3.0";
this.description = "In system trader support";
this.version = "1.0";
//1.0 Basic changes, re-calculate prices/quantities when player leaves main station
this.shipLaunchedFromStation = function(station)
{
if (station.isMainStation)
{
var RAND_MULT = (system.scrambledPseudoRandomNumber(clock.minutes) * 255);
station.setMarketPrice("Food",(station.market.food.marketBasePrice + (RAND_MULT & station.market.food.marketMaskPrice) + ( system.economy * station.market.food.marketEcoAdjustPrice)));
station.setMarketQuantity("Food",(station.market.food.marketBaseQuantity + (RAND_MULT & station.market.food.marketMaskQuantity) + ( system.economy * station.market.food.marketEcoAdjustQuantity)) );
}
}
The end result will be a new market with each launch (of the player) from the main station, based correctly on economy etc
as you can see the number is currently not in range, but I'm unsure has to how to fix this.
any help would be greatly appreciated.
No, I'm not a Trumble... that's a speciest and offensive remark!
~munch~
What?.... I'm hungry.
I question the purpose: changing the prices every time you launch means having the opportunity of making money without going anywhere, not even as far as another station within sight. Just launch, re-dock.
I question the purpose: changing the prices every time you launch means having the opportunity of making money without going anywhere, not even as far as another station within sight. Just launch, re-dock.
Prices remain within system average range so any profit by trading with the main station alone will be meager at best, it's a fair question, but one I considered carefully in making this OXP.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>istgreet</key>
<array>
<string>"Welcome back, Commander..."</string>
<string>"Still in this backwater system, Commander?..."</string>
<string>"Oh you're back Commander, is it tuesday already..."</string>
<string>"Back already eh? Bet you can do those spacelanes in your sleep..."</string>
<string>"Aww, miss me already Commander?..."</string>
</array>
<key>istinvite</key>
<array>
<string>"You should speak with my cousin"</string>
<string>"You should speak with my old friend"</string>
<string>"You should speak with my Fathers brothers cousins former roomate"</string>
<string>"You should speak with my boss"</string>
<string>"You should speak with my underling"</string>
<string>"You should speak with my minion"</string>
<string>"You should speak with my former lover, whom I am awkwardly still friends with,"</string>
<string>"You should speak with my clone"</string>
<string>"You should speak with my Latin dance instructor"</string>
<string>"You should speak with my sentient houseplant"</string>
<string>"You should speak with my conjoined twin"</string>
<string>"You should speak with my friends friend"</string>
</array>
<key>istoffer</key>
<array>
<string>"They owe me a favor."</string>
<string>"They need a good pilot."</string>
<string>"What about? Getting out of this arse end of space of course!"</string>
<string>"They've got need of someone... descrite."</string>
<string>"They need a fast ship, and no Naval entanglements, if you catch my drift."</string>
<string>"They owe me... especially after last night, erm... don't ask."</string>
</array>
</dict>
</plist>
this.shipEnteredStationAegis = function(station)
{
//Give player a hint that the friends they have made might have deals for them
//for a test, we'll remove the randomness
//var RAND_MULT = (system.scrambledPseudoRandomNumber(clock.minutes) * 255);
if(this.IN_SYSTEM_TRADER_REP >= 0)
{
//periodically we give the player a hint... friend of a friend etc
var message = [istgreet] + " " + [istinvite] + " " + [nom] + " " + [istoffer];
player.commsMessage(message);
}
}
Minor spelling point.. "descrite" should be "discrete".
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