Changing current system via script?

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

Moderators: winston, another_commander

Post Reply
User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

Changing current system via script?

Post by Capt. Murphy »

Hi,

Can any of the scripting guru's or developers advise if it's possible to change the current system via script - i.e. by changing the planet_number or similar.

Warning - I'm very much a newbie to scripting.

I'm trying to make a small OXP that when loaded will make a new 'Jameson' spawn in a different system (and possibly not in the main station) and with a different ship,equipment,credits (and backstory but that's something else). I can do the 2nd bit, but am stuck on the first.

Eventual aim would be to have a set of OXP's for various new Jameson scenarios for peeps to choose from (e.g. rogue cop - starts as a fugitive in a stolen viper , trader - inherits the family python from dad, escaped slave - starts in a rockhermit in a stolen sidewinder etc etc....)

I've tried this little code snippet as a script.plist which doesn't work (I didn't expect it to work to be honest cos I don't think set: planet_number is valid).........

Code: Select all

{
alt_start_up = (
	{
	conditions = (
	"gui_screen_string equal GUI_SCREEN_INTRO2"
	);
	do = ( 
	"set: planet_number 8"
	);
	}
	)
}
[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
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6671
Joined: Wed Feb 28, 2007 7:54 am

Re: Changing current system via script?

Post by another_commander »

I don't think you need a script, all of what you are asking can be done by using edited savefiles, except spawining the player on non-main stations.
User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

Re: Changing current system via script?

Post by Capt. Murphy »

Thanks another_commander,

I can work with the edited game method, just thought a scripted method if possible would be a little more elegant.

Edit to add:

Have the developers ever considered making the settings for the starting commander as a .plist to allow easy modification?
[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
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: Changing current system via script?

Post by JensAyton »

Capt. Murphy wrote:
Have the developers ever considered making the settings for the starting commander as a .plist to allow easy modification?
They are. It’s called a saved game. :-)
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: Changing current system via script?

Post by Commander McLane »

Ahruman wrote:
Capt. Murphy wrote:
Have the developers ever considered making the settings for the starting commander as a .plist to allow easy modification?
They are. It’s called a saved game. :-)
However, as we are throwing around ideas for Oolite 2 anyway, allowing a new game to start from other systems than Lave would be a suggestion as well. It could even be randomized.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: Changing current system via script?

Post by JensAyton »

Commander McLane wrote:
However, as we are throwing around ideas for Oolite 2 anyway, allowing a new game to start from other systems than Lave would be a suggestion as well. It could even be randomized.
I was thinking more along the lines of explicit support for saved game templates, but allowing them to be bundled with a script that could set up starting parameters (including system) would be an idea. Very low priority, though.
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: Changing current system via script?

Post by Commander McLane »

Ahruman wrote:
Commander McLane wrote:
However, as we are throwing around ideas for Oolite 2 anyway, allowing a new game to start from other systems than Lave would be a suggestion as well. It could even be randomized.
I was thinking more along the lines of explicit support for saved game templates,
That would be a good idea, too.

Some OXPs have come with save games in the past, for instance Tianve.oxp. But of course that would also give you the ship with which the save game was created, and everything else as well.

Having some sort of save-game-overrides (analogous to the other overrides files) which would allow an OXP to ship only certain aspects of a saved game, while leaving the other parts of the player's current save-game intact, would be very nice.
Post Reply