Help - how to change the randomness of cargo pod contents?
Posted: Mon Sep 19, 2011 4:02 am
I downloaded the pods OXP (under mechanics) which changes not only the chance of getting > 1t of cargo but also cargo jams, explosions, empty pods and the like. I want to increase the probabilities of each outcome but cannot see anywhere under the config or scripts folders where to do this. I can confirm the mod works and as the author states, each probability is small.
E.g.
Excerpt from shipdata.plist in config....
"pods_emptybarrel" =
{
like_ship = "barrel";
cargo_type = "CARGO_SCRIPTED_ITEM";
roles = "cargopod(0.1) pods_emptypod emptyPod emptypod";
scanClass = "CLASS_CARGO";
script = "pods_emptypod.js";
};
Now the line that says roles="Cargopod(0.1) pods.... I thought that the 0.1 might mean 10% chance of this happening but have tweaked the 0.1 to all sorts of numbers (0.9,1.0, 100, 1000) and it doesnt make any difference
Excerpt from the scripts folder for determining the amount of cargo (in tons). I can see random()*10 equates to 1-10 tons as stated in the readme but dont know what the function scooper is all about or where the probabilities lie.
this.shipWasScooped = function(scooper)
{
if(scooper.isPlayer && player.ship.cargoSpaceAvailable > 0)
{
let award = (Math.ceil(Math.random()*10));
let cargo = expandDescription('[pod_content_tons]');
if(player.ship.cargoSpaceAvailable > award)
{
player.consoleMessage(award + " tons " + cargo, 6);
manifest[cargo] += award;
}
else
{
player.consoleMessage(player.ship.cargoSpaceAvailable + " tons " + cargo + " - hold full", 6);
manifest[cargo] += player.ship.cargoSpaceAvailable;
}
}
}
If anyone can help I would be most grateful!
Cheers
E.g.
Excerpt from shipdata.plist in config....
"pods_emptybarrel" =
{
like_ship = "barrel";
cargo_type = "CARGO_SCRIPTED_ITEM";
roles = "cargopod(0.1) pods_emptypod emptyPod emptypod";
scanClass = "CLASS_CARGO";
script = "pods_emptypod.js";
};
Now the line that says roles="Cargopod(0.1) pods.... I thought that the 0.1 might mean 10% chance of this happening but have tweaked the 0.1 to all sorts of numbers (0.9,1.0, 100, 1000) and it doesnt make any difference
Excerpt from the scripts folder for determining the amount of cargo (in tons). I can see random()*10 equates to 1-10 tons as stated in the readme but dont know what the function scooper is all about or where the probabilities lie.
this.shipWasScooped = function(scooper)
{
if(scooper.isPlayer && player.ship.cargoSpaceAvailable > 0)
{
let award = (Math.ceil(Math.random()*10));
let cargo = expandDescription('[pod_content_tons]');
if(player.ship.cargoSpaceAvailable > award)
{
player.consoleMessage(award + " tons " + cargo, 6);
manifest[cargo] += award;
}
else
{
player.consoleMessage(player.ship.cargoSpaceAvailable + " tons " + cargo + " - hold full", 6);
manifest[cargo] += player.ship.cargoSpaceAvailable;
}
}
}
If anyone can help I would be most grateful!
Cheers