Join us at the Oolite Anniversary Party -- London, 7th July 2024, 1pm
More details in this thread.

System Redux

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

Moderators: another_commander, winston

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: System Redux

Post by Okti »

Found another problem with the code,

Code: Select all

this.populate = function()
{
	if(this.systemDone || !system.sun || system.isInterstellarSpace) return;
	if(this.excl[galaxyNumber].indexOf(system.ID)==-1){
		var n = this.system_info[galaxyNumber * 256 + system.ID + 1 + galaxyNumber];
		this.addMoons(n);
		this.addPlanets(n);
		this.homePlanet(n);
	}
	this.systemDone = true;
}

Is checking for galaxyNumber * 256 + system.ID + 1 + galaxyNumber as index, but changeSystems function sets this.system_info[(i*256)+1+ar[j]] = 0;

After correcting that line it worked.

So the code must be

Code: Select all

this.changeSystems = function(ar)
{
	if(ar){
		for(var i=0;i<ar.length;i++){
			for(var j=0;j<ar[i].length;j++){
				this.system_info[(i*256)+1+i+ar[i][j]] = 0;
			}
		}
	} else this.system_info = this.org_system_info;
	return;
}
My OXP's
And Latest Mission Coyote's Run
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: System Redux

Post by Svengali »

Seems I haven't implemented the galaxy shift. Will fix and upload .-)
Muchas gracias Okti.

Done.
User avatar
CaptSolo
---- E L I T E ----
---- E L I T E ----
Posts: 909
Joined: Wed Feb 23, 2011 10:08 pm
Location: Preying Manta
Contact:

Re: System Redux

Post by CaptSolo »

I have a question regarding excluding systems using OXP Config: Am I able to choose different systems (planets), other than Diso, Lave, and Tianve? Also, is the max number of exclusions set at three? I need a little help at my age. :D

I like System Redux but there is not enough variety IMO. I had in mind to do a little texturing of my favourite worlds in Chart 1.
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: System Redux

Post by Svengali »

CaptSolo wrote:
I have a question regarding excluding systems using OXP Config: Am I able to choose different systems (planets), other than Diso, Lave, and Tianve? Also, is the max number of exclusions set at three? I need a little help at my age. :D
You'll have to change the SR script to get more. Let's say you want to get three more exclusions (G0 33, G0 55, G1, 99).
Change in oxpcSettings

Code: Select all

EInt0: {Name:"exSys",Def:0x0,Max:0xF,Desc:["Lave","Diso","Tianve","SolosSystems"]}
Add in oxpcNotifyOnChange

Code: Select all

if((this.exSys&8)){
	this.excl[0].push(33);
	this.excl[0].push(55);
	this.excl[1].push(99);
}
The script in SR uses a bitmask to enable/disable specific entries. This can be a single system or a collection of systems. OXPConfig grabs this integer (defined in .oxpcSettings EInt0) and acts as interface, so the user can change it in the game. The Max value just tells how many entries are available. See [wiki]OXPConfig_Doc[/wiki] for more infos.
User avatar
CaptSolo
---- E L I T E ----
---- E L I T E ----
Posts: 909
Joined: Wed Feb 23, 2011 10:08 pm
Location: Preying Manta
Contact:

Re: System Redux

Post by CaptSolo »

Thanks, Svengali. I will save the original script elsewhere, try your changes and post my results here.
User avatar
CaptSolo
---- E L I T E ----
---- E L I T E ----
Posts: 909
Joined: Wed Feb 23, 2011 10:08 pm
Location: Preying Manta
Contact:

Re: System Redux

Post by CaptSolo »

Svengali, it worked! Config stored successfully once I saved game. Many thanks!
Last edited by CaptSolo on Wed Apr 24, 2013 8:44 pm, edited 1 time in total.
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: System Redux

Post by Svengali »

Nice planet, Solo .-)
User avatar
CaptSolo
---- E L I T E ----
---- E L I T E ----
Posts: 909
Joined: Wed Feb 23, 2011 10:08 pm
Location: Preying Manta
Contact:

Re: System Redux

Post by CaptSolo »

Svengali, I have a question about the array values in:

