Page 1 of 2

Patch: save company info

Posted: 12 Nov 2008 02:02
by Antdovu
This patch lets you save and load company info (president/company name, face, company colours).
For those who didn't know: you can set different colours for a lot of stuff. You can make all your planes one colour and trains another colour etc.

version 2: data now saved into openttd.cfg
version 3: updated to trunk (revision 16200)

Re: Patch: save company info

Posted: 12 Nov 2008 11:49
by PhilSophus
Antdovu wrote:This patch lets you save and load company info (president/company name, face, company colours).
Very useful indeed. I will certainly use it. More often than not I reuse these settings (most times I use a new company name, but still this patch saves a lot of work).
Antdovu wrote: * Give up using STL if that is a problem.
What do you use of the STL? For some STL containers like vector there are replacements in the OpenTTD source code. In a few places set and map are already used, so in general it doesn't seem to be a problem.
Antdovu wrote: * Adopt a file format similar to current saved games.
IMHO, the company info should just go into the normal config file. If you want to have the possibility for multiple company infos I suggest you do it in a similar way as the NewGRF presets (for every NewGRF preset a separate config section called [preset-preset_name] is used).

I didn't look at the code, yet, but will do at a later time. This is certainly a feature I would love to see in trunk.

Keep up your great work! :D

Re: Patch: save company info

Posted: 13 Nov 2008 21:09
by Terkhen
This is a feature I was missing. I'm going to try it!

Re: Patch: save company info

Posted: 15 Nov 2008 20:50
by supermatt
Excellent patch! I agree with PhilSophus that the save should go into the config file in the same way you save your favorite face.

Re: Patch: save company info

Posted: 17 Nov 2008 01:40
by Antdovu
Updated the patch to save all data to openttd.cfg

Re: Patch: save company info

Posted: 16 Feb 2009 13:14
by 2007Alain2007
can you update this please to R15496 i think there is some probles with the new AI and this patch

Re: Patch: save company info

Posted: 16 Feb 2009 13:21
by CommanderZ
Looks good, I always use the same colour scheme and manager face. The company name is different in each game because of savegames.

EDIT: Eh, it is year old :oops:

Re: Patch: save company info

Posted: 16 Feb 2009 13:41
by Conditional Zenith
2007Alain2007 wrote:can you update this please to R15496 i think there is some probles with the new AI and this patch
Being specific would help.

Re: Patch: save company info

Posted: 16 Feb 2009 14:07
by 2007Alain2007
on theres files if i send you a picture for now will you be able to work it out from there

Re: Patch: save company info

Posted: 16 Feb 2009 14:11
by Eddi
seriously, that is a type of error that you have to learn to deal with by yourself.

from the looks of it, you could get away with just using both code blocks behind each other

Re: Patch: save company info

Posted: 16 Feb 2009 14:15
by 2007Alain2007
like moveing the lines about or dose this miss up patchs

Re: Patch: save company info

Posted: 16 Feb 2009 14:34
by Eddi
step 1: find out where these values are used
step 2: find out what the code actually does, and what these values represent
step 3: find out what might break if you add something
step 4: do your modification and test it

Re: Patch: save company info

Posted: 17 Feb 2009 01:41
by Conditional Zenith
2007Alain2007 wrote:like moveing the lines about or dose this miss up patchs
This is why you need to understand C++ before you can make a patchpack.

Re: Patch: save company info

Posted: 17 Feb 2009 01:45
by 2007Alain2007
lol i am still waiting for my book to be in the libury so i can read up on it and my manger at work says hes got some text books that might help me

Re: Patch: save company info

Posted: 17 Feb 2009 09:18
by dihedral
there are books online! and this is more basic programming stuff than specific to c/c++

Re: Patch: save company info

Posted: 02 May 2009 18:54
by Antdovu
Updated to trunk for now (revision 16200)

Re: Patch: save company info

Posted: 04 May 2009 00:37
by ever
The correct solution would be to get player profiles in before the game begins. Now a Patch that could do that, that'd be genius.

Re: Patch: save company info

Posted: 04 May 2009 08:00
by dihedral
could also avoid the amount of people named 'Player' too :-P

Re: Patch: save company info

Posted: 04 May 2009 14:18
by Timmaexx
I think you really hate 'Player'!
First your Change_Player_Name Script and then you Player's_will_be_kicked Script! :mrgreen:

Re: Patch: save company info

Posted: 04 May 2009 14:47
by Bilbo
Well, if you have 3 people, all of them named "Player", it is hard to tell who is who....

Maybe some feature in core OpenTTD that will remind players to change their name if it is "Player" before they connect to any multiplayer server would help to reduce such cases.

When I made new installation of openttd on new computer, I forgot to change my name too (but you can change it on server with a console command :), so such reminder could be useful ....