Page 4 of 6

Posted: Thu Jul 22, 2010 1:30 pm
by Arexack_Heretic
lol

Hmm. I got pretty confused with all the fuss about those random numbers, having missed half the argument.

I don't get the point of having not truly random numbers then.
If I'd want a fixed random number, I'd store a true random number in a variable...
So I'd better use Math.random() then... *sigh*
I replaced all my initial instances of that for the SaltyQRN, because I thought it was the new standard. :p

oh well.

I'll be offline for a few hours. Haveta tile my GF's bathroom floor. maybe I'll get some time later.

Posted: Thu Jul 22, 2010 1:41 pm
by Cmdr James
The thing is, in the old days computers didnt have enough memory to store the whole of elite, so a system was used to generate everything.

It would not be good to have the first system called AAAAA and the second AAAAB, and so on, so a "random" sequence was developed. It cannot really be random though as you want the system to have the same names each time you play the game (or even just look at the system on the chart).

Posted: Thu Jul 22, 2010 1:53 pm
by Arexack_Heretic
yeh! That is one of the charms of elite. :)

In principle, by changing a single seed number, a whole galaxy could be changed. Even could get naughty system names! ;) Also more isolated pockets though. (Not so big a problem for OOlite anymore though)
I forget the term for it all the time, but it sorta means "content generated on the fly".
Might be a funny easteregg tweak : ultra-non-conservative-mode:
randomise the seeds for totally un-traditional universes. . . maybe barring the first.

Posted: Thu Jul 22, 2010 3:05 pm
by JensAyton
Arexack_Heretic wrote:
I forget the term for it all the time, but it sorta means "content generated on the fly".
“Procedural generation”. And yes, that’s what scrambledPseudoRandomNumber(), pseudoRandomNumber(), and indeed the legacy pseudoFixedD100_number and pseudoFixedD256_number are for.

Posted: Thu Jul 22, 2010 4:05 pm
by Cmd. Cheyd
scrambledPseudoRandomNumber
Where is documentation on this one?

Posted: Thu Jul 22, 2010 5:42 pm
by Arexack_Heretic
Cmd. Cheyd wrote:
scrambledPseudoRandomNumber
Where is documentation on this one?
in general
and:
this specifically salty.


--
edit: ps laying tile is a bitch! being logicalminded like me, the GF measured and cut all the odd bits in advance, assuming the areas were square. As I could have told her, from experience of hanging shelves in her closet, her appartment only looks square, in fact all the wall joins are more than slightly off 90degrees!
Now I understand why the previous tenants just put a bit of linoleum in there. Did only a metre or so and everything hurts. :poor me: :cry:

Posted: Sun Jul 25, 2010 4:32 pm
by Arexack_Heretic
new 0.01 versioon in op.
added wiki-page in feature-OXPs.
Edit: but it doesn't show up in the indexpages...:cry:.
here is the link to the page.

Posted: Tue Jul 27, 2010 11:49 pm
by Arexack_Heretic
Okay. Only one person downloaded so far... :(
Anyhow, got down to creating a new jameson and playing a bit for testing.
resorted to practicing docking to get the trumble offer.
Once I had the trumble, I saved and noticed that the texture of the MkIII that rotates in the savescreen is now replaced by the trumble template.
(white with grey fur and evil eyes)
I wanted an animated trumble shader, but this is not it. ;)


I have in OXPs:
wrex-cargopods 1.6.2
griff debris sets135 NNM
griffs shipset by dizzy
hotrods
nukes 0.97
shady cobra
YAH A-F
trumbleTreats_v001
Obviously a shader error, I suspect the shady cobra oxp.

As for the testing: I find that the box-o-trumble is not removed from the equipment complement and thus it is impossible to buy more than one box at a time. Unfortunately the mission variable is updated at the same time as removing the EQ, so the script will not go further from here.
This is the relevant bit of code:

Code: Select all

// When equipment is bought and turns out to be a box, it is removed and the mV updated.
this.playerBoughtEquipment = function(equipment)
{
	if (PlayerShip.hasEquipment === "EQ_TRUMBLE_BOXED")
	{
		PlayerShip.removeEquipment("EQ_TRUMBLE_BOXED");
	    missionVariables.trumbleboxes_number += 1;
	}
};
Image

