How does BEHAVIOUR_FIXED_COORDINATES works

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

Moderators: winston, another_commander

User avatar
Okti
---- E L I T E ----
---- E L I T E ----
Posts: 700
Joined: Sun Sep 26, 2010 1:51 pm
Location: A GH shop, near witchpoint to Oresrati in Galaxy 8

How does BEHAVIOUR_FIXED_COORDINATES works

Post 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.
My OXP's
And Latest Mission Coyote's Run
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: How does BEHAVIOUR_FIXED_COORDINATES works

Post 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.
Last edited by Commander McLane on Wed Apr 27, 2011 6:32 pm, edited 1 time in total.
User avatar
Okti
---- E L I T E ----
---- E L I T E ----
Posts: 700
Joined: Sun Sep 26, 2010 1:51 pm
Location: A GH shop, near witchpoint to Oresrati in Galaxy 8

Re: How does BEHAVIOUR_FIXED_COORDINATES works

Post 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.
My OXP's
And Latest Mission Coyote's Run
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: How does BEHAVIOUR_FIXED_COORDINATES works

Post 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.
User avatar
Okti
---- E L I T E ----
---- E L I T E ----
Posts: 700
Joined: Sun Sep 26, 2010 1:51 pm
Location: A GH shop, near witchpoint to Oresrati in Galaxy 8

Re: How does BEHAVIOUR_FIXED_COORDINATES works

Post by Okti »

I will try tomorrow, It is past my bed time already :)
My OXP's
And Latest Mission Coyote's Run
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2411
Joined: Mon May 31, 2010 11:11 pm

Re: How does BEHAVIOUR_FIXED_COORDINATES works

Post 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.
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: How does BEHAVIOUR_FIXED_COORDINATES works

Post 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.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Re: How does BEHAVIOUR_FIXED_COORDINATES works

Post 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.
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: How does BEHAVIOUR_FIXED_COORDINATES works

Post 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.
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2411
Joined: Mon May 31, 2010 11:11 pm

Re: How does BEHAVIOUR_FIXED_COORDINATES works

Post 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. :(
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: How does BEHAVIOUR_FIXED_COORDINATES works

Post 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.
User avatar
Okti
---- E L I T E ----
---- E L I T E ----
Posts: 700
Joined: Sun Sep 26, 2010 1:51 pm
Location: A GH shop, near witchpoint to Oresrati in Galaxy 8

Re: How does BEHAVIOUR_FIXED_COORDINATES works

Post 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";
       }  
   }
}
My OXP's
And Latest Mission Coyote's Run
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: How does BEHAVIOUR_FIXED_COORDINATES works

Post 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.
User avatar
Okti
---- E L I T E ----
---- E L I T E ----
Posts: 700
Joined: Sun Sep 26, 2010 1:51 pm
Location: A GH shop, near witchpoint to Oresrati in Galaxy 8

Re: How does BEHAVIOUR_FIXED_COORDINATES works

Post 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;
	}
}
My OXP's
And Latest Mission Coyote's Run
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Re: How does BEHAVIOUR_FIXED_COORDINATES works

Post 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.
Post Reply