Page 3 of 4

Posted: Sat Dec 18, 2010 9:37 am
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.

Posted: Tue Dec 21, 2010 10:58 pm
by XB7
This is a really creative mod. Thumbs up!

Re: [UPDATED] Stellar Serpents OXP v1.02

Posted: Tue Jan 25, 2011 11:18 am
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 ;)

Re:

Posted: Mon Jan 30, 2012 7:41 am
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!

Re: Re:

Posted: Mon Jan 30, 2012 8:19 pm
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.

Re: Stellar Serpents OXP

Posted: Mon Jan 30, 2012 8:35 pm
by Commander McLane
Out of interest: what happens when the mission variable ends up being -1?

Re: Stellar Serpents OXP

Posted: Mon Jan 30, 2012 9:31 pm
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

Re: Re:

Posted: Mon Jan 30, 2012 9:53 pm
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!

Re: Stellar Serpents OXP

Posted: Mon Jan 30, 2012 10:19 pm
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)...

Re: Stellar Serpents OXP

Posted: Mon Jan 30, 2012 10:33 pm
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.

Re: Stellar Serpents OXP

Posted: Mon Jan 30, 2012 11:20 pm
by JensAyton
Math.floor(Math.random() * 256) is the correct way to get an almost-unbiased integer in the closed range [0..255].

Re: Stellar Serpents OXP

Posted: Tue Jan 31, 2012 9:20 pm
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.

Re: Re:

Posted: Sat Feb 04, 2012 11:29 pm
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.

Re: Stellar Serpents OXP

Posted: Sun Feb 05, 2012 12:50 pm
by Commander McLane
Ceuses is system #4. Maybe the current algorithm with the faulty use of Math.random() creates a bias for that number?

Re: Stellar Serpents OXP

Posted: Sun Feb 05, 2012 8:58 pm
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......