Patch: save company info

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Antdovu
Engineer
Engineer
Posts: 19
Joined: 28 May 2008 19:54

Patch: save company info

Post by Antdovu » 12 Nov 2008 02:02

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)
Attachments
Suwood Transport, 4th May 1950.png
Suwood Transport, 4th May 1950.png (24.02 KiB) Viewed 7993 times
company_info_v3.patch
(20.78 KiB) Downloaded 222 times
Last edited by Antdovu on 02 May 2009 18:53, edited 2 times in total.

PhilSophus
Chairman
Chairman
Posts: 776
Joined: 20 Jan 2007 12:08
Location: Germany

Re: Patch: save company info

Post by PhilSophus » 12 Nov 2008 11:49

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
"The bigger the island of our knowledge, the longer the shore of our ignorance" - John A. Wheeler, Physicist, 1911-2008

Terkhen
OpenTTD Developer
OpenTTD Developer
Posts: 1034
Joined: 11 Sep 2008 07:32
Location: Spain

Re: Patch: save company info

Post by Terkhen » 13 Nov 2008 21:09

This is a feature I was missing. I'm going to try it!

supermatt
Engineer
Engineer
Posts: 15
Joined: 26 Oct 2008 18:26

Re: Patch: save company info

Post by supermatt » 15 Nov 2008 20:50

Excellent patch! I agree with PhilSophus that the save should go into the config file in the same way you save your favorite face.

Antdovu
Engineer
Engineer
Posts: 19
Joined: 28 May 2008 19:54

Re: Patch: save company info

Post by Antdovu » 17 Nov 2008 01:40

Updated the patch to save all data to openttd.cfg

2007Alain2007
Chief Executive
Chief Executive
Posts: 658
Joined: 11 Nov 2007 12:06

Re: Patch: save company info

Post by 2007Alain2007 » 16 Feb 2009 13:14

can you update this please to R15496 i think there is some probles with the new AI and this patch
For Community Integrated Version http://code.google.com/p/civopenttd/

User avatar
CommanderZ
Tycoon
Tycoon
Posts: 1872
Joined: 07 Apr 2008 18:29
Location: Czech Republic
Contact:

Re: Patch: save company info

Post by CommanderZ » 16 Feb 2009 13:21

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:
Last edited by CommanderZ on 16 Feb 2009 14:00, edited 1 time in total.

Conditional Zenith
Chief Executive
Chief Executive
Posts: 697
Joined: 10 Jun 2003 00:19
Location: Australia

Re: Patch: save company info

Post by Conditional Zenith » 16 Feb 2009 13:41

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.

2007Alain2007
Chief Executive
Chief Executive
Posts: 658
Joined: 11 Nov 2007 12:06

Re: Patch: save company info

Post by 2007Alain2007 » 16 Feb 2009 14:07

on theres files if i send you a picture for now will you be able to work it out from there
Attachments
New Bitmap Image.png
(108.56 KiB) Downloaded 156 times
For Community Integrated Version http://code.google.com/p/civopenttd/

Eddi
Tycoon
Tycoon
Posts: 7396
Joined: 17 Jan 2007 00:14

Re: Patch: save company info

Post by Eddi » 16 Feb 2009 14:11

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
You might not exactly be interested in Ferion, but if you are, have fun :)

2007Alain2007
Chief Executive
Chief Executive
Posts: 658
Joined: 11 Nov 2007 12:06

Re: Patch: save company info

Post by 2007Alain2007 » 16 Feb 2009 14:15

like moveing the lines about or dose this miss up patchs
For Community Integrated Version http://code.google.com/p/civopenttd/

Eddi
Tycoon
Tycoon
Posts: 7396
Joined: 17 Jan 2007 00:14

Re: Patch: save company info

Post by Eddi » 16 Feb 2009 14:34

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
You might not exactly be interested in Ferion, but if you are, have fun :)

Conditional Zenith
Chief Executive
Chief Executive
Posts: 697
Joined: 10 Jun 2003 00:19
Location: Australia

Re: Patch: save company info

Post by Conditional Zenith » 17 Feb 2009 01:41

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.

2007Alain2007
Chief Executive
Chief Executive
Posts: 658
Joined: 11 Nov 2007 12:06

Re: Patch: save company info

Post by 2007Alain2007 » 17 Feb 2009 01:45

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
For Community Integrated Version http://code.google.com/p/civopenttd/

dihedral
Tycoon
Tycoon
Posts: 1053
Joined: 14 Feb 2007 17:48

Re: Patch: save company info

Post by dihedral » 17 Feb 2009 09:18

there are books online! and this is more basic programming stuff than specific to c/c++

Antdovu
Engineer
Engineer
Posts: 19
Joined: 28 May 2008 19:54

Re: Patch: save company info

Post by Antdovu » 02 May 2009 18:54

Updated to trunk for now (revision 16200)

User avatar
ever
Traffic Manager
Traffic Manager
Posts: 164
Joined: 26 Apr 2009 11:45

Re: Patch: save company info

Post by ever » 04 May 2009 00:37

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.

dihedral
Tycoon
Tycoon
Posts: 1053
Joined: 14 Feb 2007 17:48

Re: Patch: save company info

Post by dihedral » 04 May 2009 08:00

could also avoid the amount of people named 'Player' too :-P

Timmaexx
Transport Coordinator
Transport Coordinator
Posts: 301
Joined: 03 Jan 2009 17:55

Re: Patch: save company info

Post by Timmaexx » 04 May 2009 14:18

I think you really hate 'Player'!
First your Change_Player_Name Script and then you Player's_will_be_kicked Script! :mrgreen:

User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Patch: save company info

Post by Bilbo » 04 May 2009 14:47

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 ....
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)

Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 6 guests