Basic Help needed

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

Moderators: another_commander, winston

Post Reply
hangar18
Competent
Competent
Posts: 45
Joined: Sun Sep 04, 2011 9:10 am

Basic Help needed

Post 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)
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: Basic Help needed

Post 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.
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
aegidian
Master and Commander
Master and Commander
Posts: 1160
Joined: Thu May 20, 2004 10:46 pm
Location: London UK
Contact:

Re: Basic Help needed

Post 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.
"The planet Rear is scourged by well-intentioned OXZs."

Oolite models and gear? click here!
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: Basic Help needed

Post 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.
User avatar
Diziet Sma
---- E L I T E ----
---- E L I T E ----
Posts: 6311
Joined: Mon Apr 06, 2009 12:20 pm
Location: Aboard the Pitviper S.E. "Blackwidow"

Re: Basic Help needed

Post 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.
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
User avatar
Disembodied
Jedi Spam Assassin
Jedi Spam Assassin
Posts: 6881
Joined: Thu Jul 12, 2007 10:54 pm
Location: Carter's Snort

Re: Basic Help needed

Post 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 ...
hangar18
Competent
Competent
Posts: 45
Joined: Sun Sep 04, 2011 9:10 am

Re: Basic Help needed

Post 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?
User avatar
Disembodied
Jedi Spam Assassin
Jedi Spam Assassin
Posts: 6881
Joined: Thu Jul 12, 2007 10:54 pm
Location: Carter's Snort

Re: Basic Help needed

Post 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!
User avatar
Rorschachhamster
---- E L I T E ----
---- E L I T E ----
Posts: 274
Joined: Sun Aug 05, 2012 11:46 pm
Contact:

Re: Basic Help needed

Post 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
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: Basic Help needed

Post 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.
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: Basic Help needed

Post 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.
hangar18
Competent
Competent
Posts: 45
Joined: Sun Sep 04, 2011 9:10 am

Re: Basic Help needed

Post 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).
Post Reply