Page 5 of 5

Re: Thargoids and Interstellar Space...too common?

Posted: Sat Feb 12, 2011 6:10 pm
by Commander McLane
Switeck wrote:
I'm not worried that OXPs "muck things up" by adding more Thargoids. I will be hacking OXPs to my liking, once I figure out some solid code for detecting if the arrival in interstellar space came from a deliberate misjump FROM interstellar space.
That's fairly easy.

Code: Select all

this.shipWillEnterWitchspace = function()
{
    if(system.isInterstellarSpace)
        this.comingFromInterstellarSpace = true;
}

this.shipWillExitWitchspace = function()
{
    if(system.isInterstellarSpace && this.comingFromInterstellarSpace)
    {
        your code
    }
    delete this.comingFromInterstellarSpace;
}

Re: Thargoids and Interstellar Space...too common?

Posted: Sat Feb 12, 2011 11:48 pm
by Switeck
Commander McLane,
That would probably work for most cases, but I'm not sure it'd handle scripted misjumps from interstellar space (which I'd still want to work as originally designed)...which no doubt some OXP out there uses. :lol:

Maybe this would catch a (from OXP?) scripted misjump?:

Code: Select all

this.shipWillEnterWitchspace = function()
{
    if(system.isInterstellarSpace && player.ship.scriptedMisjump)
        this.comingFromInterstellarSpace = true;
}

this.shipWillExitWitchspace = function()
{
    if(system.isInterstellarSpace && this.comingFromInterstellarSpace)
    {
        // your code (probably to remove or not add additional ships)
    }
    delete this.comingFromInterstellarSpace;
}

Re: Thargoids and Interstellar Space...too common?

Posted: Sun Feb 13, 2011 9:04 am
by Thargoid
It will catch any repeat misjump, whether induced or random.

But the chances of a random one happening twice in a row are rather small I would say, and so can probably be neglected.

Re: Thargoids and Interstellar Space...too common?

Posted: Sun Feb 13, 2011 9:50 am
by Switeck
I'm pretty sure you won't ever have a random misjump hyperspacing out of interstellar space.
However OXP missions might trigger a misjump even from interstellar space and any that do are probably important enough to NOT abort them. (For all I know, this may be purely hypothetical...but it seems little extra effort to be prepared for an OXP that might want to do that.)

Re: Thargoids and Interstellar Space...too common?

Posted: Sun Feb 13, 2011 10:57 am
by JensAyton
Switeck wrote:
I'm pretty sure you won't ever have a random misjump hyperspacing out of interstellar space.
As far as I can see, the chance is the same as usual (one in 200).

However, your modification using player.ship.scriptedMisjump would almost work… or rather, would exactly not work. You want !player.ship.scriptedMisjump.

Re: Thargoids and Interstellar Space...too common?

Posted: Sun Feb 13, 2011 11:59 am
by Kaks
Like it or not, Commander McLane's version does work for both scripted & unscripted misjumps already! :)

And is shorter! :D

Re: Thargoids and Interstellar Space...too common?

Posted: Sun Feb 13, 2011 12:29 pm
by JensAyton
Kaks wrote:
Like it or not, Commander McLane's version does work for both scripted & unscripted misjumps already! :)
yes, but the request was for a version that doesn’t work for scripted misjumps.

Re: Thargoids and Interstellar Space...too common?

Posted: Sun Feb 13, 2011 12:33 pm
by Kaks
Meh, still need to wake up, clearly.

Hmm, where's that black burny liquid thing? I had it here somewhere... :mrgreen:

Re: Thargoids and Interstellar Space...too common?

Posted: Mon Feb 14, 2011 1:53 am
by Switeck
Ahruman wrote:
Switeck wrote:
I'm pretty sure you won't ever have a random misjump hyperspacing out of interstellar space.
As far as I can see, the chance is the same as usual (one in 200).

However, your modification using player.ship.scriptedMisjump would almost work… or rather, would exactly not work. You want !player.ship.scriptedMisjump.
Is the chance for random misjumps exposed to possible changes (via an OXP) as a .js file?

Seems the check for player.ship.scriptedMisjump = true should probably be a separate condition, since whether or not to spawn extra (OXP-added) Thargoids or even normally added (by plain Oolite) Thargoids may depend on the particular mission/OXP.
If it's a scripted misjump to join a spacebattle already-in-progress between Galactic Navy and Thargoids at a particularly obscure interstellar space location...triggering the remove-all-Thargoids script probably would be unwanted.
But another scripted misjump from interstellar space to another place in interstellar space may be for the placement of a "hidden base" that even the Thargoids are unaware of...
However if there was no scripted misjump (meaning player deliberate or random misjump) at all, probably avoid adding OXP ships and do the remove-all-Thargoids script.