Page 2 of 2

Posted: Wed Feb 24, 2010 7:42 am
by JensAyton
allikat wrote:
There are statements in the script which implies the percentage drops even lower once you turn them down a few times.
Er, what? This seems quite explicit to me:

Code: Select all

    // If player has rejected a trumble offer, reset trumble mission with 2% probability per jump.
    if (missionVariables.trumbles === "NOT_NOW" && Math.random < 0.02)

Posted: Tue Jul 27, 2010 2:26 pm
by caracal
Ahruman wrote:
allikat wrote:
There are statements in the script which implies the percentage drops even lower once you turn them down a few times.
Er, what? This seems quite explicit to me:

Code: Select all

    // If player has rejected a trumble offer, reset trumble mission with 2% probability per jump.
    if (missionVariables.trumbles === "NOT_NOW" && Math.random < 0.02)
I was just searching the BBS for Math.random (trying to figure out if it's truly random like I thought, or if it repeats reliably in given situations, as some recent reports about my OXP have suggested) and stumbled across this thread. Shouldn't that be "Math.random()", as in calling the method, not testing the value of the method pointer? Or is there other magic at work here that I'm not understanding?

(Of course Math.random isn't "truly random" any more than any other algorithmic pseudo-random number generator is, viz von Neumann's "state of sin". But in oolite, "pseudo-random" has come to mean that the generator's seed gets reset to the same value for, what, a given system? As in the System.pseudoRandomNumber method. Which is quite handy in some circumstances, but not in my particular case.)

Posted: Tue Jul 27, 2010 4:28 pm
by Eric Walch
caracal wrote:
I was just searching the BBS for Math.random (trying to figure out if it's truly random like I thought, or if it repeats reliably in given situations, as some recent reports about my OXP have suggested) and stumbled across this thread. Shouldn't that be "Math.random()", as in calling the method, not testing the value of the method pointer? Or is there other magic at work here that I'm not understanding?
Good catch. You understand correct. Math.random < 0.2 will always stay false. I looked back and this has been wrong since the beginning. At least it was already wrong in Oolite 1.70, the first JS translation of this script. Result: only one offer and than it stops since than. And nobody complained about that :lol:

Posted: Tue Jul 27, 2010 6:45 pm
by Arexack_Heretic
heheh.
Even though I used the trumblescript as a template for trumble treats, the confusion I got in with the salted pseudorandomnumbers resulted in a corrected code. :)

Posted: Tue Jul 27, 2010 9:39 pm
by caracal
Eric Walch wrote:
caracal wrote:
Shouldn't that be "Math.random()", as in calling the method, not testing the value of the method pointer?
Good catch. You understand correct. Math.random < 0.2 will always stay false. I looked back and this has been wrong since the beginning. At least it was already wrong in Oolite 1.70, the first JS translation of this script.
Another win for open source! :D
Eric Walch wrote:
Result: only one offer and than it stops since than. And nobody complained about that :lol:
Hey, don't look at me! Even if I had known about it before, I sure wouldn't have complained!

Posted: Wed Jul 28, 2010 12:51 am
by Switeck
Commander McLane wrote:
Of course the problem then is not to extend the "well done" to other organic matter on your ship... :roll:
THERE'S a thought! What are the odds of being too hot over-cooking your cargo, especially food?

Posted: Wed Jul 28, 2010 2:12 am
by caracal
Switeck wrote:
THERE'S a thought! What are the odds of being too hot over-cooking your cargo, especially food?
So you change the label from "Laveian Tree Grub Filets" to "Laveian Tree Grub Jerky", raise the price 20%, and where's the problem? ;)

Posted: Wed Jul 28, 2010 2:34 am
by Arexack_Heretic
The problem is sun broiled slaves only sell when marketed as imitation edible poet.
And the dead poet society takes a dim view on misuse of their product.

Posted: Wed Jul 28, 2010 1:51 pm
by Commander McLane
Switeck wrote:
Commander McLane wrote:
Of course the problem then is not to extend the "well done" to other organic matter on your ship... :roll:
THERE'S a thought! What are the odds of being too hot over-cooking your cargo, especially food?
That was not what I had in mind. I was warning of the risk to overcook yourself.

Posted: Wed Jul 28, 2010 1:59 pm
by Arexack_Heretic
Some of use are barely alive, mind you! ;)

Posted: Wed Jul 28, 2010 6:46 pm
by Switeck
Commander McLane wrote:
Switeck wrote:
THERE'S a thought! What are the odds of being too hot over-cooking your cargo, especially food?
That was not what I had in mind. I was warning of the risk to overcook yourself.
Of course -- but maybe there can be a risk of destroying fragile cargo from excessive heat? (...Especially if the ship lacks an improved heat shield.)

Posted: Wed Jul 28, 2010 6:53 pm
by Arexack_Heretic
Now that I can relate to. :D

"One tonne of slaves perished from the heat: gain a tonne of food"
"The heat makes you thirsty: you break the seals on a container of cooled Aesian water. -1 tn liquors"
"Sensitive components in a container of hyper Amstrad computers, render them useless. -1t C, +1t alloys."
"You can now sell your food as radioactives."
etc.

Posted: Thu Jul 29, 2010 9:47 pm
by Commander McLane
Arexack_Heretic wrote:
"You can now sell your food as radioactives."
I like especially this one, although it is not immediately clear how heat would make food radioactive.

(Note to self: never eat cake again, or soup.) :P

Posted: Thu Jul 29, 2010 10:01 pm
by Arexack_Heretic
"It's the neutrinos that give it that extra oumph!" :D

Well...solar radiation and such... :P
no, it does not make any sense, universal containers are designed to withstand hard vacuum and radiation both. :roll:

Posted: Fri Jul 30, 2010 1:12 am
by Switeck
Hard vacuum and even typical space radiation won't make a cargo canister warm. It'll probably instead leave nitrogen pooling as a liquid.
But if you're cooking trumbles in your cabin then chances are the cargo bay is at least as hot as that. Food even in a cargo canister may be slowly overcooked.