Page 1 of 1

Different expansions for different saved games.

Posted: Sat Dec 27, 2014 11:36 pm
by ffutures
I suspect that this would be a total sod to implement, but I might as well mention it... Is there any way that each saved game could OPTIONALLY disable some of the installed add-ons?

One of the niggles I have with a lot of Oolite expansions is that they apply universally - once they're loaded, they'll be in the background for all the games I play. Which is fine if it's something like a bit of equipment, I can decide whether or not I want to use it, not so good for things like missions and add-ons that add extra threats. For example, I currently have Thargoid Wars and all of the add-on Thargoid ships installed - if I wanted to let my grand nephew (aged 7) play with a chance of surviving I'd have to remove all of them, and that's a pain. Or I might want to play with one of the special ships (e.g. Andromeda) but don't really want them turning up as NPC ships - they're bastards to fight and impossible to run away from.

I have no idea how this could be done, if it can at all, but I think it might occasionally be useful.

Re: Different expansions for different saved games.

Posted: Sun Dec 28, 2014 12:08 am
by cim
ffutures wrote:
For example, I currently have Thargoid Wars and all of the add-on Thargoid ships installed - if I wanted to let my grand nephew (aged 7) play with a chance of surviving I'd have to remove all of them, and that's a pain.
The OXP restrictions described at [wiki]Scenarios.plist[/wiki] are what you need for this, though it currently only works in nightly builds.

Create a savegame that's got

Code: Select all

<key>scenario_restriction</key>
<string>id:oxp.ffutures.custom-oxp-settings-1</string>
in it (or edit an existing save game to include it)

Then create an OXP folder which only contains a manifest.plist file, which has the id oxp.ffutures.custom-oxp-settings-1, has a requires_oxps section that includes exactly the ID of every OXP you want to include (this might be quite long, potentially).

