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 »

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 11524 times
company_info_v3.patch
(20.78 KiB) Downloaded 356 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 »

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 »

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 »

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 »

Updated the patch to save all data to openttd.cfg
2007Alain2007
Chief Executive
Chief Executive
Posts: 658
Joined: 11 Nov 2007 12:06
Contact:

Re: Patch: save company info

Post by 2007Alain2007 »

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 »

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 »

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
Contact:

Re: Patch: save company info

Post by 2007Alain2007 »

on theres files if i send you a picture for now will you be able to work it out from there
For Community Integrated Version http://code.google.com/p/civopenttd/
Eddi
Tycoon
Tycoon
Posts: 8258
Joined: 17 Jan 2007 00:14

Re: Patch: save company info

Post 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
2007Alain2007
Chief Executive
Chief Executive
Posts: 658
Joined: 11 Nov 2007 12:06
Contact:

Re: Patch: save company info

Post by 2007Alain2007 »

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: 8258
Joined: 17 Jan 2007 00:14

Re: Patch: save company info

Post 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
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 »

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
Contact:

Re: Patch: save company info

Post 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
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 »

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 »

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 »

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 »

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 »

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 »

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: Amazon [Bot], Google [Bot] and 7 guests