[Depricated] Trumble Treats - coming soon!

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

User avatar
Arexack_Heretic
Dangerous Subversive Element
Dangerous Subversive Element
Posts: 1876
Joined: Tue Jun 07, 2005 7:32 pm
Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
Contact:

Post 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.
Riding the Rocket!
User avatar
Cmdr James
Commodore
Commodore
Posts: 1357
Joined: Tue Jun 05, 2007 10:43 pm
Location: Berlin

Post 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).
User avatar
Arexack_Heretic
Dangerous Subversive Element
Dangerous Subversive Element
Posts: 1876
Joined: Tue Jun 07, 2005 7:32 pm
Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
Contact:

Post 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.
Riding the Rocket!
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post 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.
User avatar
Cmd. Cheyd
---- E L I T E ----
---- E L I T E ----
Posts: 934
Joined: Tue Dec 16, 2008 2:52 pm
Location: Deep Horizon Industries Manufacturing & Research Site somewhere in G8...

Post by Cmd. Cheyd »

scrambledPseudoRandomNumber
Where is documentation on this one?
User avatar
Arexack_Heretic
Dangerous Subversive Element
Dangerous Subversive Element
Posts: 1876
Joined: Tue Jun 07, 2005 7:32 pm
Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
Contact:

Post 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:
Riding the Rocket!
User avatar
Arexack_Heretic
Dangerous Subversive Element
Dangerous Subversive Element
Posts: 1876
Joined: Tue Jun 07, 2005 7:32 pm
Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
Contact:

Post 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.
Riding the Rocket!
User avatar
Arexack_Heretic
Dangerous Subversive Element
Dangerous Subversive Element
Posts: 1876
Joined: Tue Jun 07, 2005 7:32 pm
Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
Contact:

Post 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
Riding the Rocket!
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post 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)
Last edited by Commander McLane on Wed Jul 28, 2010 2:07 pm, edited 1 time in total.
User avatar
Arexack_Heretic
Dangerous Subversive Element
Dangerous Subversive Element
Posts: 1876
Joined: Tue Jun 07, 2005 7:32 pm
Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
Contact:

Post 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.
Last edited by Arexack_Heretic on Wed Jul 28, 2010 3:16 am, edited 1 time in total.
Riding the Rocket!
User avatar
CheeseRedux
---- E L I T E ----
---- E L I T E ----
Posts: 827
Joined: Fri Oct 02, 2009 6:50 pm

Post by CheeseRedux »

Say, A_H, am I having an ocular malfunction, or is your computer's clock off by a month?
"Actually this is a common misconception... I do *not* in fact have a lot of time on my hands at all! I just have a very very very very bad sense of priorities."
--Dean C Engelhardt
User avatar
Arexack_Heretic
Dangerous Subversive Element
Dangerous Subversive Element
Posts: 1876
Joined: Tue Jun 07, 2005 7:32 pm
Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
Contact:

Post 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.
Riding the Rocket!
User avatar
CheeseRedux
---- E L I T E ----
---- E L I T E ----
Posts: 827
Joined: Fri Oct 02, 2009 6:50 pm

Post 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:
"Actually this is a common misconception... I do *not* in fact have a lot of time on my hands at all! I just have a very very very very bad sense of priorities."
--Dean C Engelhardt
User avatar
docwild
Dangerous
Dangerous
Posts: 64
Joined: Thu Mar 29, 2007 1:36 pm

Post 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.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Post 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") 
Post Reply