Posted: Wed Jul 28, 2010 12:11 am
by Commander McLane
Arexack_Heretic wrote:
Unfortunately the mission variable is updated at the same time as removing the EQ, so the script will not go further from here.
No, it's just that your code is rubbish. :wink:

First, the syntax is player.ship.foo, not PlayerShip.foo.

Second, hasEquipment isn't even used anymore, and if it were used, the === wouldn't make any sense. It would be a method, not a property, so the correct syntax would be hasEquipment("EQ_FOO").

But anyway, we're not using hasEquipment anymore for testing for equipment. Note that it has been removed from the relevant Wiki pages. Instead we use equipmentStatus, and the correct way to test is to compare it to "EQUIPMENT_OK". So, if you would even want to go this way, the test would be if (player.ship.equipmentStatus("EQ_TRUMBLE_BOXED") === "EQUIPMENT_OK").

However, and third, that's not what you actually want to test for. The only thing you need to know is whether the equipment just bought is a trumble box. So what you want to test is whether the returned equipment parameter equals EQ_TRUMBLE_BOXED.

So this is what the relevant bit of code should look like:

Code: Select all

// When equipment is bought and turns out to be a box, it is removed and the mV updated.
this.playerBoughtEquipment = function(equipment)
{
	if (equipment === "EQ_TRUMBLE_BOXED")
	{
		player.ship.removeEquipment("EQ_TRUMBLE_BOXED");
	    missionVariables.trumbleboxes_number += 1;
	}
};
EDIT: corrected a syntax error (thanks, Thargoid)

Posted: Wed Jul 28, 2010 12:21 am
by Arexack_Heretic
Commander McLane wrote:
it's just that your code is rubbish
Yeah, I'm used to that. :P
Was just about to investigate the methods of that bit in more detail, but you beat me to it.
I must have written this in pseudocode mixed with legacy methods half remembered.
hasEquipment is still used as an example here though.

edit: argh! syntax errors ! :p
(<= != =<) :lol:

so...
why does this not register as a function? :
this.AH_trumbleTimer= new Timer(this, this.AH_fryTrumbles(), 0 ,5);
this.AH_fryTrumbles = function()
{lots of stuff};
too tired now...sleepy.

Posted: Wed Jul 28, 2010 3:15 am
by CheeseRedux
Say, A_H, am I having an ocular malfunction, or is your computer's clock off by a month?

Posted: Wed Jul 28, 2010 3:18 am
by Arexack_Heretic
CheeseRedux wrote:
Say, A_H, am I having an ocular malfunction, or is your computer's clock off by a month?
hah! That is weird, my computer clock is fine.
Oolite is so retro it lives a month ago. ;)

found numerous typos and such, uploading 0.02.
Still dysfunctional, but shows recent code.

Posted: Wed Jul 28, 2010 3:48 am
by CheeseRedux
Ah, of course, that's it. It's the build date or whatnot.
Mine says Sep 22 2009. (Yes, I still haven't installed 1.74. Downloaded, but not installed.)
That's what I get for never using anything but fullscreen. :oops:

Posted: Wed Jul 28, 2010 4:42 am
by docwild
You uploaded a new version a few minutes after I d/led the other one. :P

If you want a delay before launching the player you can use the closures (like typecasting in C):
var trumbleLaunchTimer = new Timer(this, function(){
if(PlayerShip.docked) PlayerShip.launch();
}, delay, interval);
Which is just awful and ugly syntax, but it works.

Posted: Wed Jul 28, 2010 6:11 am
by Thargoid
Commander McLane wrote:
But anyway, we're not using hasEquipment anymore for testing for equipment. Note that it has been removed from the relevant Wiki pages. Instead we use equipmentStatus, and the correct way to test is to compare it to "EQUIPMENT_OK". So, if you would even want to go this way, the test would be if (player.ship.equipmentStatus("EQ_TRUMBLE_BOXED" === "EQUIPMENT_OK").
You're missing a bracket in the test. It should be

Code: Select all

if(player.ship.equipmentStatus("EQ_TRUMBLE_BOXED") === "EQUIPMENT_OK")