Page 1 of 1

Basic Help needed

Posted: Sat Apr 20, 2013 5:47 am
by hangar18
Hi Guys,

I'm trying to get to grips with the basics of modding but need a simple way to get going. How can I change the starting credits from say 100 to 1,000 (changing <<Credits>> in a saved game file simply seems to invalidate that saved game as it no longer gets recognized in the load new commander screen)

Re: Basic Help needed

Posted: Sat Apr 20, 2013 7:22 am
by Smivs
hangar18 wrote:
Hi Guys,

I'm trying to get to grips with the basics of modding but need a simple way to get going. How can I change the starting credits from say 100 to 1,000 (changing <<Credits>> in a saved game file simply seems to invalidate that saved game as it no longer gets recognized in the load new commander screen)
Your save file won't work because the game has some basic anti-cheating mechanisms built in. :wink:
Are your two points linked, by the way. Do you feel you need more cash to help with the modding, as there are various easy ways around potential issues of this kind.

Re: Basic Help needed

Posted: Sat Apr 20, 2013 7:23 am
by aegidian
All this is IIRC, it's been a while since I looked at the code.

Changing the starting credits is not as simple as it should be1. The starting credits are initialised in code when the player entity is created, and the 1000 deci-credit value is hard-coded. However, I can speculate that it would be possible to change this with a script (I'm speculating because I cannot immediately say where to do this.)

1. This is a bit of a problem and something the current devs should consider addressing by using a starting player template 'saved game' that can be loaded at start up rather than being directly initialised by code.

Re: Basic Help needed

Posted: Sat Apr 20, 2013 8:19 am
by cim
Smivs wrote:
Your save file won't work because the game has some basic anti-cheating mechanisms built in.
It does, but the only thing they actually do at the moment (at least as far as credits changes go) is stick a message in the log file.

I've changed the credits on a savefile before, without problems. If editing the save file is making it disappear, then either the editor program is actually corrupting the file, or there's some of that Windows Vista/7/8 file permissions thing going on.

That said, hangar18, if you want to do OXP development, then you probably want to download the Testing release of Oolite, as this adds a number of extra debugging features which slow the game down a little, but are very useful when writing OXPs. One of those is the debug console: start the console, start the Testing release, and then type P.credits = 1000; in the console.
aegidian wrote:
This is a bit of a problem and something the current devs should consider addressing by using a starting player template 'saved game' that can be loaded at start up rather than being directly initialised by code.
Yes. Also needs a way for OXPs to add alternative start positions and allow the player to select one, in that case.

Re: Basic Help needed

Posted: Sat Apr 20, 2013 10:07 am
by Diziet Sma
G'day, hangar18 and welcome aboard! 8)
Smivs wrote:
Your save file won't work because the game has some basic anti-cheating mechanisms built in. :wink:
No.. it merely notes in the log that cheating may have taken place.. editing a game-save works just fine.


Like cim mentioned, I'm betting this is a text-editor problem.

Hangar18, I'm guessing you're using some variety of Windows, and Notepad to do the editing, yes?

If so, you should know that Notepad mangles Oolite files (by adding extra hidden characters) so that they don't work correctly, (or sometimes at all)

You could use Wordpad instead, which unlike Notepad, does play nice with Oolite files, but better still is the editor program Notepad++, which is free to download here. Especially since you want to try your hand at modding as well, Notepad++ would make a great start to your software collection.

Re: Basic Help needed

Posted: Sat Apr 20, 2013 10:22 am
by Disembodied
cim wrote:
aegidian wrote:
This is a bit of a problem and something the current devs should consider addressing by using a starting player template 'saved game' that can be loaded at start up rather than being directly initialised by code.
Yes. Also needs a way for OXPs to add alternative start positions and allow the player to select one, in that case.
Might this also be a way of allowing players to have, and be able to change, a name for their ship which appears in-game, and which other parts of the game can refer to? E.g. so the game knows that you're "Commander Whatshisface", flying the Cobra III the "Saucy Sally" or what have you ...

Re: Basic Help needed

Posted: Sat Apr 20, 2013 10:53 am
by hangar18
Many thanks guys...its notepad that's causing the issues. I basically want to design my own system, create new ships (via Wings3D) and add extra planets. Would love to do a solar system for instance. Am guessing the poly count on the planets would make this impossible? Whats the best way to get started - do I need to overwrite an existing system and do I need to go near the main source code to understand how things fit together?

Re: Basic Help needed

Posted: Sat Apr 20, 2013 11:01 am
by Disembodied
Adding extra planets can be done via OXPs - see for example System Redux: no need to go near the source code. Making those extra planets into a functioning solar system with working orbits would be a lot more work - but it's amazing what people have managed to get OXPs to do, so never say never!

Re: Basic Help needed

Posted: Sat Apr 20, 2013 12:32 pm
by Rorschachhamster
If you want to do a solar system, you should look out for the scale in the ooniverse wich has been discussed here and here.
Shortly, the distances and planetary diameters and ship dimensions (this one arguably) are all not realistic for gameplay reasons.

Oh, and welcome to the dark side. :D

Re: Basic Help needed

Posted: Sat Apr 20, 2013 3:03 pm
by cim
hangar18 wrote:
Many thanks guys...its notepad that's causing the issues. I basically want to design my own system, create new ships (via Wings3D) and add extra planets. Would love to do a solar system for instance. Am guessing the poly count on the planets would make this impossible? Whats the best way to get started - do I need to overwrite an existing system and do I need to go near the main source code to understand how things fit together?
Planets are a special case: they vary between low-poly and high-poly models depending on how close you are to them. So long as you spread them out a bit, you're unlikely to have a problem with poly count provided you have a reasonable graphics card. You're best using a cube map to texture them with, and a 512x3076 map is probably the best compromise between detail and memory use

You'd need to take over and adapt an existing system. This is done through the planetinfo.plist file in an OXP. For best compatibility, pick a system that other OXPs aren't already using: [wiki]List_of_Planets_used_in_OXPs[/wiki] is a partial list of those.

You shouldn't need to touch the core game source code, but looking at existing OXP sources is useful, and the [wiki]OXP_howto[/wiki] and [wiki]Oolite_JavaScript_object_model[/wiki] wiki pages make good starting points for getting in to the documentation. Pretty much every individual feature in OXP writing is documented on the wiki; fitting them all together into an OXP is less comprehensively documented.
Disembodied wrote:
Might this also be a way of allowing players to have, and be able to change, a name for their ship which appears in-game, and which other parts of the game can refer to? E.g. so the game knows that you're "Commander Whatshisface", flying the Cobra III the "Saucy Sally" or what have you ...
Probably unrelated. The main barrier to that is giving the player a way to type in the names (CCL Keyboard is ingenious, but very slow) - once that's done, adding the extra fields for ship name and pilot name separate to save filename is straightforward.

Re: Basic Help needed

Posted: Sat Apr 20, 2013 10:34 pm
by Svengali
cim wrote:
Probably unrelated. The main barrier to that is giving the player a way to type in the names (CCL Keyboard is ingenious, but very slow) - once that's done, adding the extra fields for ship name and pilot name separate to save filename is straightforward.
Yep. I've added the initialChoicesKey for v1.8. This may help a bit.

Re: Basic Help needed

Posted: Wed Apr 24, 2013 3:10 am
by hangar18
Thanks guys, the wiki is helpful but what would be really helpful is a very simple OXP step by step construction. E.g. simply having a message pop up saying 'welcome moon man' when docking. I'm struggling to get past first base at the minute but once I do am confident progress can be made (as I've been programming virtually all my life).