mission control

An area for discussing new ideas and additions to Oolite.

Moderators: winston, another_commander

User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16081
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: mission control

Post by Cody »

spara wrote:
Does it just keep on running, possibly spawning new things?
In interstellar space? I might have the wrong end of the stick, but it does carry on spawning 'things'.
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: mission control

Post by cim »

spara wrote:
Ok. Old skool methods then. How about repopulator in witchspace? I assume that it can't be overridden either. Does it just keep on running, possibly spawning new things?
Again, if you know the location in advance, you can override it in planetinfo. If not, you do have the option of overriding general interstellar space in planetinfo, and then manually calling the default function for anywhere you don't want to override - of course, that's incompatible with any other OXP wanting to do the same.

I'll keep thinking about providing JS overrides of interstellar space in time for 1.82. It should be possible.
User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2691
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Re: mission control

Post by spara »

cim wrote:
spara wrote:
Ok. Old skool methods then. How about repopulator in witchspace? I assume that it can't be overridden either. Does it just keep on running, possibly spawning new things?
Again, if you know the location in advance, you can override it in planetinfo. If not, you do have the option of overriding general interstellar space in planetinfo, and then manually calling the default function for anywhere you don't want to override - of course, that's incompatible with any other OXP wanting to do the same.

I'll keep thinking about providing JS overrides of interstellar space in time for 1.82. It should be possible.
Thank you for patiently answering my questions :) . I seem to have misunderstood you earlier as I though you meant overriding the populator in runtime. I get it now :D . However, it seems a bit harsh to take over the populator in planetinfo, so JS override would be nice. At least with scriptedMisjump. If taking over the populator would be tied to scriptedMisjump, it could act as a flag for OXPs that something big is going to happen in witchspace and maybe act accordingly.
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: mission control

Post by cim »

spara wrote:
If taking over the populator would be tied to scriptedMisjump, it could act as a flag for OXPs that something big is going to happen in witchspace and maybe act accordingly.
Changing the populator is an automatic flag to OXPs - they all get out of the way, unless they've specifically arranged to also have something for your new populator function name. And if I can get it scriptable, you can do it in shipWillEnterWitchspace just fine. (There's some race condition potential with scriptedMisjump in that function, as multiple OXPs can turn it on and off independently of each other in arbitrary sequence ... but if you're running stuff through the populator functions if you end up in the wrong place it should be possible to failsafe)
User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2691
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Re: mission control

Post by spara »

Testing rerouting interstellarspace populator functions and repopulator does not seem to get overridden. Maybe I'm just tired, but I don't see any error here.

planetinfo.plist:

Code: Select all

{
"interstellar space" = {
		"populator" = "xsInterstellarSpaceWillPopulate";
		"repopulator" = "xsInterstellarSpaceWillRepopulate";
	};
}
and an odd worldscript has these:

Code: Select all

this.xsInterstellarSpaceWillPopulate = function() {
	log("test", "populator");
}

this.xsInterstellarSpaceWillRepopulate = function() {
	log("test", "repopulator");
}
When misjumping, this.xsInterstellarSpaceWillPopulate fires, but this.xsInterstellarSpaceWillPopulate does not and instead thargoids start spawning.
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: mission control

Post by cim »

That looks like it should work. When there, what's the values of

Code: Select all

system.info.populator
system.info.repopulator
in the debug console?
User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2691
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Re: mission control

Post by spara »

cim wrote:
That looks like it should work. When there, what's the values of

Code: Select all

system.info.populator
system.info.repopulator
in the debug console?
These don't give anything. Not in normal space or in interstellar space. Are these properties readable from system.info object as for example system.info.description works just fine?
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: mission control

Post by cim »

"Nothing" would imply "unset, use hard-coded default", in this case.

All planetinfo properties should be accessible through system.info.<property> (and with a few necessary exceptions, writable in regular space)
User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2691
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Re: mission control

Post by spara »

It looks like there is something wrong somewhere. I tested with this in planetinfo.plist:

Code: Select all

{
	"interstellar space" = {
		"populator" = "xsInterstellarSpaceWillPopulate";
		"repopulator" = "xsInterstellarSpaceWillRepopulate";
	};
	"0 7" = {
		"populator" = "xsInterstellarSpaceWillPopulate";
		"repopulator" = "xsInterstellarSpaceWillRepopulate";
	};
}
Lave gives this:

Code: Select all

> system.info.populator
xsInterstellarSpaceWillPopulate
> system.info.repopulator
xsInterstellarSpaceWillRepopulate
Interstellar space gives this:

Code: Select all

> system.info.repopulator
> system.info.populator
However interstellar space remained empty and my logging functions show that the custom populators are used.

The weird thing is that when I strip planetinfo.plist to this

Code: Select all

{
	"interstellar space" = {
		"populator" = "xsInterstellarSpaceWillPopulate";
		"repopulator" = "xsInterstellarSpaceWillRepopulate";
	};
}
After jumping to interstellar space logging functions stay dead and thargoids make sure that I'm shortly too.
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: mission control

Post by cim »

Okay - I'll set aside some time this weekend to look at this. I've also got an idea now for how to allow interstellar setting via JS.
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: mission control

Post by cim »

spara wrote:
The weird thing is that when I strip planetinfo.plist to this

Code: Select all

{
	"interstellar space" = {
		"populator" = "xsInterstellarSpaceWillPopulate";
		"repopulator" = "xsInterstellarSpaceWillRepopulate";
	};
}
After jumping to interstellar space logging functions stay dead and thargoids make sure that I'm shortly too.
There was a bug where if a property was only used in interstellar space, it would not be processed. That's fixed now, though there's more to do.
User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2691
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Re: mission control

Post by spara »

Thanks cim, you're amazingly fast in delivering requested changes :D . The new setInterstellarProperty appears to be working nicely and offers a lot of flexibility for OXPs wanting to "own" the interstellar space for a while.

For those interested, claiming the populator and repopulator for interstellar space before going in is now this easy:

Code: Select all

SystemInfo.setInterstellarProperty(0, 7, 55, 2, "populator", "customInterstellarSpaceWillPopulate");
SystemInfo.setInterstellarProperty(0, 7, 55, 2, "repopulator", "customInterstellarSpaceWillRepopulate");
And of course you need to have customInterstellarSpaceWillPopulate and customInterstellarSpaceWillRepopulate somewhere and make them actually do something.

When finished, jump out and revert the populator/repopulator back to basics:

Code: Select all

SystemInfo.setInterstellarProperty(0, 7, 55, 2, "populator", null);
SystemInfo.setInterstellarProperty(0, 7, 55, 2, "repopulator", null);
A couple of minor notes. There's some debug message left in that should be removed at some point

Code: Select all

16:57:20.580 [i.debug]: interstellar: 0 7 55
and the order of parameters in wiki did not match the order in game (according to the game layer should come after tosystem). I fixed wiki to match game.

The next obvious question is: How to query interstellar properties? Especially populator. :mrgreen:
Post Reply