Page 1 of 3

How does BEHAVIOUR_FIXED_COORDINATES works

Posted: Wed Apr 27, 2011 6:18 pm
by Okti
Hi,

I tried if it was possible to make a Gal Jump to Oresrati from G7 anywhere, I thought setting those will help but it did not.

Code: Select all

			player.ship.galacticHyperspaceBehaviour = "BEHAVIOUR_FIXED_COORDINATES";
			player.ship.galacticHyperspaceFixedCoords = new Vector3D(16,255,0);
That was one thing I was experimenting for fun, But I would like to find out limitations on BEHAVIOUR_FIXED_COORDINATES.

Re: How does BEHAVIOUR_FIXED_COORDINATES works

Posted: Wed Apr 27, 2011 6:23 pm
by Commander McLane
I think with BEHAVIOUR_FIXED_COORDINATES isolated systems are excluded, just like with BEHAVIOUR_STANDARD. Therefore you should end up in the closest system around Oresrati.

After all, the main objective is to not let the player get stranded.

EDIT: Hm. Seems I'm wrong, at least that's what this post is suggesting.

Note that you just need to specify a vector, not define a new vector.
player.ship.galacticHyperspaceFixedCoords = [16, 255, 0];
If you want the exhaustive explanation how everything works, look here.

Re: How does BEHAVIOUR_FIXED_COORDINATES works

Posted: Wed Apr 27, 2011 6:30 pm
by Okti
Commander McLane wrote:
I think with BEHAVIOUR_FIXED_COORDINATES isolated systems are excluded, just like with BEHAVIOUR_STANDARD. Therefore you should end up in the closest system around Oresrati.

After all, the main objective is to not let the player get stranded.
The only problem is Galactic hyperdrive does not work at all, I will try a reachable system and let you know. As I mentioned just trying to find if it works or not.

Re: How does BEHAVIOUR_FIXED_COORDINATES works

Posted: Wed Apr 27, 2011 6:33 pm
by Commander McLane
See the link in my second edit.

What do you mean, Galactic Hyperdrive doesn't work at all? It's working here. I just jumped from Gal 7 to Gal 8.

Re: How does BEHAVIOUR_FIXED_COORDINATES works

Posted: Wed Apr 27, 2011 6:44 pm
by Okti
I will try tomorrow, It is past my bed time already :)

Re: How does BEHAVIOUR_FIXED_COORDINATES works

Posted: Wed Jul 13, 2011 11:49 am
by Switeck
I tested both of these:
#1.
player.ship.galacticHyperspaceBehaviour = "BEHAVIOUR_FIXED_COORDINATES";
player.ship.galacticHyperspaceFixedCoords = ([ 96, 96, 0]);

#2.
player.ship.galacticHyperspaceBehaviour = "BEHAVIOUR_FIXED_COORDINATES";
player.ship.galacticHyperspaceFixedCoords = [ 96, 96, 0];

...and neither seems to work! The Galactic Hyperdrive spits me out at roughly the same x,y coords as I entered.

I was hoping to even use variables for x,y...but that failed also.

Re: How does BEHAVIOUR_FIXED_COORDINATES works

Posted: Wed Jul 13, 2011 12:34 pm
by Eric Walch
It seems there is a bug somewhere. I also tried:

Code: Select all

> player.ship.galacticHyperspaceFixedCoords
(96, 96, 0)
> player.ship.galacticHyperspaceFixedCoords = [ 196, 96, 0];
196,96,0
> player.ship.galacticHyperspaceFixedCoords
(196, 96, 0)
> PS.awardEquipment("EQ_GAL_DRIVE")
true
So first reading out the old coordinates, than setting new one and reading them out. The new coordinates are recognised, but on jumping I still stay at the old coordinates, like in your observation. I don't think you do anything wrong.

Re: How does BEHAVIOUR_FIXED_COORDINATES works

Posted: Wed Jul 13, 2011 12:40 pm
by another_commander
Switeck wrote:
I tested both of these:
#1.
player.ship.galacticHyperspaceBehaviour = "BEHAVIOUR_FIXED_COORDINATES";
player.ship.galacticHyperspaceFixedCoords = ([ 96, 96, 0]);

#2.
player.ship.galacticHyperspaceBehaviour = "BEHAVIOUR_FIXED_COORDINATES";
player.ship.galacticHyperspaceFixedCoords = [ 96, 96, 0];

...and neither seems to work! The Galactic Hyperdrive spits me out at roughly the same x,y coords as I entered.

I was hoping to even use variables for x,y...but that failed also.
Switeck: Works For Me(TM). Can you try to reproduce without OXPs?

Eric, you seem to have forgotten setting galactic hyperspace behaviour to fixed coords.

Re: How does BEHAVIOUR_FIXED_COORDINATES works

Posted: Wed Jul 13, 2011 1:32 pm
by Eric Walch
another_commander wrote:
Eric, you seem to have forgotten setting galactic hyperspace behaviour to fixed coords.
Yes I just realised that I hadn't set that. After setting the behaviour it worked as it should.

Re: How does BEHAVIOUR_FIXED_COORDINATES works

Posted: Wed Jul 13, 2011 10:03 pm
by Switeck
another_commander wrote:
Switeck: Works For Me(TM). Can you try to reproduce without OXPs?
Thanks for the advice!

I was using GalDrivePod v1.2.oxp to test multiple galactic jumps...and wouldn't you know it, this is in GalDrivePod_main_script.js:
player.ship.galacticHyperspaceBehaviour = "BEHAVIOUR_ALL_SYSTEMS_REACHABLE";

