Question about Farsun OXP

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

Moderators: winston, another_commander

Post Reply
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2446
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:

Question about Farsun OXP

Post by Wildeblood »

I've just been editing my planetinfo.plist file give a system that is scourged by dreadful solar flares more nebulae, and then I went to the wiki to look up how the corona parameters work and it occurred to me "Why bother, the sun is usually small because of Farsun, it's only big and obvious tonight because I've taken all my OXPs out while I do this?" And then I thought, "I want the sun to stay big and obvious in this system after I put Farsun back."

So I looked into Farsun for a list of excepted systems I could add one more to, but it contains no such list. The only exception it makes is for the Nova mission. What should I do? I don't want all systems to have giant suns, I don't want all systems to have far suns, I want variety.

Code: Select all

this.name	= "farsun";
this.author = "Kaks";
this.copyright = "Creative Commons: attribution, non-commercial, sharealike.";
this.description	= "micro OXP to increase the distance between suns & planets";
this.version = "1.05";

this.multiple=3;

this.moveSun = function(){
	var s=system.sun;
	if(!system.isInterstellarSpace && !s.hasGoneNova){
		var p=system.mainPlanet;
		// Only move the sun if we do have a main planet!
		if(p) s.position=s.position.add(s.position.subtract(p.position)).multiply(this.multiple);
	}
	this.systemDone=true;
}

this.startUp = this.reset = function(){
	this.systemDone=false;
}

this.shipWillLaunchFromStation = function(){
	if(!this.systemDone) this.moveSun();
}

this.shipWillExitWitchspace = function(){
	// Keep the sun close by for the oolite-nova mission.
	if(galaxyNumber == 3 && !missionVariables.nova && player.hasEquipment("EQ_GAL_DRIVE") && missionVariables.novacount && missionVariables.novacount > 2) return;
	this.moveSun();
}
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: Question about Farsun OXP

Post by Okti »

I would say if you are not happy with farsun, uninstall it :D

Edit: Or change the code in your own version of the OXP to a randomized probability to place the sun far.
My OXP's
And Latest Mission Coyote's Run
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2446
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:

Re: Question about Farsun OXP

Post by Wildeblood »

Okti wrote:
I would say if you are not happy with farsun, uninstall it :D
Where did I say, or imply, I was unhappy with it? I consider it absolutely necessary, a "must have" OXP. I am asking the best way to over-ride it for specific, exceptional systems that are plagued by solar flares.

Addendum: Changing it so it took that 3 and used it as the centre of a range 2.5-3.5 might be an improvement. (I don't know how much variability the game ordinarily has anyway.) But that is not what I am asking about.

How do other OXPs that interact with Farsun, e.g. Illegal Goods Tweak, deal with it, if at all?
Last edited by Wildeblood on Thu Jul 07, 2011 7:29 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: Question about Farsun OXP

Post by Okti »

Wildeblood wrote:
I am asking the best way to over-ride it for specific, exceptional systems that are plagued by solar flares.
It is obvious in the exception for the nova system. So you can add more systems by JS, that you don't want to be changed by Far sun.

Edit: Sorry, I have seen the edit later than I posted, well at the moment there is not a standard way for the OXP's to avoid OXP clashes. Using a timer may be an idea.
My OXP's
And Latest Mission Coyote's Run
User avatar
Cmd. Cheyd
---- E L I T E ----
---- E L I T E ----
Posts: 934
Joined: Tue Dec 16, 2008 2:52 pm
Location: Deep Horizon Industries Manufacturing & Research Site somewhere in G8...

Re: Question about Farsun OXP

Post by Cmd. Cheyd »

Haven't tested this, wrote it in 2 minutes while at work while futzing with an SSH server that is giving me trouble, but it should work. If not, someone here can tell you where I messed up.

Code: Select all

this.multiple=3;
this.excludedSystems = [[],[],[],[],[],[],[],[]];
this.excludedSystems[0] =[Insert G1 systems to be excluded here - i.e 1,5,24,29];
this.excludedSystems[1] =[Insert G2 systems to be excluded here];
this.excludedSystems[2] =[Insert G3 systems to be excluded here];
this.excludedSystems[3] =[Insert G4 systems to be excluded here];
this.excludedSystems[4] =[Insert G5 systems to be excluded here];
this.excludedSystems[5] =[Insert G6 systems to be excluded here];
this.excludedSystems[6] =[Insert G7 systems to be excluded here];
this.excludedSystems[7] =[Insert G8 systems to be excluded here];

this.moveSun = function(){
   var s=system.sun;
   if(!system.isInterstellarSpace && !s.hasGoneNova && !this.excludedSystems(galaxyNumber).indexOf(system.ID) ==-1{
      var p=system.mainPlanet;
      // Only move the sun if we do have a main planet!
      if(p) s.position=s.position.add(s.position.subtract(p.position)).multiply(this.multiple);
   }
   this.systemDone=true;
}
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: Question about Farsun OXP

Post by Commander McLane »

Wildeblood wrote:
How do other OXPs that interact with Farsun, e.g. Illegal Goods Tweak, deal with it, if at all?
I am not aware of other OXPs interacting with Farsun in any way. It is clear, however, that Farsun can and will break OXPs which expect the sun to be positioned in its default position. It's simply one of the few OXPs which potentially can seriously clash with the rest of the bunch. Use at your own risk (which of course applies to all OXPs, just that the risk is a little bigger in the case of Farsun).
User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

Re: Question about Farsun OXP

Post by Capt. Murphy »

Wildeblood wrote:
Okti wrote:
How do other OXPs that interact with Farsun, e.g. Illegal Goods Tweak, deal with it, if at all?
As far as Illegal Goods Tweak goes the handlers that spawn the entity close by the sun in one of the special missions fire after the handlers that move the sun in Farsun. And it uses the legacy co-ord system. So admittedly more by accident than design it should work fine.
[EliteWiki] Capt. Murphy's OXPs
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
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: Question about Farsun OXP

Post by Eric Walch »

Capt. Murphy wrote:
And it uses the legacy co-ord system. So admittedly more by accident than design it should work fine.
Not by accident, but by intention. There are two handlers: shipWillExitWitchspace and shipExitedWitchspace. Populating a system should be done during the second one. FarSun intentionally uses the first one, so the position is already changed before any of the populating starts.
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: Question about Farsun OXP

Post by Commander McLane »

Eric Walch wrote:
Populating a system should be done during the second one.
Not as a general rule, because there is another, conflicting rule: Objects that are supposed to already be in the system when the player arrives should be spawned on shipWillExitWitchspace, and objects that "jump in" together with the player should be spawned on shipExitedWitchspace. This is more an issue for objects close to the witchpoint, though (you don't want to see hyperspace exit rings on a constore, or an an assassin that has supposedly been there waiting for you), and not so much for objects orbiting the sun.

Although I have to admit that I prefer shipWillExitWitchspace also for spawning large groups of objects, which would produce a considerable lag if spawned when the player is already spawned as well.
User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

Re: Question about Farsun OXP

Post by Capt. Murphy »

Eric Walch wrote:
Capt. Murphy wrote:
And it uses the legacy co-ord system. So admittedly more by accident than design it should work fine.
Not by accident, but by intention.
I was referring to by accident not design on my part - not the devs. :)
[EliteWiki] Capt. Murphy's OXPs
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
Post Reply