Stellar Serpents OXP

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

Moderators: winston, another_commander

User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

When you dock you may get an update. Or alternatively look in the mission summary screen (F5 when docked, or F5-F5 when in-flight). And once you're actually in the system, well just fly around a bit and you may come across it. What'ya want, a beacon? :P

I was originally planning to mark the location on the long-range map, but that would get complicated as if it moved through a system already marked by another OXP or script then it would remove the mark - which could screw up the other mission somewhat.

Oh and their arrival location is entirely random, so there's as much chance of one appearing in a next-door system as one on the other side of the galaxy.
User avatar
XB7
Competent
Competent
Posts: 44
Joined: Wed Jul 15, 2009 9:00 pm
Location: Oregon, US

Post by XB7 »

This is a really creative mod. Thumbs up!
User avatar
dima
Competent
Competent
Posts: 37
Joined: Thu Feb 12, 2009 12:08 am
Location: Karamoon

Re: [UPDATED] Stellar Serpents OXP v1.02

Post by dima »

Wow, never thought this would actually happen - but here it is :D I was the one who created that old Space Monster thread over there. And now I'm really glad I still check the boards from time to time! Amazing work, keep it up! Highest possible rating from me ;)
Like an old publisher (Thorn EMI) once said when asked to publish a game called Elite:
"For us to publish it we would need a game with a score and three lives (...)"
User avatar
SandJ
---- E L I T E ----
---- E L I T E ----
Posts: 1048
Joined: Fri Nov 26, 2010 9:08 pm
Location: Help! I'm stranded down here on Earth!

Re:

Post by SandJ »

Thargoid wrote:
Oh and their arrival location is entirely random, so there's as much chance of one appearing in a next-door system as one on the other side of the galaxy.
Funny stuff, chance.

I can see for myself what you say is true (missionVariables.stellarSerpents_currentLocation = Math.floor((Math.random() - 0.0001) * 256);) but while I have been bimbling about in Galaxy 5, a stellar serpent appeared three times in Ceuses (galactic far east) and once somewhere up in the galactic north.

On each occasion I have been half a galaxy away and the serpent has disappeared long before I could get there.

This time, I had taken a cargo mission to Ceuses, got myself made Offender by accident (honest, Your Honour, I lasered the space station by accident) and so jumped back and forth between Ceuses and neighbouring Entizare a few times to clear it. On making one of the jumps back to Ceuses I was told the serpent had appeared there - for the fourth time!
Flying a Cobra Mk I Cobbie 3 with nothing but Explorers Club.OXP and a beam laser 4 proper lasers for company :D
Dropbox referral link 2GB of free space online + 500 Mb for the referral: good for securing work-in-progress.
User avatar
fronclynne
Deadly
Deadly
Posts: 149
Joined: Sun Mar 01, 2009 5:36 am
Location: ::1

Re: Re:

Post by fronclynne »

SandJ wrote:
Thargoid wrote:
Oh and their arrival location is entirely random, so there's as much chance of one appearing in a next-door system as one on the other side of the galaxy.
Funny stuff, chance.

I can see for myself what you say is true (missionVariables.stellarSerpents_currentLocation = Math.floor((Math.random() - 0.0001) * 256);) but while I have been bimbling about in Galaxy 5, a stellar serpent appeared three times in Ceuses (galactic far east) and once somewhere up in the galactic north.

On each occasion I have been half a galaxy away and the serpent has disappeared long before I could get there.

This time, I had taken a cargo mission to Ceuses, got myself made Offender by accident (honest, Your Honour, I lasered the space station by accident) and so jumped back and forth between Ceuses and neighbouring Entizare a few times to clear it. On making one of the jumps back to Ceuses I was told the serpent had appeared there - for the fourth time!
In Galaxy 1 it almost always appears (for me) at Tibedied, so I guess it's time to see if it will always spawn at Raedre if I pop up to Galaxy 7.
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:

Re: Stellar Serpents OXP

Post by Commander McLane »

Out of interest: what happens when the mission variable ends up being -1?
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: Stellar Serpents OXP

Post by Eric Walch »

Commander McLane wrote:
Out of interest: what happens when the mission variable ends up being -1?
Yes, I also asked myself this question. I don't understand why Math.random() is lowered in a way it can get a negative result.

By the ecma5 definition used for our current JS:

Code: Select all