Code: Select all

this.system_info
What are they and how does SR use them?

Thanks in advance.
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: System Redux

Post by Svengali »

CaptSolo wrote:
Svengali, I have a question about the array values in:

Code: Select all

this.system_info
What are they and how does SR use them?
This is the original code by Kaks and CaptKev. The values are bitmasks in hexadecimal notation for every system, ordered by ID. The script does some bitshifting to get the values for mainPlanet, moons and secondary planets.

E.g. for the mainPlanet it uses (((n & 0xFF000) >> 12) + 1)
or translated: take the value n (e.g. 0x21A5), apply bitwise AND 0xFF000 (to get rid of 0x1A5, resulting in 0x2000) and shift 12 bits to the right (resulting in 0x2), then add 1.
Result is 3 which gets used to build the texture name.
User avatar
CaptSolo
---- E L I T E ----
---- E L I T E ----
Posts: 909
Joined: Wed Feb 23, 2011 10:08 pm
Location: Preying Manta
Contact:

Re: System Redux

Post by CaptSolo »

I understand somewhat. I used to code small programs in assembly on my C64. That was a long time ago though.
User avatar
CaptSolo
---- E L I T E ----
---- E L I T E ----
Posts: 909
Joined: Wed Feb 23, 2011 10:08 pm
Location: Preying Manta
Contact:

Re: System Redux

Post by CaptSolo »

Svengali wrote:
take the value n (e.g. 0x21A5), apply bitwise AND 0xFF000 (to get rid of 0x1A5, resulting in 0x2000) and shift 12 bits to the right (resulting in 0x2), then add 1. Result is 3 which gets used to build the texture name.
Okay, I see how it works. In your example the 2 in 0x21A5 is the bit for texturing the home planet. I also understand that the range of values (0 to F) results in SR's 16 unique textures. But, if the right shift value was less than 12, the script could be modified to use more textures. What would the shift argument need to be to result in 0x20?
parazaine
Dangerous
Dangerous
Posts: 91
Joined: Sun Jul 05, 2009 1:28 am
Location: London

Re: System Redux

Post by parazaine »

I have done my own textures for System Redux and am interested in a 64 planet coded version that's compatible with Oolite 1.77.

So if Capt Kev, Kaks or anyone with some coding knowledge (i possess none) could provide the code to enable this, i could quickly flesh out a 64 random home-planet (and 32 moons and planets) version featuring Gas Giants, Terran-type worlds and cratered planets and moons.

I already tried this with some code Capt Kev posted some time ago....it no longer seems to work in Oolite 1.77 BUT i've done about 65% of the planetary textures necessary.

I'll post a link here to a small selection in a slide-show

http://s877.photobucket.com/user/paraza ... em%20Redux
'Either this wallpaper goes, or I do'

Oscar Wilde's last words
Duggan
---- E L I T E ----
---- E L I T E ----
Posts: 496
Joined: Sat Dec 31, 2011 2:58 pm

Re: System Redux

Post by Duggan »

I am happy with my current Povray skins but would like very much the extra Planets afforded by System redux.

Is this doable ? because once I put back in my system redux all my shiny Povray Planets go in favour of those in system redux :D
Flying Python Class Cruiser, Chapter & Verse IV
User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2676
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Re: System Redux

Post by spara »

Duggan wrote:
I am happy with my current Povray skins but would like very much the extra Planets afforded by System redux.

Is this doable ? because once I put back in my system redux all my shiny Povray Planets go in favour of those in system redux :D
From script.js of System Redux, change the line 118

Code: Select all

this.homePlanet(n);
to

Code: Select all

//this.homePlanet(n);
At least works for me :D

I have also commented out universal settings from planetinfo.plist in favour of ZygoUgos Cinematic Sky & nebulas.
Duggan
---- E L I T E ----
---- E L I T E ----
Posts: 496
Joined: Sat Dec 31, 2011 2:58 pm

Re: System Redux

Post by Duggan »

Thank you spara,

I took out information relating to home planet and it works fine :) next up...visit one of your extra planet stations . :)
Flying Python Class Cruiser, Chapter & Verse IV
Post Reply