Stellar Serpents OXP

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

Moderators: another_commander, winston

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 »

Eric Walch wrote:
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......
So once it has been killed, either by me or reported as killed by someone else, the next one should re-appear in the same place as the dead one? That would explain it.
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
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 »

SandJ wrote:
So once it has been killed, either by me or reported as killed by someone else, the next one should re-appear in the same place as the dead one? That would explain it.
Once it is killed another one should appear at a fully random system. But you wrote:
On each occasion I have been half a galaxy away and the serpent has disappeared long before I could get there.
So you never killed it and it stayed wandering through that area of the galaxy
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 »

Eric Walch wrote:
But you wrote:
On each occasion I have been half a galaxy away and the serpent has disappeared long before I could get there.
So you never killed it and it stayed wandering through that area of the galaxy
They are being reported as killed by someone else. Then it is "There are no Stellar Serpents at this time" for a while, then "A Stellar Serpent has turned up in Ceuses".

I shall make my way back there and kill another one, and see how many times I can get this to happen...
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: Stellar Serpents OXP

Post by SandJ »

OK, I've jumped back and forth and kept watching. Eventually someone killed the serpent in Ceuses, then eventually a new one appeared in Quleraat. After my next jump it had moved to Ceuses despite them being about 38 light years apart.

I think what may be happening is the Serpent is indeed appearing in a random system, but when it jumps it always ends up in Ceuses. I just happen to hear about it being there when I dock, which I only do about once in every 6 witchspace jumps.

Keep jumping back and forth ... eventually the Serpent appeared in Ceorge, 10 LY away from Ceuses. 3 witchspace jumps later by me (and I check the Serpent's location ater each jump), "Stellar Serpent moved to the Ceuses system".

New theory, then. In Galaxy 5, when the Stellar Serpent moves, it always moves to Ceuses.

To save anyone else going looking, I suspect this is the relevant code from this.shipWillEnterWitchspace = function() in stellarSerpents_masterScript.js:

Code: Select all

if(this.actionChance < 0.9) // serpent moves system 45% of time
    {
    missionVariables.stellarSerpents_serpentLife += 1;
    var currentSystem = System.infoForSystem(galaxyNumber, missionVariables.stellarSerpents_currentLocation);
    this.systemArray = SystemInfo.filteredSystems(this, function(other)
        { return (other.systemID !== currentSystem.systemID) && (currentSystem.distanceToSystem(other) <= 7); } );
    this.destinationSystem = Math.floor((Math.random() - 0.0001) * this.systemArray.length);
    missionVariables.stellarSerpents_currentLocation = this.systemArray[this.destinationSystem][2];
    missionVariables.stellarSerpents_locationName = System.infoForSystem(galaxyNumber, missionVariables.stellarSerpents_currentLocation).name;
    mission.setInstructionsKey("stellarSerpents_shortMoved", "stellarSerpents_masterScript.js");
    }
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
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: Stellar Serpents OXP

Post by cim »

SandJ wrote:

Code: Select all

    missionVariables.stellarSerpents_currentLocation = this.systemArray[this.destinationSystem][2];
This is probably the problem - at least, all the other lines look fine. At a guess, index 2 of the SystemInfo object is the galaxyID, which is constantly 4 in Chart 5, which as Commander McLane noted, is also the system ID of Ceuses.

Try changing it to

Code: Select all

    missionVariables.stellarSerpents_currentLocation = this.systemArray[this.destinationSystem].systemID;
and see if that fixes the problem.
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 »

SandJ wrote:
I think what may be happening is the Serpent is indeed appearing in a random system, but when it jumps it always ends up in Ceuses. I just happen to hear about it being there when I dock, which I only do about once in every 6 witchspace jumps.
You could be right. At the moment, I don't understand what the line:

Code: Select all

missionVariables.stellarSerpents_currentLocation = this.systemArray[this.destinationSystem][2];
in your quoted code does. I think it should be:

Code: Select all

missionVariables.stellarSerpents_currentLocation = this.systemArray[this.destinationSystem]["systemID"];
It also does not help in understanding the code when 'currentSystem' is a systemInfo object and the similar looking 'this.destinationSystem' is just an integer.

EDIT: Just ninja-ed by cim

The code becomes better readable, I think, by using:

Code: Select all

		if(this.actionChance < 0.9) // serpent moves system 45% of time
			{
			missionVariables.stellarSerpents_serpentLife += 1;
			var currentSystem = System.infoForSystem(galaxyNumber, missionVariables.stellarSerpents_currentLocation);
			var systemArray = currentSystem.systemsInRange(7);
			var destinationSystem = systemArray[Math.floor((Math.random()) * systemArray.length)];
			missionVariables.stellarSerpents_currentLocation = destinationSystem.systemID;
			missionVariables.stellarSerpents_locationName = destinationSystem.name;
			mission.setInstructionsKey("stellarSerpents_shortMoved");
			}
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5525
Joined: Thu Jun 12, 2008 6:55 pm

Re: Stellar Serpents OXP

Post by Thargoid »

I'll fix it and upload a new version later this week (just back from vacation, too many other things to do at the moment). But it does sound like there's a minor issue in the script there that the posted code would fix.

Editted to add - v1.21 now uploaded with the script tweak.
Post Reply