15.8.2.14 random ( )
Returns a Number value with positive sign, greater than or equal to 0 but less than 1, chosen randomly or pseudo randomly with approximately uniform distribution over that range, using an implementation-dependent algorithm or strategy. This function takes no arguments.
That means 1.000 is excluded anyway from the random numbers. There is no need to subtract anything to keep it below 1.000
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2411
Joined: Mon May 31, 2010 11:11 pm

Re: Re:

Post by Switeck »

SandJ wrote:
I can see for myself what you say is true (missionVariables.stellarSerpents_currentLocation = Math.floor((Math.random() - 0.0001) * 256);) but while I have been bimbling about in Galaxy 5, a stellar serpent appeared three times in Ceuses (galactic far east) and once somewhere up in the galactic north.
If for some reason, the desire was heavier weighting towards system.ID 0...this change might work:
missionVariables.stellarSerpents_currentLocation = Math.floor(Math.abs(Math.random() - 0.0001) * 256);

Then again, -1 for a system.ID is (any) interstellar space...so that may be desirable!
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Re: Stellar Serpents OXP

Post by Thargoid »

Learn something new every day...

I didn't know it was <1 rather than <=1. Will fix it at the next update, not sure what it'd do with a -1 (or a 0 for that matter)...
User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

Re: Stellar Serpents OXP

Post by Capt. Murphy »

Math.round(Math.random() * 255) perhaps. Systems are numbered 0 to 255, so 0 should be fine??

Re the non randomness of Math.random(), apparently it's seeded by the current time when the script starts - don't know if that's RL time though...?? Must be..?

Edit - Of course it is what Ahruman posted - *mutters* must not post impulsively when intoxicated.
Last edited by Capt. Murphy on Tue Jan 31, 2012 7:10 am, edited 2 times in total.
[EliteWiki] Capt. Murphy's OXPs
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: Stellar Serpents OXP

Post by JensAyton »

Math.floor(Math.random() * 256) is the correct way to get an almost-unbiased integer in the closed range [0..255].
User avatar
SandJ
---- E L I T E ----
---- E L I T E ----
Posts: 1048
Joined: Fri Nov 26, 2010 9:08 pm
Location: Help! I'm stranded down here on Earth!

Re: Stellar Serpents OXP

Post by SandJ »

Blowing these up really is a jolly wheeze. Actually, just watching them move is entertainment enough. It seemed a shame to kill it. :twisted:

Now then, the remaining corpse segments. These things are pretty big and hard and are a hazard to the shipping lanes. I think destruction of each of them warrants a bounty of 1 Cr like destroying an asteroid does.

I only realised how big when I tried scooping one, failed ("Thud!"), then had a look from an external view and saw it was big enough to dock my Python in!

Additional thought: when each of the corpse segments are destroyed, should they randomly give up a small quantity of Alien Items? Minerals? Food? Furs? (With a greater likelihood if a mining laser is used?)

In this way, being too late to decapitate the snake still allows the tardy trader to be rewarded for working to keep the space lanes clear.
Flying a Cobra Mk I Cobbie 3 with nothing but Explorers Club.OXP and a beam laser 4 proper lasers for company :D
Dropbox referral link 2GB of free space online + 500 Mb for the referral: good for securing work-in-progress.
User avatar
SandJ
---- E L I T E ----
---- E L I T E ----
Posts: 1048
Joined: Fri Nov 26, 2010 9:08 pm
Location: Help! I'm stranded down here on Earth!

Re: Re:

Post by SandJ »

SandJ wrote:
while I have been bimbling about in Galaxy 5, a stellar serpent appeared three times in Ceuses (galactic far east) and once somewhere up in the galactic north.
Now four times in Ceuses.

It ain't random. Deffo.
Flying a Cobra Mk I Cobbie 3 with nothing but Explorers Club.OXP and a beam laser 4 proper lasers for company :D
Dropbox referral link 2GB of free space online + 500 Mb for the referral: good for securing work-in-progress.
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:

Re: Stellar Serpents OXP

Post by Commander McLane »

Ceuses is system #4. Maybe the current algorithm with the faulty use of Math.random() creates a bias for that number?
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: Stellar Serpents OXP

Post by Eric Walch »

Commander McLane wrote:
Ceuses is system #4. Maybe the current algorithm with the faulty use of Math.random() creates a bias for that number?
Math.random() has no bug in it. Thargoid programmed the appearance so that the serpents always appear in the same area were he was last spotted. On entering the galaxy, the system is chosen randomly, but after that it only moves slowly through the galaxy.

People just should read the readme:
readme wrote:
The creatures wanders from system to system using wormholes from other ships transit to witchspace, causing a navigational hazard and generally making a nuisance of themselves......
Post Reply