Page 1 of 3
Stupid questions about patching
Posted: 15 Jul 2010 08:22
by Kogut
I just compiled openttd on windows 7 using Visual C++ 2008 Express edition.
I found compiled openttd.exe in
C:\openttd_folder_kompilacyjny\ottdsrc\objs\Win32\Release
But I am unable to use it: I need also language files etc. After copy paste to old trunk folder I get anyway no language files error. What I should do?
Re: Probably the most stupid question about compiling
Posted: 15 Jul 2010 08:25
by planetmaker
Compile the whole project. Not just OpenTTD. You need strgen, too.
Re: Probably the most stupid question about compiling
Posted: 15 Jul 2010 08:30
by Kogut
Is it explained somewhere what I should do? Like in compiling guide on wiki?
Wiki search, forumn search and google search failed.
EDIT: For now I downloaded files for compiled trunk, but what with patching? Is it required to use "strgen"?
Re: Probably the most stupid question about compiling
Posted: 15 Jul 2010 08:34
by planetmaker
Kogut wrote:Is it explained somewhere what I should do? Like in compiling guide on wiki?
Wiki search, forumn search and google search failed.
EDIT: For now I downloaded files for compiled trunk, but what with patching? Is it required to use "strgen"?
Then learn to search:
http://lmgtfy.com/?q=compiling+msvc+openttd
Re: Probably the most stupid question about compiling
Posted: 15 Jul 2010 08:44
by Kogut
planetmaker wrote:Kogut wrote:Is it explained somewhere what I should do? Like in compiling guide on wiki?
Wiki search, forumn search and google search failed.
EDIT: For now I downloaded files for compiled trunk, but what with patching? Is it required to use "strgen"?
Then learn to search:
http://lmgtfy.com/?q=compiling+msvc+openttd
Thanks for reply but:
I produced openttd.exe (I guess that it counts as compiling openttd)(following one of the results of your search)
But how to "compile project"?
PS: Interesting site
Re: Probably the most stupid question about compiling
Posted: 15 Jul 2010 09:06
by Rubidium
Make a shortcut to objs/Win32/Release/openttd.exe with the "working directory" set to the bin folder in your checkout as that's where language files are copied to.
This was described in one of the MSVC compiling howtos on the wiki, but I fear it might have gone lost when someone decided to rewrite/change it.
Re: Probably the most stupid question about compiling
Posted: 15 Jul 2010 11:51
by Zuu
Or just hit F5, and it should start OpenTTD with working directory in the bin-dir of the compilation.
[edit: hitting F5 also has the benefit that you'll get a human readable call trace in the event that OpenTTD crashes]
Re: Probably the most stupid question about compiling
Posted: 15 Jul 2010 18:32
by Kogut
Thanks! It is working!
Re: Probably the most stupid question about compiling
Posted: 16 Jul 2010 06:00
by Kogut
http://wiki.openttd.org/Microsoft_Visua ... _directory
Make the directory
Make a directory called "ottdsrc" in your C:\ drive. It is important to make a directory without spaces since MSYS (the program used later for making a bundle) can only switch to directories without spaces. This will be used as a place to download the source to.
1) Why it should be called "ottdsrc"?
2) And why it should clutter the highest level of disk?
3) And why C disk?
4) Is it only example?
Re: Probably the most stupid question about compiling
Posted: 16 Jul 2010 06:36
by ChillCore
1) otttsrc stands for openttd source
2) You could put it in my_directory/the_source but program files has a space in it on windows.
3) I'd say: try. (I think you can put it on D:\ too if you adjust the rest of he commands too but I'm not sure as I used to compile with MinGW-MSYS on WinXP.)
4) See 2.
Re: Probably the most stupid question about compiling
Posted: 16 Jul 2010 06:44
by Kogut
1) Yes I know, but why not name that folder "openttd_source" or sth similar?
Re: Probably the most stupid question about compiling
Posted: 16 Jul 2010 07:00
by ChillCore
Most likely to prevent questions like: I have downloaded the source in openttd source. Why does it not work?
Re: Probably the most stupid question about compiling
Posted: 16 Jul 2010 07:10
by Kogut
End in
http://wiki.openttd.org/Microsoft_Visua ... irectX_SDK
There is "Navigate to Configuration properties -> Linker -> Input -> Additional Dependencies and remove dxguid.lib library. "
But in recent version of openttd (trunk) there is no library with that name linked. I assume that it is an outdated information, but I prefer to ask before editing.
Re: Probably the most stupid question about patching (widgets)
Posted: 17 Jul 2010 18:20
by Kogut
Where I can learn more about how widges are used in openttd?
I patched openttd (now all arctic towns requires food for growth, that part is working), but I failed on GUI part (additional text is hidden, because I was unable to find where size of window is set):
Re: Probably the most stupid question about patching (widgets)
Posted: 17 Jul 2010 18:41
by Alberth
Code: Select all
virtual void UpdateWidgetSize(...)
Handles setting of minimal size for a widget.
Other widgets around it will/should adapt to the changed size (proably not even noticable, as you only change the height, I assume).
As for learning about the widgets, I am not sure there is such a place at the moment.
At the wiki, there used to be one, but it still has the explanations of the previous widget implementation.
Feel free to change it!
Re: Probably the most stupid question about patching (widgets)
Posted: 17 Jul 2010 18:57
by Kogut
Thanks!
Maybe it is better to ask it now, instead to try to find answer in source code for two days: How to add new setting? Is it needed to add it only in settings_type.h or also somewhere else?
Re: Probably the most stupid question about patching (widgets)
Posted: 17 Jul 2010 19:04
by Zuu
Did you take a look in the wiki? The wiki contains quite a few fairly good articles on how to do certain common things. For advanced settings (previously known as patches):
http://wiki.openttd.org/OpenTTDDevBlack ... atchOption
Re: Probably the most stupid question about patching (widgets)
Posted: 17 Jul 2010 19:10
by Kogut
Thanks!
Re: Probably the most stupid question about patching (widgets)
Posted: 22 Jul 2010 18:01
by Kogut
Alberth wrote:Code: Select all
virtual void UpdateWidgetSize(...)
Handles setting of minimal size for a widget.
Other widgets around it will/should adapt to the changed size (proably not even noticable, as you only change the height, I assume).
As for learning about the widgets, I am not sure there is such a place at the moment.
At the wiki, there used to be one, but it still has the explanations of the previous widget implementation.
Feel free to change it!
But how to increase width?
Re: Probably the most stupid question about patching (widgets)
Posted: 22 Jul 2010 20:33
by Kogut
In \src\table\settings.h file I added:
Code: Select all
SDT_VAR(GameSettings, economy.town_demanded_food_divisor, SLE_UINT8, 0, MS, 1, 10000, 1, STR_CONFIG_SETTING_TOWN_DEMANDED_FOOD_DIVISOR, NULL),
based on
Code: Select all
SDT_VAR( <settings group>, <varname>, <vardef>, <savewhereflags>, <gui flags>, <initial value>, <max value>, <min value>, <display string>, <onchange callback proc>),
Table:
Code: Select all
<settings group> = GameSettings
<varname> = economy.town_demanded_food_divisor
<vardef> = SLE_UINT8
<savewhereflags> = 0
<gui flags> = MS
<initial value> = 1
<max value> = 10000
<min value> = 1
<display string> = STR_CONFIG_SETTING_TOWN_DEMANDED_FOOD_DIVISOR
<onchange callback proc> = NULL
But:
Code: Select all
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(378) : warning C4003: not enough actual parameters for macro 'SDT_VAR'
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(378) : error C2143: syntax error : missing '}' before ','
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(378) : error C2440: 'initializing' : cannot convert from 'SaveLoadTypes' to 'const void *'
3> Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(378) : error C2440: 'initializing' : cannot convert from 'void *' to 'int32'
3> There is no context in which this conversion is possible
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(380) : error C2059: syntax error : '{'
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(380) : error C2143: syntax error : missing ';' before '{'
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(380) : error C2447: '{' : missing function header (old-style formal list?)
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(380) : error C2059: syntax error : ','
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(381) : error C2143: syntax error : missing ';' before '{'
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(381) : error C2447: '{' : missing function header (old-style formal list?)
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(381) : error C2059: syntax error : ','
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(382) : error C2143: syntax error : missing ';' before '{'
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(382) : error C2447: '{' : missing function header (old-style formal list?)
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(382) : error C2059: syntax error : ','
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(383) : error C2143: syntax error : missing ';' before '{'
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(383) : error C2447: '{' : missing function header (old-style formal list?)
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(383) : error C2059: syntax error : ','
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(384) : error C2143: syntax error : missing ';' before '{'
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(384) : error C2447: '{' : missing function header (old-style formal list?)
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(384) : error C2059: syntax error : ','
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(385) : error C2143: syntax error : missing ';' before '{'
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(385) : error C2447: '{' : missing function header (old-style formal list?)
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(385) : error C2059: syntax error : ','
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(386) : error C2143: syntax error : missing ';' before '{'
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(386) : error C2447: '{' : missing function header (old-style formal list?)
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(386) : error C2059: syntax error : ','
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(387) : error C2143: syntax error : missing ';' before '{'
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(387) : error C2447: '{' : missing function header (old-style formal list?)
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(387) : error C2059: syntax error : ','
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(389) : error C2143: syntax error : missing ';' before '{'
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(389) : error C2447: '{' : missing function header (old-style formal list?)
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(389) : error C2059: syntax error : ','
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(390) : error C2143: syntax error : missing ';' before '{'
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(390) : error C2447: '{' : missing function header (old-style formal list?)
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(390) : error C2059: syntax error : ','
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(391) : error C2143: syntax error : missing ';' before '{'
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(391) : error C2447: '{' : missing function header (old-style formal list?)
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(391) : error C2059: syntax error : ','
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(392) : error C2143: syntax error : missing ';' before '{'
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(392) : error C2447: '{' : missing function header (old-style formal list?)
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(392) : error C2059: syntax error : ','
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(394) : error C2143: syntax error : missing ';' before '{'
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(394) : error C2447: '{' : missing function header (old-style formal list?)
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(394) : error C2059: syntax error : ','
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(395) : error C2143: syntax error : missing ';' before '{'
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(395) : error C2447: '{' : missing function header (old-style formal list?)
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(395) : error C2059: syntax error : ','
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(396) : error C2143: syntax error : missing ';' before '{'
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(396) : error C2447: '{' : missing function header (old-style formal list?)
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(396) : error C2059: syntax error : ','
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(398) : error C2143: syntax error : missing ';' before '{'
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(398) : error C2447: '{' : missing function header (old-style formal list?)
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(398) : error C2059: syntax error : ','
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(399) : error C2143: syntax error : missing ';' before '{'
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(399) : error C2447: '{' : missing function header (old-style formal list?)
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(399) : error C2059: syntax error : ','
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(400) : error C2143: syntax error : missing ';' before '{'
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(400) : error C2447: '{' : missing function header (old-style formal list?)
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(400) : error C2059: syntax error : ','
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(401) : error C2143: syntax error : missing ';' before '{'
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(401) : error C2447: '{' : missing function header (old-style formal list?)
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(401) : error C2059: syntax error : ','
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(402) : error C2143: syntax error : missing ';' before '{'
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(402) : error C2447: '{' : missing function header (old-style formal list?)
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(402) : error C2059: syntax error : ','
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(403) : error C2143: syntax error : missing ';' before '{'
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(403) : error C2447: '{' : missing function header (old-style formal list?)
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(403) : error C2059: syntax error : ','
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(404) : error C2143: syntax error : missing ';' before '{'
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(404) : error C2447: '{' : missing function header (old-style formal list?)
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(404) : error C2059: syntax error : ','
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(405) : error C2143: syntax error : missing ';' before '{'
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(405) : error C2447: '{' : missing function header (old-style formal list?)
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(405) : error C2059: syntax error : ','
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(406) : error C2143: syntax error : missing ';' before '{'
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(406) : error C2447: '{' : missing function header (old-style formal list?)
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(406) : error C2059: syntax error : ','
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(407) : error C2143: syntax error : missing ';' before '{'
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(407) : error C2447: '{' : missing function header (old-style formal list?)
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(407) : error C2059: syntax error : ','
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(408) : error C2143: syntax error : missing ';' before '{'
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(408) : error C2447: '{' : missing function header (old-style formal list?)
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(408) : error C2059: syntax error : ','
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(409) : error C2143: syntax error : missing ';' before '{'
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(409) : error C2447: '{' : missing function header (old-style formal list?)
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(409) : error C2059: syntax error : ','
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(410) : error C2143: syntax error : missing ';' before '{'
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(410) : error C2447: '{' : missing function header (old-style formal list?)
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(410) : error C2059: syntax error : ','
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(411) : error C2143: syntax error : missing ';' before '{'
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(411) : error C2447: '{' : missing function header (old-style formal list?)
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(411) : error C2059: syntax error : ','
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(412) : error C2143: syntax error : missing ';' before '{'
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(412) : error C2447: '{' : missing function header (old-style formal list?)
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(412) : error C2059: syntax error : ','
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(413) : error C2143: syntax error : missing ';' before '{'
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(413) : error C2447: '{' : missing function header (old-style formal list?)
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(413) : error C2059: syntax error : ','
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(414) : error C2143: syntax error : missing ';' before '{'
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(414) : error C2447: '{' : missing function header (old-style formal list?)
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(414) : error C2059: syntax error : ','
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(415) : error C2143: syntax error : missing ';' before '{'
3>c:\openttd_folder_kompilacyjny\openttdnewfolder\src\table\settings.h(415) : fatal error C1003: error count exceeds 100; stopping compilation
What is wrong with my code?