Page 1 of 1
Question about Farsun OXP
Posted: Thu Jul 07, 2011 6:54 pm
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();
}
Re: Question about Farsun OXP
Posted: Thu Jul 07, 2011 7:10 pm
by Okti
I would say if you are not happy with farsun, uninstall it
Edit: Or change the code in your own version of the OXP to a randomized probability to place the sun far.
Re: Question about Farsun OXP
Posted: Thu Jul 07, 2011 7:18 pm
by Wildeblood
Okti wrote:I would say if you are not happy with farsun, uninstall it
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?
Re: Question about Farsun OXP
Posted: Thu Jul 07, 2011 7:28 pm
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.
Re: Question about Farsun OXP
Posted: Thu Jul 07, 2011 7:56 pm
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;
}
Re: Question about Farsun OXP
Posted: Thu Jul 07, 2011 8:30 pm
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).
Re: Question about Farsun OXP
Posted: Fri Jul 08, 2011 4:43 am
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.
Re: Question about Farsun OXP
Posted: Fri Jul 08, 2011 7:39 am
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.
Re: Question about Farsun OXP
Posted: Fri Jul 08, 2011 7:58 am
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.
Re: Question about Farsun OXP
Posted: Fri Jul 08, 2011 3:56 pm
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.