Then, when you load the save game, the OXPs will be restricted to your custom OXP only ... and whichever OXPs you specified in its requires_oxps list (and anything in their requires_oxps list, so they'll continue to load)

Bonus feature: actually make the edited save game into a scenario as described in the Wiki, so you can start several copies of it from the "Start New Commander" screen.

You could alternatively do this without a custom OXP, by using a longer scenario_restriction in the save game like this

Code: Select all

<key>scenario_restriction</key>
<string>id:oxp.author1.oxp1;id:oxp.author1.oxp2;id:oxp.author2.oxp7;...</string>
but setting up the custom OXP has the advantage that you can update the OXP list without needing to edit the save game again.

In 1.80, the solution is probably to use the multiple user account feature of your operating system to give your grand nephew their own account, install Oolite on that account as well, and only install suitable OXPs.
ffutures wrote:
Or I might want to play with one of the special ships (e.g. Andromeda) but don't really want them turning up as NPC ships - they're bastards to fight and impossible to run away from.
This isn't something the core game can handle as the player ship and the NPC ships are usually [1] defined in the same OXP. The easiest solution if you want it as a player ship but not an NPC ship is to edit the shipdata.plist file in the OXP and comment out the NPC variants.

[1] I think this may in fact be "always". Splitting a ship OXP into three parts (common resources, NPC definitions, player ship definitions) is such a pain even with automatic dependency management that I don't recall anyone ever doing it.

Re: Different expansions for different saved games.

Posted: Sun Dec 28, 2014 1:26 am
by Norby
cim wrote:
Splitting a ship OXP into three parts (common resources, NPC definitions, player ship definitions) is such a pain
My problem is not the pain but my will. Yes, Andromeda is a strong ship but pirate versions are rare (below 1%) and you can outrun it in any ship with more than 250 max.speed so I think better if the official version keep up some stress.

Re: Different expansions for different saved games.

Posted: Sun Dec 28, 2014 2:50 pm
by ffutures
I'm thinking more in terms of something that can be done without manually editing files - e.g., something like a built-in saved game editor that gives you a list of the installed add-ons and allows you to disable any of them for that saved game (or for a new pilot) - something between the default "use all add-ons" and the "Strict Elite" settings.

Re: Different expansions for different saved games.

Posted: Sun Dec 28, 2014 9:56 pm
by Norby
In Windows everything is in one folder so just copy the whole Oolite folder to a new OoliteForKid folder and remove all unwanted oxp/oxz.
In Linux make another username, install Oolite into the home directory and get the wanted oxps only.

Re: Different expansions for different saved games.

Posted: Mon Dec 29, 2014 11:07 am
by Fatleaf
I just have two copies of Oolite installed. One is called Testing the other is just Oolite.

Re: Different expansions for different saved games.

Posted: Mon Dec 29, 2014 12:07 pm
by Smivs
I used to have several 'AddOns' folders for various Commanders, and just moved them in and out as I needed to change them - I'd just drag and drop them into and out of Oolite to/from a store in my Documents folder.
This is still do-able with Managed addOns as well, although it does make extra work if you use both OXZs and OXPs. Perhaps for convenience convert OXZs to OXPs and then you could just use inter-changeable AddOns folders, leaving the Managed AddOns folder un-used.

Re: Different expansions for different saved games.

Posted: Mon Dec 29, 2014 1:15 pm
by cim
Smivs wrote:
This is still do-able with Managed addOns as well, although it does make extra work if you use both OXZs and OXPs. Perhaps for convenience convert OXZs to OXPs and then you could just use inter-changeable AddOns folders, leaving the Managed AddOns folder un-used.
You can put OXZs in your AddOns folder.

Re: Different expansions for different saved games.

Posted: Mon Dec 29, 2014 2:48 pm
by Smivs
cim wrote:
Smivs wrote:
This is still do-able with Managed addOns as well, although it does make extra work if you use both OXZs and OXPs. Perhaps for convenience convert OXZs to OXPs and then you could just use inter-changeable AddOns folders, leaving the Managed AddOns folder un-used.
You can put OXZs in your AddOns folder.
...or do that :oops:

Re: Different expansions for different saved games.

Posted: Mon Dec 29, 2014 2:55 pm
by Cody
Fatleaf wrote:
I just have two copies of Oolite installed. One is called Testing the other is just Oolite.
This works! On my old machine, I had three different builds installed (one of which had a choice of .exe).

Re: Different expansions for different saved games.

Posted: Mon Dec 29, 2014 3:31 pm
by another_commander
My standard multi-version practice is: One game folder, with one AddOns folder, and three or more oolite.app folders below it (each with their own name of course).
Image
In the above shot, I have four versions of the game sharing the same OXPs (1.80, trunk 32 bit, trunk 64 bit and oo64 which is a free-to-experiment version - the others are the git repository copy plus some utility folders). 1.80 contains both the deployment and test release executables. Switching versions is really easy this way.

Now, if I want to have different OXP setups too, I can add other OXP container folders and call them AddOns1, AddOns2 etc. When I want to switch OXP set, I just rename the appropriate folder to AddOns and run the game.

Combining the multi version with the multi AddOns setup can make testing very quick and easy. Maybe it is too much for a casual player, but the possibility is there for whoever would like to try it.

Re: Different expansions for different saved games.

Posted: Mon Dec 29, 2014 5:26 pm
by ffutures
It's mostly the casual player I'm thinking of here - I'd guess they're mostly using the OXZ addons that are offered by the game, and installing them is a much less transparent process than OXPs.

Re: Different expansions for different saved games.

Posted: Tue Dec 30, 2014 3:17 pm
by PhantorGorth
Another method is the one I used use to switch between different testing set-ups and normal playing.

As a Linux user I can use symbolic links via the "ln -s <source_folder> <new_folder>" command to link a folder to somewhere else at the same time as its true location. You can use this for the Addons folder the Managed Addons folder and the save games folder. To use create sets of these folders under a different folders and then have a script check which one is links and "rotate" the links to the next set.

Here is the script I used for the Addons folder only:

Code: Select all

#!/bin/bash

# MIT License:
#
# Copyright (c) 2011 Paul R. Cooper
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in 
# the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the 
# Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS 
# OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

VAR=`ls -l ~/.Oolite/ | egrep '^l' | gawk '{ print $10 }' | head -n 1`
if [ $VAR = "/usr/lib/Oolite/AddOns" ]; then
	rm ~/.Oolite/AddOns
	ln -s ~/Dev/Oolite/AddOns ~/.Oolite/AddOns
fi

if [ $VAR = "$HOME/Dev/Oolite/AddOns" ]; then
	rm ~/.Oolite/AddOns
	ln -s ~/Dev/Testing/AddOns ~/.Oolite/AddOns
fi

if [ $VAR = "$HOME/Dev/Testing/AddOns" ]; then
	rm ~/.Oolite/AddOns
	ln -s /usr/lib/Oolite/AddOns ~/.Oolite/AddOns
fi

VAR=`ls -l ~/.Oolite/ | egrep '^l' | gawk '{ print $10 }' | head -n 1`
echo Oolite Addons folder now points at $VAR
This script would need to be modified to use your folders, add the other folders in the set if you want to do a swap for the Managed Addons folder and Save Games folders as well, and modify the script to make the cycle match the number of sets you have. (I have three in the above example)

It could also be extended to a launch a menu allowing you to choose the set to use rather than cycle through them, which would also allow you add a call to launch Oolite itself. (Which is not done in my script as I didn't automatically want to launch Oolite for the next folder in the cycle. Though that would be fine for just 2 sets in the cycle.)

As I am using Unix style symbolic links this would probably work on OSX too. Windows would need something that did links in the same way as Shortcuts won't work for this.

Phantor

Re: Different expansions for different saved games.

Posted: Mon Jan 05, 2015 3:05 am
by Diziet Sma
another_commander wrote:
Now, if I want to have different OXP setups too, I can add other OXP container folders and call them AddOns1, AddOns2 etc. When I want to switch OXP set, I just rename the appropriate folder to AddOns and run the game.
I have something similar on Linux.. with a short Bash script to switch between two AddOns folders.. I just type 'swapaddons' in a terminal, and they switch around. Something similar could probably be done with Windows. Details are here: https://bb.oolite.space/viewtopic.ph ... 75#p193275
PhantorGorth wrote:
As I am using Unix style symbolic links this would probably work on OSX too. Windows would need something that did links in the same way as Shortcuts won't work for this.
Windows has had symlinking capabilities ever since Vista. There's a discussion about using them with Oolite here: https://bb.oolite.space/viewtopic.php?f=8&t=15524