Page 1 of 2
How to thwart galactic hyperspace jump?
Posted: Mon Nov 14, 2011 9:03 am
by Wildeblood
Doing this does not work as I had hoped it would:
Code: Select all
this.playerStartedJumpCountdown = function(type)
{
if(type === "galactic" && player.ship.fuel < 7)
{
player.ship.removeEquipment("EQ_GAL_DRIVE");
player.consoleMessage("Hyperdrive must be fully fuelled for long-range jump.",3);
}
}
Going to the status screen shows the Gal-drive has been removed, but the countdown and jump continues successfully.
Re: How to thwart galactic hyperspace jump?
Posted: Mon Nov 14, 2011 9:13 am
by JazHaz
Not being a programmer, I'm not really sure, but at a guess once the countdown has started the program doesn't recheck that the galactic hyperdrive still exists. It probably only checks once when the player initiates the hyperspace.
How about adding to your code the call to cancel the countdown (whatever that is)?
Re: How to thwart galactic hyperspace jump?
Posted: Mon Nov 14, 2011 9:35 am
by Wildeblood
JazHaz wrote:Not being a programmer, I'm not really sure, but at a guess once the countdown has started the program doesn't recheck that the galactic hyperdrive still exists. It probably only checks once when the player initiates the hyperspace.
Exactly. It would be better if it re-checked when the countdown reached 1 second.
JazHaz wrote:How about adding to your code the call to cancel the countdown (whatever that is)?
There is no method to start the countdown from script, only the player can do that? So there's also no method to stop the countdown?
Re: How to thwart galactic hyperspace jump?
Posted: Mon Nov 14, 2011 9:35 am
by Smivs
I suspect jazhaz is right in that once the countdown has started, then you are commited to the jump, and removal of the equipment after this time is irrelevent.
Also, I have to ask 'why?' A galactic jump is not dependent on fuel - the gal-drive is a self-contained one-shot piece of equipment, and the amount of fuel a ship has on board is in no way connected to its ability to gal-jump.
Re: How to thwart galactic hyperspace jump?
Posted: Mon Nov 14, 2011 10:06 am
by Wildeblood
Smivs wrote:Also, I have to ask 'why?' A galactic jump is not dependent on fuel - the gal-drive is a self-contained one-shot piece of equipment, and the amount of fuel a ship has on board is in no way connected to its ability to gal-jump.
Because I don't like that. My Sensible GalDrive requires fuel. I am going to try whether a scripted misjump works...
Re: How to thwart galactic hyperspace jump?
Posted: Mon Nov 14, 2011 10:19 am
by Micha
Put in a feature request to influence jumping from script. Won't be added till after MNSR (1.76) though, and even then only if somebody gets the time, so no guarantees.
OTOH, continuously checking for GalDrive presence during the countdown would also allow it to be destroyed in a fight during the countdown, which could be interesting... which also indicates that the normal hyperdrive could be a damage-able piece of equipment perhaps.
Re: How to thwart galactic hyperspace jump?
Posted: Mon Nov 14, 2011 10:29 am
by Smivs
Wildeblood wrote:
Because I don't like that. My Sensible GalDrive requires fuel.
The Wiki wrote:A Galactic Hyperdrive doesn't use any fuel (all the fuel is contained in the device)
So you're designing a novel piece of equipment that does the same job as an existing bit of kit, but in a different way. No problem with that, but I don't think it should have any bearing on the way the existing equipment works, especially when that existing equipment is so deeply embedded in the core game.
Edit:- I just wanted to add that I don't want to seem negative about this - I actually like your 'sensible' equipment ideas, just not this one because I don't see it as sensible I suppose.
One other thought. Had you considered your proposal in terms of the native Nova Mission? Your change would make this mission impossible.
Re: How to thwart galactic hyperspace jump?
Posted: Mon Nov 14, 2011 10:55 am
by Wildeblood
Micha wrote:OTOH, continuously checking for GalDrive presence during the countdown would also allow it to be destroyed in a fight during the countdown, which could be interesting... which also indicates that the normal hyperdrive could be a damage-able piece of equipment perhaps.
Capt. Murphy already did a damageable Witchdrive.
Righto, attempt two, also does not work as I had hoped:-
Code: Select all
this.playerStartedJumpCountdown = function(type)
{
if(type === "galactic" && player.ship.fuel < 7)
{
player.ship.scriptedMisjump === true;
player.commsMessage("DANGER!",6);
player.commsMessage("Hyperdrive must be fully fuelled for long-range jump.",3);
player.commsMessage("You will be stranded in interstellar space!",3);
}
}
It appears the scriptedMisjump flag is reset by entering a new galaxy, as I didn't get a mis-jump on the subsequent in-galaxy jump, either.
Maybe I'll just destroy the player ship if it tries to jump without fuel.
Smivs wrote:I just wanted to add that I don't want to seem negative about this...
Smivs, you will be very negative when you see it, it's a love it or hate it thing, and I'm sure you'll hate it. That's okay, there's room in the ooniverses for everyone.
Re: How to thwart galactic hyperspace jump?
Posted: Mon Nov 14, 2011 11:23 am
by Ironfist
Wildeblood,
I think there might be an error in your script.
player.ship.scriptedMisjump === true; > is a comparison
I think you need
player.ship.scriptedMisjump = true; > to actually set the value to true
Of course I could be wrong, if so just ignore this!
Ironfist
Re: How to thwart galactic hyperspace jump?
Posted: Mon Nov 14, 2011 11:26 am
by Wildeblood
Ironfist wrote:Wildeblood,
I think there might be an error in your script.
player.ship.scriptedMisjump === true; > is a comparison
I think you need
player.ship.scriptedMisjump = true; > to actually set the value to true
Thank you, Ironfist, thank you. Unfortunately, fixing my dopey mistake made no difference: the scriptedMisjump flag has no effect after an intergalactic jump.
Re: How to thwart galactic hyperspace jump?
Posted: Mon Nov 14, 2011 4:48 pm
by Switeck
Currently there's no provisions in Oolite's code for a galactic hyperspace jump to be "different" if player.ship.scriptedMisjump === true;
Using an invisible ship/object to mass-lock the player's ship is pretty much the only way I know of to prevent a hyperspace jump. (trivia: But even a invisible ship won't prevent going through an already-existing wormhole.)
Re: How to thwart galactic hyperspace jump?
Posted: Mon Nov 14, 2011 5:31 pm
by Cmdr James
A misjump moves the player midway between the origination and target system. There is no meaningful equivalent for a galjump. And in the base game there would be no way to escape since the galdrive is a single use, there would be noway to escape.
Perhaps galactic misjumps could be implemented, but there is no way to somehow bodge it based on where we are now by reusing standard misjump behaviour.
It is also important to think about game dynmamics. Having a galdrive that requires fuel could break some missions, so you may need to rewrite core game missions as well. I dont think Im giving any spoilers away by saying there is a core mission that is only triggered when you have a galdrive, and this could be impacted by a rewrite.
Having an "abort galjump" JS method could probably be added, and I think is harmless on its own. But it is not a trivial decision.
Re: How to thwart galactic hyperspace jump?
Posted: Mon Nov 14, 2011 5:56 pm
by Thargoid
Personally speaking, as the galactic hyperdrive can be damaged, and if you try and initialise a galactic jump with a damaged drive it fails, for me I would define it as a bug that if it is damaged during a jump then the jump continues and at the end of the countdown is successful.
The basic rationale should apply to all equipment, for example would it make sense for automated (Blue Danube) docking to continue if the docking computer gets shot up and damaged? If that happens in-game the docking gets cancelled. So for me the damaging of a GalDrive should immediately cancel the galactic jump...
Re: How to thwart galactic hyperspace jump?
Posted: Mon Nov 14, 2011 8:33 pm
by Kaks
Thargoid wrote:Personally speaking, as the galactic hyperdrive can be damaged, and if you try and initialise a galactic jump with a damaged drive it fails, for me I would define it as a bug that if it is damaged during a jump then the jump continues and at the end of the countdown is successful.
Makes sense!
However: Wideblood, as mentioned twice already, your proposed 'sensible galDrive' would very much break a standard mission. Not very sensible, I don't think...
By the way, you might want to play through that particular mission to see exactly what happens and why your proposed oxp would break it!
Re: How to thwart galactic hyperspace jump?
Posted: Mon Nov 14, 2011 9:53 pm
by Micha
Personally I see the Gal Hyperdrive as being some sort of one-shot overdrive of the standard Hyperdrive, containing all the fuel/energy/gubbins needed for the Galactic Jump, burning itself out in the process. As such I also don't think it would make sense for the GHD to be available to ships which don't have a normal HD fitted (I think that was asked/raised in another thread).
Looks like we'll need to revise all core equipment though, and ensure that if it gets damaged that whatever it does stops working.