This example line doesn't work for that reason:
var jumpDistance = Number(System.infoForSystem(galaxyNumber,system.ID).distanceToSystem(System.infoForSystem(galaxyNumber,player.ship.targetSystem)).toFixed(1));
Moderators: winston, another_commander
var jumpDistance = Number(System.infoForSystem(galaxyNumber,system.ID).distanceToSystem(System.infoForSystem(galaxyNumber,player.ship.targetSystem)).toFixed(1));
The galaxyNumber range is defined in OOTypes.h under kOOMaximumGalaxyID. So, if you changed kOOMaximumGalaxyID = 7 to kOOMaximumGalaxyID = 15 the range has now been extended to 16 galaxies (as galaxy 0 is galaxy 1, etc...). So when I run a script that will only launch in galaxy 9-16 (which would be 8-15 in the script) it launches successfully without any errors in the log.Switeck wrote:Does that also handle any problems associated with an out-of-range galaxyNumber value?
This example line doesn't work for that reason:
var jumpDistance = Number(System.infoForSystem(galaxyNumber,system.ID).distanceToSystem(System.infoForSystem(galaxyNumber,player.ship.targetSystem)).toFixed(1));
No, you can but it involves changing code in the PlayerEntity.m file. In the current code it will reset when going past Galaxy 8 back to galaxy 1, but this can be changed so that when it gets past Galaxy 16 it reverts back to Galaxy 1. Then, by setting a condition that when the player jumps into Galaxy 9 rather than rotating the seed bytes left again and going back to the Galaxy 1 seed, it generates a new defined seed for Galaxy 9. Then when jumping to Galaxies 10-16 it will rotate the galaxy seed bytes left to generate new galaxies. Then another conditional event that when the player gets back to Galaxy 1, it sets the galaxy seed back to the original Galaxy 1 seed so that you can cycle through Galaxies 2-8 again.Wildeblood wrote:Yes, but that doesn't help with creating alternative galaxies at all. You've got the same eight you always had, you're just cycling through them twice before the galaxyNumber resets to 0.
Why would anyone be offended for posting code on the forum? And - even more so - why do you think you'd be kicked off the forums for this? Feel free to post your results here, nobody is going to be offended or bite anyone.Pleb wrote:It is possible because I've done it, I just don't want to post the code to do it on the forums and risk offending anyone such as those who believe more than 8 galaxies would change the game significantly, and also the people who made the game as I love Oolite and would not want to be kicked off of the forums, lol! I merely experimented with the code to see if it was possible and it is so.
If you haven't already seen it, there's a spreadsheet linked from the [wiki]Oolite planet list[/wiki] page, which lets you specify a new seed and generates the map for you in the "Star chart" tab. Quicker than recompiling and jumping through 8 galaxies every time, anyway.Pleb wrote:It might take a long time to find the right seed for this, as I have just used a random seed and there issues with several of the new galaxies I have generated for my test...
Okay, thank you I just didn't want to have broken any rules! For anyone interested in testing this out, you will need the source code for Oolite and be able to compile it. I used the code for 1.76.1 for my test, but it would probably work with the TRUNK source code as well. Go to the file PlayerEntity.m in the \src\Core\Entities directory and go to line 5045. It should look like this:another_commander wrote:Why would anyone be offended for posting code on the forum? And - even more so - why do you think you'd be kicked off the forums for this? Feel free to post your results here, nobody is going to be offended or bite anyone.
Code: Select all
galaxy_number &= 7;
galaxy_seed.a = rotate_byte_left(galaxy_seed.a);
galaxy_seed.b = rotate_byte_left(galaxy_seed.b);
galaxy_seed.c = rotate_byte_left(galaxy_seed.c);
galaxy_seed.d = rotate_byte_left(galaxy_seed.d);
galaxy_seed.e = rotate_byte_left(galaxy_seed.e);
galaxy_seed.f = rotate_byte_left(galaxy_seed.f);
Code: Select all
// make sure galaxy number goes back to 0 (galaxy 1)
if (galaxy_number > 15)
{
galaxy_number = 0;
}
// when jumping to galaxy 9 generate new galaxy seed to generate 8 new galaxies
if (galaxy_number == 8)
{
galaxy_seed.a = 0x2a;
galaxy_seed.b = 0x2a;
galaxy_seed.c = 0x42;
galaxy_seed.d = 0x01;
galaxy_seed.e = 0x52;
galaxy_seed.f = 0xb2;
}
else
{
galaxy_seed.a = rotate_byte_left(galaxy_seed.a);
galaxy_seed.b = rotate_byte_left(galaxy_seed.b);
galaxy_seed.c = rotate_byte_left(galaxy_seed.c);
galaxy_seed.d = rotate_byte_left(galaxy_seed.d);
galaxy_seed.e = rotate_byte_left(galaxy_seed.e);
galaxy_seed.f = rotate_byte_left(galaxy_seed.f);
}
// when back at galaxy 1 reset galaxy seed to original seed
if (galaxy_number == 0)
{
galaxy_seed.a = 0x4a;
galaxy_seed.b = 0x5a;
galaxy_seed.c = 0x48;
galaxy_seed.d = 0x02;
galaxy_seed.e = 0x53;
galaxy_seed.f = 0xb7;
}
Code: Select all
kOOMaximumGalaxyID = 7,
Code: Select all
kOOMaximumGalaxyID = 15,
I didn't see this, could be handy to find a seed that would work, much quicker than compiling over and over again as you said! For anyone who wants to change the seed for Galaxy 9, this can be changed by changing the following code in the example above:cim wrote:If you haven't already seen it, there's a spreadsheet linked from the Oolite planet list page, which lets you specify a new seed and generates the map for you in the "Star chart" tab. Quicker than recompiling and jumping through 8 galaxies every time, anyway.
Code: Select all
// when jumping to galaxy 9 generate new galaxy seed to generate 8 new galaxies
if (galaxy_number == 8)
{
galaxy_seed.a = 0x2a;
galaxy_seed.b = 0x2a;
galaxy_seed.c = 0x42;
galaxy_seed.d = 0x01;
galaxy_seed.e = 0x52;
galaxy_seed.f = 0xb2;
}
I know what you mean, I like Galaxies like the current Galaxy 7 that have a group of systems separate from the main bulk, but these are not always accessible unless you modify the planetinfo.plist file.El Viejo wrote:Interesting... I rather like G13.
The only issue I had with Galaxy 11 was that the system that has a green circle around it appears to have no name! Not sure why, could be a bug with that particular seed, which is annoying because as you said it has a lot of possibilities...Smivs wrote:I like 11. That large area on the right with only two links is full of possibilities.
Not sure if that would be possible, as it would affect the names in all the galaxies. But the names it comes up with are pretty odd...and some of the descriptions I have found have been pretty humorous!El Viejo wrote:I wonder if a different planet name seed could be used in the extra charts as well - make them even more unusual?