It mostly makes sense that it's there, because GalDrive Pods allow you to reach unreachable systems and then Gal. jump out later.
...However the all systems reachable is "fired" at this moment:
this.shipWillEnterWitchspace
...meaning there's no time window to change its behavior.

Ugh, there's just no easy way here! Putting that line inside instal_gh_script.js wouldn't help -- then you'd only get the desired results *AFTER* installing the first GalDrive Pod...not for your original Gal. Drive. It also needs to do a few checks to see if other OXPs haven't already changed the behavior to something other than the default behavior or similar conflicts to what I observed will occur. :(

Re: How does BEHAVIOUR_FIXED_COORDINATES works

Posted: Thu Jul 14, 2011 9:08 am
by Commander McLane
It's a problem of GalDrivePod.oxp and the way it handles galacticHyperspaceBehaviour. Actually it's two problems.

First, the script changes the behaviour indiscriminately, just when the equipment is installed. There should probably be additional checks to make sure that the player actually intends to reach a cut-off system.

Second, the behaviour isn't reset. Once you have installed the equipment, you're stuck with BEHAVIOUR_ALL_SYSTEMS_REACHABLE forever. It effectively makes this the default, even after you have got rid of the equipment again.

Both problems have to be fixed in the OXP.

Re: How does BEHAVIOUR_FIXED_COORDINATES works

Posted: Thu Jul 14, 2011 9:17 am
by Okti
As far as I know this has been changed in the latest version 1.2. This is the code that handles the galacticHyperspaceBehaviour.

Code: Select all

this.shipWillEnterWitchspace = function(cause)
{
  if (player.ship.equipmentStatus("EQ_GAL_DRIVE_MINE") == "EQUIPMENT_OK")
  {
       if(cause == "galactic jump")
       {
               player.ship.galacticHyperspaceBehaviour = "BEHAVIOUR_ALL_SYSTEMS_REACHABLE";
       }  
   }
}

Re: How does BEHAVIOUR_FIXED_COORDINATES works

Posted: Thu Jul 14, 2011 9:23 am
by Commander McLane
Okti wrote:
As far as I know this has been changed in the latest version 1.2. This is the code that handles the galacticHyperspaceBehaviour.

Code: Select all

this.shipWillEnterWitchspace = function(cause)
{
  if (player.ship.equipmentStatus("EQ_GAL_DRIVE_MINE") == "EQUIPMENT_OK")
  {
       if(cause == "galactic jump")
       {
               player.ship.galacticHyperspaceBehaviour = "BEHAVIOUR_ALL_SYSTEMS_REACHABLE";
       }  
   }
}
Exactly, and it shows both problems I mentioned: Once you start a galactic jump with the drive mine on a pylon, the behaviour is changed to BEHAVIOUR_ALL_SYSTEMS_REACHABLE permanently. There is not a single line of code that changes it back to whatever it was before the drive mine was bought and installed.

And that's a big bug.

Re: How does BEHAVIOUR_FIXED_COORDINATES works

Posted: Thu Jul 14, 2011 9:39 am
by Okti
Commander McLane wrote:
Exactly, and it shows both problems I mentioned: Once you start a galactic jump with the drive mine on a pylon, the behaviour is changed to BEHAVIOUR_ALL_SYSTEMS_REACHABLE permanently. There is not a single line of code that changes it back to whatever it was before the drive mine was bought and installed.

And that's a big bug.
The code must be as follows then;

Code: Select all

this.startUp = function()
{
	this.behaviourChanged = false;
}
this.shipWillEnterWitchspace = function(cause)
{
  if (player.ship.equipmentStatus("EQ_GAL_DRIVE_MINE") == "EQUIPMENT_OK")
  {
       if(cause == "galactic jump" && player.ship.galacticHyperspaceBehaviour == "BEHAVIOUR_STANDARD")
       {
               this.behaviourChanged = true;
			   player.ship.galacticHyperspaceBehaviour = "BEHAVIOUR_ALL_SYSTEMS_REACHABLE";
       }  
   }
}
this.shipExitedWitchspace = function()
{
	if(this.behaviourChanged)
	{
		player.ship.galacticHyperspaceBehaviour = "BEHAVIOUR_STANDARD";
                this.behaviourChanged = false;
	}
}

Re: How does BEHAVIOUR_FIXED_COORDINATES works

Posted: Thu Jul 14, 2011 9:44 am
by another_commander
Okti wrote:
The code must be as follows then;

Code: Select all

this.startUp = function()
{
	this.behaviourChanged = false;
}
this.shipWillEnterWitchspace = function(cause)
{
  if (player.ship.equipmentStatus("EQ_GAL_DRIVE_MINE") == "EQUIPMENT_OK")
  {
       if(cause == "galactic jump" && player.ship.galacticHyperspaceBehaviour == "BEHAVIOUR_STANDARD")
       {
               this.behaviourChanged = true;
			   player.ship.galacticHyperspaceBehaviour = "BEHAVIOUR_ALL_SYSTEMS_REACHABLE";
       }  
   }
}
this.shipExitedWitchspace = function()
{
	if(this.behaviourChanged)
	{
		player.ship.galacticHyperspaceBehaviour = "BEHAVIOUR_STANDARD";
                this.behaviourChanged = false;
	}
}
What if the behaviour at the time of the jump is not Standard? What if I had it set to Fixed Coordinates? It still needs some work before it's fully fixed.