Config
Log for #openttd on 3rd July 2019:
Times are UTC Toggle Colours
00:00:11  <spnda> When I want a certain function to run on game start and then sometimes get reexecuted when a game starts or finished in which file should this be done? In a game core file maybe?
00:11:06  <Eddi|zuHause> what kind of function?
00:11:59  <Eddi|zuHause> if it's commands, you might want to look at server scripts or admin port
00:12:52  <spnda> what's the admin port again
00:13:19  <Eddi|zuHause> an interface for external programs to issue commands
00:13:32  <Eddi|zuHause> and a few other things
00:14:56  <spnda> Well it's a function for discord rich presence
00:15:39  <glx> admin port seems to be a good candidate then
00:16:26  <spnda> That's what planetmakers suggestion was on the forums. But when doing C++ I'm unsure how that would all work
00:16:59  <Eddi|zuHause> admin port is basically like a network connection
00:17:00  <glx> admin port can be used with any language, it's just an interface
00:17:20  <Eddi|zuHause> there are existing admin port libraries in java and python, i think
00:17:36  <Eddi|zuHause> you could use those as a starting point
00:18:14  <spnda> Python, Java, PHP.
00:18:24  <glx> and a big advantage of using admin port is that you keep a vanilla server
00:18:34  <glx> easier for users
00:19:07  <Eddi|zuHause> and it'll work for both vanilla and patchpacks, without complicated merging
00:19:16  <spnda> But doesn't this mean the user would need to launch a different program?
00:19:56  <glx> admin port is on the server only
00:19:58  <Eddi|zuHause> you probably need to make a wrapper script that launches both your admin port library and the game at the same time
00:20:09  <Eddi|zuHause> and they would need to configure the game to open the admin port
00:20:21  <Eddi|zuHause> not sure if that's even supported in single player
00:24:04  <Eddi|zuHause> hm... my steam cart is alredy 30€ and i've made barely a dent in my wishlist :(
00:25:23  *** Tirili has quit IRC
00:36:59  *** Wormnest has joined #openttd
00:37:17  <spnda> I just added the Discord stuff right into the source code. Works perfectly fine.
00:37:47  <glx> Eddi|zuHause: and how is the list of never started games ?
00:38:08  <Eddi|zuHause> glx: i'm fairly good at that... :)
00:41:14  <spnda> in game_core.cpp can I access the current company, if currently in a game?
00:41:49  <spnda> Or should I do this from a completely different file. (I know I probably should be doing it through the admin port but I want integration inside of the program)
00:43:13  <glx> if you want the actual player it's the local company
00:46:01  <spnda> Can I get the name of it?
00:47:15  <glx> _local_company
00:47:57  <spnda> The name of the company itself, I mean.
00:48:41  <glx> it's a CompanyID so you can use company functions with it
00:53:16  <spnda> But how do I get a Company with a CompanyID?
00:53:48  <glx> Company::Get() should do it
00:54:15  <glx> than to get the name of the company you need to format the string
00:54:51  <glx> check usages of STR_COMPANY_NAME
00:56:41  <glx> you don't need to get the Company to get the name, CompanyID is enough
01:02:36  <tfgbd_> Use the resource editor.  It's GUI now.
01:02:53  <tfgbd_> .rc .re files are not Editible Text
01:18:04  <spnda> Which function runs when a new game has just started?
01:18:14  <spnda> Or a game has been loaded
01:26:00  <glx> you can look for "game_start.scr" as this script is executed at start
01:26:33  *** tfgbd_ has left #openttd
01:33:48  <spnda> glx where are those scripts located? I can't find it
01:33:55  *** snail_UES_ has joined #openttd
01:34:10  <glx> I mean search in the code
01:46:31  *** spnda has quit IRC
02:08:57  *** Flygon has joined #openttd
02:15:46  *** Wormnest has quit IRC
02:23:46  *** D-HUND has joined #openttd
02:27:08  *** debdog has quit IRC
02:31:49  *** Mahjong1 has joined #openttd
02:36:13  *** Mahjong has quit IRC
03:06:58  *** snail_UES_ has quit IRC
03:18:38  *** Samu has quit IRC
03:29:50  *** glx has quit IRC
06:02:43  *** Eddi|zuHause has quit IRC
06:04:18  *** Mahjong has joined #openttd
06:05:38  *** gnu_jj has quit IRC
06:05:38  *** Thedarkb-T60 has quit IRC
06:05:38  *** Arveen has quit IRC
06:05:38  *** Meiki has quit IRC
06:05:38  *** freu[m] has quit IRC
06:05:38  *** king[m] has quit IRC
06:05:38  *** paulus[m] has quit IRC
06:05:38  *** grag[m] has quit IRC
06:05:38  *** cesar[m] has quit IRC
06:05:38  *** nartir[m] has quit IRC
06:05:38  *** dag[m] has quit IRC
06:05:38  *** pothyurf[m] has quit IRC
06:05:38  *** lapav[m] has quit IRC
06:05:38  *** yur3shmukcik[m] has quit IRC
06:05:38  *** ad5twoknebor[m] has quit IRC
06:05:38  *** murr4y has quit IRC
06:05:38  *** innocenat_ has quit IRC
06:05:38  *** acklen_ has quit IRC
06:05:38  *** rubenwardy has quit IRC
06:05:38  *** colde has quit IRC
06:05:38  *** Vadtec has quit IRC
06:05:38  *** greeter has quit IRC
06:05:38  *** ST2 has quit IRC
06:05:38  *** Sacro has quit IRC
06:05:38  *** mikegrb has quit IRC
06:05:38  *** ToBeFree has quit IRC
06:05:38  *** techmagus has quit IRC
06:05:38  *** Laedek has quit IRC
06:05:38  *** AKTheKnight has quit IRC
06:05:38  *** Extrems has quit IRC
06:05:38  *** jinks has quit IRC
06:05:38  *** Antheus has quit IRC
06:05:38  *** daspork_ has quit IRC
06:05:38  *** Flygon has quit IRC
06:05:38  *** APTX has quit IRC
06:05:38  *** Smedles has quit IRC
06:05:38  *** k-man has quit IRC
06:05:38  *** tokai|noir has quit IRC
06:05:38  *** y2kboy23 has quit IRC
06:05:38  *** rocky11384497 has quit IRC
06:05:38  *** Maarten has quit IRC
06:05:38  *** heffer has quit IRC
06:05:38  *** Ttech has quit IRC
06:05:38  *** reldred has quit IRC
06:05:38  *** nnyby has quit IRC
06:05:38  *** cHawk has quit IRC
06:05:38  *** dwfreed has quit IRC
06:05:38  *** WWacko1976-work has quit IRC
06:05:38  *** khavik[m] has quit IRC
06:05:38  *** dude[m] has quit IRC
06:05:38  *** ircer[m] has quit IRC
06:05:38  *** iarp[m] has quit IRC
06:05:38  *** blim[m] has quit IRC
06:05:38  *** yoltid[m] has quit IRC
06:05:38  *** buggeas40d[m] has quit IRC
06:05:38  *** tops[m] has quit IRC
06:05:38  *** hylshols7qui[m] has quit IRC
06:05:38  *** Xaroth has quit IRC
06:05:38  *** Alkel_U3 has quit IRC
06:05:38  *** Speedy` has quit IRC
06:05:39  *** KenjiE20 has quit IRC
06:05:39  *** goodger has quit IRC
06:05:39  *** juzza1 has quit IRC
06:05:39  *** tycoondemon has quit IRC
06:05:39  *** ntsbmvnk has quit IRC
06:05:39  *** ZirconiumX has quit IRC
06:05:39  *** Lejving has quit IRC
06:05:39  *** luaduck has quit IRC
06:05:39  *** milek7 has quit IRC
06:05:39  *** Exec has quit IRC
06:05:39  *** _dp_ has quit IRC
06:05:39  *** ericnoan has quit IRC
06:05:39  *** nakki has quit IRC
06:05:39  *** backtu[m] has quit IRC
06:05:39  *** Corns[m] has quit IRC
06:05:39  *** jact[m] has quit IRC
06:05:39  *** gandi[m] has quit IRC
06:05:39  *** natmac[m] has quit IRC
06:05:39  *** josef[m] has quit IRC
06:05:39  *** jeeg[m] has quit IRC
06:05:39  *** nolep[m] has quit IRC
06:05:39  *** labs[m] has quit IRC
06:05:39  *** cawal[m] has quit IRC
06:05:39  *** ciet[m] has quit IRC
06:05:39  *** godva[m] has quit IRC
06:05:39  *** twom[m] has quit IRC
06:05:39  *** ookfof[m] has quit IRC
06:05:39  *** fiddeldibu[m] has quit IRC
06:05:39  *** glothit7ok[m] has quit IRC
06:05:39  *** olmvnec[m] has quit IRC
06:05:39  *** ist5shreawf[m] has quit IRC
06:05:39  *** UncleCJ has quit IRC
06:05:39  *** guru3 has quit IRC
06:05:39  *** crem1 has quit IRC
06:05:39  *** orudge has quit IRC
06:05:39  *** grossing has quit IRC
06:05:39  *** dihedral has quit IRC
06:05:39  *** seatsea0 has quit IRC
06:05:39  *** FLHerne has quit IRC
06:05:39  *** fonsinchen has quit IRC
06:05:39  *** Jyggalag has quit IRC
06:05:53  *** berndj has quit IRC
06:09:43  *** Mahjong1 has quit IRC
06:10:35  *** Mahjong has quit IRC
06:10:40  *** Heiki has quit IRC
06:12:29  *** SpComb has quit IRC
06:21:13  *** planetmaker has quit IRC
06:31:53  *** D-HUND has quit IRC
06:32:05  *** debdog has joined #openttd
06:35:48  *** planetmaker has joined #openttd
06:35:48  *** SpComb^ has joined #openttd
06:35:48  *** Heili has joined #openttd
06:35:48  *** Mahjong has joined #openttd
06:35:48  *** berndj has joined #openttd
06:35:48  *** Eddi|zuHause2 has joined #openttd
06:35:48  *** Flygon has joined #openttd
06:35:48  *** tokai|noir has joined #openttd
06:35:48  *** gnu_jj has joined #openttd
06:35:48  *** y2kboy23 has joined #openttd
06:35:48  *** WWacko1976-work has joined #openttd
06:35:48  *** _dp_ has joined #openttd
06:35:48  *** ericnoan has joined #openttd
06:35:48  *** Thedarkb-T60 has joined #openttd
06:35:48  *** rocky11384497 has joined #openttd
06:35:48  *** nakki has joined #openttd
06:35:48  *** Arveen has joined #openttd
06:35:48  *** APTX has joined #openttd
06:35:48  *** Smedles has joined #openttd
06:35:48  *** Laedek has joined #openttd
06:35:48  *** backtu[m] has joined #openttd
06:35:48  *** nolep[m] has joined #openttd
06:35:48  *** freu[m] has joined #openttd
06:35:48  *** gandi[m] has joined #openttd
06:35:48  *** king[m] has joined #openttd
06:35:48  *** dude[m] has joined #openttd
06:35:48  *** natmac[m] has joined #openttd
06:35:48  *** josef[m] has joined #openttd
06:35:48  *** ircer[m] has joined #openttd
06:35:48  *** paulus[m] has joined #openttd
06:35:48  *** Corns[m] has joined #openttd
06:35:48  *** jeeg[m] has joined #openttd
06:35:48  *** labs[m] has joined #openttd
06:35:48  *** cesar[m] has joined #openttd
06:35:48  *** jact[m] has joined #openttd
06:35:48  *** grag[m] has joined #openttd
06:35:48  *** ciet[m] has joined #openttd
06:35:48  *** nartir[m] has joined #openttd
06:35:48  *** iarp[m] has joined #openttd
06:35:48  *** godva[m] has joined #openttd
06:35:48  *** dag[m] has joined #openttd
06:35:48  *** pothyurf[m] has joined #openttd
06:35:48  *** twom[m] has joined #openttd
06:35:48  *** cawal[m] has joined #openttd
06:35:48  *** blim[m] has joined #openttd
06:35:48  *** Meiki has joined #openttd
06:35:48  *** ookfof[m] has joined #openttd
06:35:48  *** charon.oftc.net sets mode: +ov planetmaker tokai|noir
06:35:48  *** fiddeldibu[m] has joined #openttd
06:35:48  *** tops[m] has joined #openttd
06:35:48  *** yur3shmukcik[m] has joined #openttd
06:35:48  *** yoltid[m] has joined #openttd
06:35:48  *** buggeas40d[m] has joined #openttd
06:35:48  *** olmvnec[m] has joined #openttd
06:35:48  *** lapav[m] has joined #openttd
06:35:48  *** ad5twoknebor[m] has joined #openttd
06:35:48  *** ist5shreawf[m] has joined #openttd
06:35:48  *** glothit7ok[m] has joined #openttd
06:35:48  *** hylshols7qui[m] has joined #openttd
06:35:48  *** khavik[m] has joined #openttd
06:35:48  *** UncleCJ has joined #openttd
06:35:48  *** Maarten has joined #openttd
06:35:48  *** heffer has joined #openttd
06:35:48  *** guru3 has joined #openttd
06:35:48  *** Ttech has joined #openttd
06:35:48  *** Xaroth has joined #openttd
06:35:48  *** AKTheKnight has joined #openttd
06:35:48  *** Extrems has joined #openttd
06:35:48  *** Alkel_U3 has joined #openttd
06:35:48  *** k-man has joined #openttd
06:35:48  *** reldred has joined #openttd
06:35:48  *** jinks has joined #openttd
06:35:48  *** Antheus has joined #openttd
06:35:48  *** nnyby has joined #openttd
06:35:48  *** murr4y has joined #openttd
06:35:48  *** ST2 has joined #openttd
06:35:48  *** innocenat_ has joined #openttd
06:35:48  *** Sacro has joined #openttd
06:35:48  *** mikegrb has joined #openttd
06:35:48  *** greeter has joined #openttd
06:35:48  *** acklen_ has joined #openttd
06:35:48  *** techmagus has joined #openttd
06:35:48  *** rubenwardy has joined #openttd
06:35:48  *** colde has joined #openttd
06:35:48  *** ToBeFree has joined #openttd
06:35:48  *** Vadtec has joined #openttd
06:35:48  *** daspork_ has joined #openttd
06:35:48  *** dwfreed has joined #openttd
06:35:48  *** cHawk has joined #openttd
06:35:48  *** Speedy` has joined #openttd
06:35:48  *** crem1 has joined #openttd
06:35:48  *** orudge has joined #openttd
06:35:48  *** KenjiE20 has joined #openttd
06:35:48  *** goodger has joined #openttd
06:35:48  *** juzza1 has joined #openttd
06:35:49  *** tycoondemon has joined #openttd
06:35:49  *** ntsbmvnk has joined #openttd
06:35:49  *** ZirconiumX has joined #openttd
06:35:49  *** Lejving has joined #openttd
06:35:49  *** luaduck has joined #openttd
06:35:49  *** milek7 has joined #openttd
06:35:49  *** Exec has joined #openttd
06:35:49  *** grossing has joined #openttd
06:35:49  *** dihedral has joined #openttd
06:35:49  *** seatsea0 has joined #openttd
06:35:49  *** FLHerne has joined #openttd
06:35:49  *** fonsinchen has joined #openttd
06:35:49  *** Jyggalag has joined #openttd
06:36:08  *** ChanServ sets mode: +v DorpsGek
06:36:08  *** ChanServ sets mode: +o peter1138
06:36:08  *** ChanServ sets mode: +v Terkhen
06:36:08  *** ChanServ sets mode: +o SmatZ
09:31:18  <LordAro> blarg, no bike until friday
09:41:56  *** Compu has joined #openttd
09:42:38  *** Eddi|zuHause2 is now known as Eddi|zuHause
09:45:47  <peter1138> Oh no!
09:46:04  <peter1138> Wait, surely you have more than one? :p
09:49:58  <Arveen> 🚲 have this one meanwhile
09:59:59  <Eddi|zuHause> have an empty box?
10:00:56  <nakki> it's two thousand nineteen and your irc client doesn't have emojis working?
10:01:28  <Eddi|zuHause> it's more to do with font selection than IRC client, i think
10:02:40  <nakki> sure, the whole stack matters
10:03:55  <peter1138> More importantly, does it work in OpenTTD? :D
10:04:53  <Eddi|zuHause> probably not out-of-the-box :p
10:05:31  <peter1138> Sadly OpenTTD substitutes the whole font when a glyph is missing, not just the missing glyph.
10:05:48  <peter1138> (Which is why font selection often doesn't work)
10:12:53  <reldred> You mean I can put emojis in my station names in openttd?
10:13:08  * reldred prepares to make Cursed Grfs
10:13:24  <Eddi|zuHause> you can put any unicode symbol in names
10:13:38  <Eddi|zuHause> but the font might not display it
10:13:57  <reldred> I'll start copying my github release notes made in the zalgo text generator into my grf descriptions.
10:14:07  <nakki> heh
10:14:13  <nakki> iä, iä
10:14:35  <nakki> south hooverville station fhtagn!
10:15:03  <reldred> lol
10:15:19  <reldred> Sigh. Time to paint more pixels tonight I think.
10:15:33  <reldred> I fixed a ten year old bug in an unreleased station set last night, then released it.
10:15:57  <reldred> I mean be reasonable, we didn;'t have custom rail types back when I made that .grf
10:16:15  <reldred> but wow does it look nice with narrow guage :)
10:33:57  <DorpsGek_II> [OpenTTD/OpenTTD] rsn8887 commented on issue #7333: Libtimidity could be trivially enabled to play music through mixer.cpp https://git.io/fj6fz
10:38:22  <DorpsGek_II> [OpenTTD/OpenTTD] LordAro commented on issue #7333: Libtimidity could be trivially enabled to play music through mixer.cpp https://git.io/fj6fw
10:40:14  <DorpsGek_II> [OpenTTD/OpenTTD] rsn8887 opened issue #7636: Bring libtimidity support back https://git.io/fj6fK
10:42:40  <DorpsGek_II> [OpenTTD/OpenTTD] Milek7 commented on issue #7636: Bring libtimidity support back https://git.io/fj6f6
10:43:26  <DorpsGek_II> [OpenTTD/OpenTTD] rsn8887 commented on issue #7636: Bring libtimidity support back https://git.io/fj6fi
10:43:27  <DorpsGek_II> [OpenTTD/OpenTTD] rsn8887 closed issue #7636: Bring libtimidity support back https://git.io/fj6fK
10:44:47  <DorpsGek_II> [OpenTTD/OpenTTD] rsn8887 commented on issue #7636: Bring libtimidity support back https://git.io/fj6fX
10:47:08  *** Samu has joined #openttd
10:56:59  <DorpsGek_II> [OpenTTD/OpenTTD] Eddi-z commented on issue #7636: Bring libtimidity support back https://git.io/fj6fb
11:12:35  *** rocky11384497 has quit IRC
11:16:11  *** WWacko1976-work has quit IRC
11:56:11  *** snail_UES_ has joined #openttd
12:05:38  *** snail_UES_ has quit IRC
12:42:38  *** sla_ro|master has joined #openttd
12:49:23  *** andythenorth has joined #openttd
13:00:13  *** techmagus has quit IRC
13:04:09  *** techmagus has joined #openttd
13:17:39  <reldred> andythenorth: hey guess what I'm finally getting ready to code: https://github.com/reldred/re_suburban/blob/master/Art/re_suburban.png
13:18:19  <reldred> I've only been sitting on the sprites cornelius gave me for twelve years
13:32:32  <andythenorth> iz stations
13:34:07  <reldred> yup, working on some greenery, station lights, signposts, etc.
13:34:17  <reldred> should have options more in line with jp stations
13:43:14  *** nielsm has joined #openttd
14:33:14  *** Tirili has joined #openttd
14:49:26  *** Flygon has quit IRC
14:51:08  *** Samu_ has joined #openttd
14:54:12  *** Wormnest has joined #openttd
14:57:59  *** Samu has quit IRC
15:01:10  *** andythenorth has quit IRC
15:11:11  *** andythenorth has joined #openttd
15:57:19  *** spnda has joined #openttd
16:09:52  *** andythenorth has quit IRC
16:23:46  *** andythenorth has joined #openttd
16:26:46  *** frosch123 has joined #openttd
16:37:45  *** andythenorth has left #openttd
16:44:03  *** HerzogDeXtEr has joined #openttd
17:03:46  *** andythenorth has joined #openttd
17:03:49  <andythenorth> yo
17:07:30  *** Wolf01 has joined #openttd
17:07:44  <Wolf01> o/
17:09:32  <spnda> I still can't find any function or trigger that runs when a new game is loaded and the player can start playing...
17:12:00  <LordAro> spnda: add one!
17:12:02  <LordAro> probably.
17:12:42  <Eddi|zuHause> you got enough pointers how to look for one...
17:19:43  *** urdh has quit IRC
17:34:51  *** tokai has joined #openttd
17:34:51  *** ChanServ sets mode: +v tokai
17:38:37  *** Eddi|zuHause has quit IRC
17:39:04  *** Eddi|zuHause has joined #openttd
17:40:15  *** Eddi|zuHause has joined #openttd
17:41:45  *** tokai|noir has quit IRC
17:45:30  *** glx has joined #openttd
17:45:30  *** ChanServ sets mode: +v glx
18:05:07  *** rocky11384497 has joined #openttd
18:05:13  *** Progman has joined #openttd
18:11:08  *** urdh has joined #openttd
18:13:10  <andythenorth> now what shall I do? :)
18:13:41  <Eddi|zuHause> if in doubt, lunch?
18:16:28  <andythenorth> lunch happened at least twice today
18:26:07  *** Heili has quit IRC
18:26:13  *** Heiki has joined #openttd
18:50:15  <andythenorth> so...a map display to show industries with cargo transport below a % threshold? o_O
18:52:35  <frosch123> link industry directory to smallmap?
18:52:46  <frosch123> only show industries currently visible in the list?
18:52:55  <frosch123> then sort/filter the industry list
18:56:08  <nielsm> I wonder if a more flexible filtering UI would be useful in more places
18:56:28  <nielsm> vehicle lists, purchasing lists, industry lists
18:56:42  <frosch123> ideally there would be a list widget, which already provides text filters, column sorting and column filtering
18:56:53  <nielsm> yeah
18:57:05  <frosch123> currently all windows have to do that themself, and all do it differently
19:01:25  <nielsm> also for sorting it could be neat to have a way to select a sort by the ratio or difference or product of two parameters
19:01:36  <nielsm> any two parameters
19:04:04  <frosch123> freeorion uses stable sorting for all its lists, so you get most sort variants by clicking different rows in a sequence
19:04:29  <frosch123> but it does not resort automatically when numbers change
19:06:27  <frosch123> s/rows/columns/
19:07:10  <frosch123> oh, also freeorion allows you to position and select visible columns
19:07:49  <frosch123> so, if your items have 20 attributes, you can pick which to display as columns
19:08:14  <frosch123> no spreadsheet formulas though :p
19:12:11  <spnda> Uh I just tried to get _cur_year from date_func.h and now in date_func.h and date_type.h some stuff is apparently undefined. That being: uint64, int32 and uint8. So uhm anyone know why this is?
19:12:42  <frosch123> always include stdafx first
19:12:56  <Eddi|zuHause> order of includes
19:13:29  <frosch123> stdafx first, safeguards last, that's the rule
19:13:48  <spnda> Ah ok, thanks.
19:14:15  <LordAro> (ideally, the headers should include the stuff they use, but...)
19:15:24  <frosch123> that should be the case for everything but those two
19:15:51  <spnda> huh ok. Also does _cur_year update automatically or would I have to check for it?
19:16:24  <frosch123> spnda: either there is a function returning the value, or there is a global variable with the value
19:16:41  <frosch123> but there is never a function to fill a global variable
19:17:11  <frosch123> otherwise that function could just return the value without needing a global
19:17:53  <spnda> _cur_year is global
19:18:00  <Eddi|zuHause> ideally we would not have any global variables, but the code is very old in some places
19:18:11  <frosch123> (hmm though i guess there are exceptions with stuff from commands for the local company, like _refit_capacity)
19:29:02  <Samu_> round 44 begins
19:29:08  <Samu_> almost there
19:29:17  <Samu_> 47 is coming
19:29:19  *** peter1138 has quit IRC
19:32:07  *** peter1138 has joined #openttd
19:32:07  *** ChanServ sets mode: +o peter1138
19:35:08  <andythenorth> did someone make a grf with electricity as a cargo?
19:35:46  <nielsm> batteries are in the base game
19:35:50  <nielsm> (in toyland)
19:36:20  *** andythenorth is now known as Guest6620
19:36:20  *** andythenorth has joined #openttd
19:38:56  <andythenorth> found https://www.tt-forums.net/viewtopic.php?f=26&t=63356
19:39:40  <Eddi|zuHause> was it lost?
19:41:31  <nielsm> a better approach would probably be to just pretend there are underground transmission cables strewn about the map
19:41:35  <DorpsGek_II> [OpenTTD/OpenTTD] mercuriete opened issue #7637: Midi notes are never released and sustained forever https://git.io/fj6YF
19:41:51  <nielsm> and then have some kind of game global counting available power and demand power
19:43:09  *** Guest6620 has quit IRC
19:43:37  <Eddi|zuHause> wires probably fall into the same category as pipes. they need a new transport type
19:43:40  <DorpsGek_II> [OpenTTD/OpenTTD] nielsmh commented on issue #7637: Midi notes are never released and sustained forever https://git.io/fj6YA
19:44:18  <LordAro> nielsm: like yoda you speak
19:44:41  <nielsm> I think backwards
19:46:12  <nielsm> I think it could be worth adding a new kind of variables in the game, accessible via newgrf and perhaps also GS, named globals
19:46:33  <nielsm> maybe named via the popular 4cc scheme
19:46:43  <Eddi|zuHause> nielsm: there is per-industry and per-town storage
19:47:01  <nielsm> yeah, here you want a truly global storage so all industries can sum up their total production
19:47:15  <nielsm> and towns can read the result
19:47:55  <DorpsGek_II> [OpenTTD/OpenTTD] mercuriete commented on issue #7637: Midi notes are never released and sustained forever https://git.io/fj6Oe
19:47:55  <Eddi|zuHause> global storage might overlap with GS scope
19:49:07  <DorpsGek_II> [OpenTTD/OpenTTD] nielsmh commented on issue #7637: Midi notes are never released and sustained forever https://git.io/fj6Of
19:50:14  <nielsm> Eddi|zuHause: it will, but it might also open a way for GS and GRF to cooperate
19:51:19  <Eddi|zuHause> ... which will open a dependency hell
19:51:25  <nielsm> indeed
19:52:08  <DorpsGek_II> [OpenTTD/OpenTTD] mercuriete commented on issue #7637: Midi notes are never released and sustained forever https://git.io/fj6OU
19:53:19  <spnda> This is probably the most wrong way I could have made this. I made the function to update Discord inside of the function that lets the toolbar show up.
19:53:19  <DorpsGek_II> [OpenTTD/OpenTTD] nielsmh commented on issue #7637: Midi notes are never released and sustained forever https://git.io/fj6OI
19:53:20  <DorpsGek_II> [OpenTTD/OpenTTD] nielsmh closed issue #7637: Midi notes are never released and sustained forever https://git.io/fj6YF
19:54:19  <spnda> But hey this works just as expected... Just that the company name doesn't show up...
19:55:14  <Eddi|zuHause> you probably need to convert the name into a string
19:55:43  <spnda> I always get an assertion error if I do Company::Get(_local_company).name
19:55:54  <spnda> I think even with GetIfValid()
19:56:15  <andythenorth> nielsm: we devised some schema before for regions
19:56:25  <Eddi|zuHause> shouldn't that be ->name?
19:56:27  <andythenorth> which could handle power, if arbitrarily devised
19:56:47  <spnda> What's the difference between name, name_1 and name_2
19:56:56  <Eddi|zuHause> dunno
19:57:01  <DorpsGek_II> [OpenTTD/OpenTTD] nielsmh commented on issue #7637: Midi notes are never released and sustained forever https://git.io/fj6OY
19:57:12  <Eddi|zuHause> manager name?
19:57:26  <spnda> Ah found it in the struct..
19:57:46  <spnda> Seems name_1 is the default name and name is when the user changed it. A bit complicated I feel
19:59:40  <spnda> yup it crashed because of that
20:01:26  <DorpsGek_II> [OpenTTD/OpenTTD] nielsmh commented on issue #7637: Midi notes are never released and sustained forever https://git.io/fj6On
20:04:47  <frosch123> spnda: you should not use either of them
20:04:56  <spnda> what else?
20:04:58  <frosch123> instead you should use a string with {COMPANY}
20:05:27  <spnda> I don't want to create a string in the language files though.
20:05:29  <nielsm> there is probably a STR_JUST_COMPANY constant you can use
20:05:39  <nielsm> which is just the company name and nothing more
20:07:29  <nielsm> STR_COMPANY_NAME
20:07:41  <nielsm> or STR_COMPANY_NAME_COMPANY_NUM                                    :{COMPANY} {COMPANY_NUM}
20:08:03  <spnda> so how would I convert that to std::string?
20:08:20  <nielsm> format buffer
20:09:03  <nielsm> strings_func.h
20:09:41  <spnda> GetStringPtr maybe?
20:09:43  <nielsm> no
20:09:53  <nielsm> that gets the raw format string, it doesn't format
20:10:26  <nielsm> char buffer[64]; std::string foo{GetString(buffer, STR_COMPANY_NAME, lastof(buffer))};
20:10:33  <nielsm> would probably work
20:10:38  <nielsm> oh wait no
20:10:57  <nielsm> before that you also need: SetDParam(0, company_number);
20:11:15  <nielsm> (to indicate which company you want the name of)
20:12:17  <spnda> I'll try that. Thanks a lot
20:12:53  *** frosch123 has quit IRC
20:13:23  <nielsm> also no that won't work
20:13:36  <nielsm> since I didn't read what GetString returns
20:13:47  <nielsm> (it returns a pointer to the end of the formatted string, not the start)
20:14:20  <spnda> Just wanted to say... I got no output
20:14:34  <nielsm> SetDParam(0, company_num); char buffer[64]; GetString(buffer, STR_COMPANY_NAME, lastof(buffer)); std::string name(buffer);
20:15:21  <nielsm> it'd be nice if someone would change the string formatting to return std::string or something like that...
20:16:27  <spnda> Thanks a lot for that code. It's now showing up correctly as "Unnamed"
20:23:18  <andythenorth> 84% Horse
20:23:19  <andythenorth> :P
20:23:33  <andythenorth> 52 trains to draw
20:24:52  *** sla_ro|master has quit IRC
20:32:33  <Eddi|zuHause> why is going by train twice as expensive as going the same route by car?
20:33:21  <spnda> DB?
20:33:26  <andythenorth> because safety cases
20:33:27  <andythenorth> unions
20:33:32  <andythenorth> infra
20:35:07  <spnda> how do I declare global variables again and use them in another file? I'm getting linker errors all the time because the variable is already defined
20:35:29  <nielsm> use the extern keyword
20:35:48  <nielsm> "extern int _foo;" declares that _foo is an int with storage defined somewhere else
20:35:54  <spnda> I have that
20:36:24  <spnda> In all other files I do extern std::chrono::milliseconds _timestamp;. In the header file I just do std::chrono::milliseconds _timestamp
20:37:22  <milek7> in header use extern
20:37:28  <nielsm> yeah
20:37:35  <spnda> everywhere else aswell or not?
20:37:38  <milek7> and in single translation unit declare storage
20:37:38  <nielsm> now you're defining storage in all cpp files that include the header
20:40:21  <DorpsGek_II> [OpenTTD/OpenTTD] nielsmh opened pull request #7638: Change: Limit in-editor warnings in VS 2019 https://git.io/fj63e
20:41:29  <spnda> Now I'm getting unresolved external symbol in my header file I think
20:42:02  <nielsm> did you decide on which cpp file owns the global?
20:42:29  <nielsm> you decide on one (arbitrarily, but probably something that would make sense to others) that define the global as not extern in that one
20:43:20  <spnda> No I did not. So do I just have to remove the extern symbol in one cpp file?
20:44:09  <nielsm> compare date_func.h and date.cpp
20:44:28  <nielsm> see how date_func.h declares _cur_year as extern, and then date.cpp declares it as not extern
20:44:43  <nielsm> that makes date.cpp "own" the global by defining its storage
20:45:33  <Eddi|zuHause> you put the extern in the header file, and the not-extern in any cpp file, no extern in the other cpp files
20:45:46  <spnda> Ah yeah
20:45:53  <Eddi|zuHause> the other cpp files just include the header
20:46:00  <Eddi|zuHause> which will include the extern
20:46:04  <spnda> done
20:47:42  <spnda> Thanks guys. If anyone has Discord and are on the same guild as me. You can see my feed of what I am doing in OpenTTD now.
20:50:42  <nielsm> gnight
20:51:10  <Eddi|zuHause> "withe the purchase of this bundle you save 0,--€", thanks, steam.
20:58:46  *** nielsm has quit IRC
21:03:07  <andythenorth> nice discount
21:03:42  <DorpsGek_II> [OpenTTD/OpenTTD] stormcone commented on issue #7635: Game crash on exit scenario editor when you build or demolish infrastructure https://git.io/fj63E
21:27:42  *** tokai has quit IRC
21:31:33  *** Tirili has quit IRC
21:38:57  *** Wolf01 has quit IRC
22:00:57  *** andythenorth has left #openttd
22:31:00  *** Wormnest has quit IRC
22:31:38  *** HerzogDeXtEr has quit IRC
22:35:41  *** snail_UES_ has joined #openttd
22:55:12  *** nielsm has joined #openttd
22:57:08  *** Progman has quit IRC
23:03:14  *** nielsm has quit IRC
23:10:24  *** debdog has quit IRC
23:11:45  *** rocky11384497 has quit IRC
23:28:46  *** debdog has joined #openttd
23:40:16  *** Mahjong has quit IRC
23:49:56  *** spnda has quit IRC

Powered by YARRSTE version: svn-trunk