IRC logs for #openttd on OFTC at 2023-08-22
            
01:09:08 *** amal[m] has joined #openttd
01:32:12 *** keikoz has joined #openttd
02:14:18 *** D-HUND has joined #openttd
02:17:45 *** debdog has quit IRC (Ping timeout: 480 seconds)
02:17:51 *** Wormnest has quit IRC (Quit: Leaving)
02:30:04 *** D-HUND is now known as debdog
02:30:13 *** keikoz has quit IRC (Ping timeout: 480 seconds)
02:51:22 *** SergioMassa[m] has joined #openttd
02:52:18 *** tokai has joined #openttd
02:52:18 *** ChanServ sets mode: +v tokai
02:59:00 *** tokai|noir has quit IRC (Ping timeout: 480 seconds)
04:04:58 *** pikaHeiki has joined #openttd
04:24:11 *** felix has quit IRC ()
04:24:34 *** felix has joined #openttd
06:03:20 *** JamesRoss[m] has joined #openttd
06:03:24 *** thomas[m]1234567 has joined #openttd
06:07:43 *** nolep[m] has joined #openttd
07:05:45 *** keikoz has joined #openttd
07:24:20 *** patrick[m]12 has joined #openttd
07:45:04 <DorpsGek> [OpenTTD/grfcodec] MatthewGentoo updated pull request #23: data: Fix Action5 table https://github.com/OpenTTD/grfcodec/pull/23
07:46:31 <DorpsGek> [OpenTTD/grfcodec] MatthewGentoo commented on pull request #23: data: Fix Action5 table https://github.com/OpenTTD/grfcodec/pull/23#pullrequestreview-1588685631
07:59:18 *** Flygon has quit IRC (Remote host closed the connection)
08:05:01 *** karl[m]12 has joined #openttd
08:09:23 *** menelaos[m] has joined #openttd
08:09:38 *** jact[m] has joined #openttd
08:16:06 *** fiddeldibu[m] has joined #openttd
08:26:40 *** karoline[m] has joined #openttd
08:31:08 *** virtualrandomnumber has joined #openttd
08:31:21 *** virtualrandomnumber has quit IRC ()
08:31:22 *** enick_57 has joined #openttd
08:41:14 <andythenorth> pfff
08:41:27 <andythenorth> I have a daylength implementation locally
08:41:42 <andythenorth> which works by opening the cheat menu and manually setting the date back 5 years
08:42:01 <andythenorth> but now I wrote a GS that uses dates to adjust industry production
08:42:47 <andythenorth> specifically a date-based delay to prevent increases being too frequent
08:43:43 <andythenorth> such lolz
09:02:08 <andythenorth> ach GS Story Book is not really a good way to build a debugger
09:14:22 *** freu[m] has joined #openttd
09:29:08 <cryoshakespeare> Would it be difficult to code a variable maximum loan GS?
09:29:39 <cryoshakespeare> I always thought the maximum loan should scale based on something akin to a credit rating and your company size, ideally scalable interest rates as well.
09:31:40 <cryoshakespeare> I'd probably also want to port something like investor dividends over from Villages is Villages.
09:42:48 <andythenorth> looks like https://docs.openttd.org/gs-api/classGSCompany#af2098d055cbe93de06878d77395134d4
09:45:29 <cryoshakespeare> andythenorth: I did not know about this resource, thanks!
09:46:57 <cryoshakespeare> And, I don't suppose there is any possible way to increase interest rates above 4%?
09:47:06 <andythenorth> dunno
09:47:21 <andythenorth> AI / GS starter guide https://wiki.openttd.org/en/Development/Script/
09:47:37 <andythenorth> I think most people start from MinimalGS by Zuu https://www.tt-forums.net/viewtopic.php?t=62163
09:47:50 <cryoshakespeare> Oh, interesting
09:48:01 <cryoshakespeare> Very handy, thanks
09:49:30 <cryoshakespeare> And yeah, it seems one needs to patch the game to increase the max interest rate.
09:50:52 <locosage> game doesn't support setting individual max loan for each company
09:51:04 <locosage> unless someone patched it recently and I missed it
09:51:32 <cryoshakespeare> Ah I see, interesting
09:53:15 <cryoshakespeare> Maybe one could use a GS to simulate this instead, is it possible to make buttons, like the borrow money button, interact with a GS?
09:53:40 <locosage> no
09:53:58 <locosage> what gs can probably do is check company loan and if it's above max quicly repay it back
09:54:06 <locosage> if company still has the money xD
09:54:17 <cryoshakespeare> Fair enough :P
10:04:17 <locosage> lol, SetMinimumLoanAmount sets nothing xD
10:04:28 <locosage> should be GetMinimumLoanAmount or smth
10:05:13 <locosage> or even Check as it just returns bool
10:06:44 <locosage> ah, nvm, it does set...
10:07:29 <locosage> weird function...
10:10:11 <cryoshakespeare> locosage: Do you think it's possible to check the company loan, store the value, then reset the loan amount to zero, and then do custom calculations using the loan value stored in the script?
10:10:49 <locosage> wdym reset loan to 0?
10:10:50 <cryoshakespeare> That way you could enforce a loan repayment period for example, where the loan incurs a cost each year that reduces the size of the loan, and you can't repay it early.
10:11:51 <locosage> I guess you can set max loan to 0 and do your own thing
10:12:04 <locosage> put loan buttons in the story book
10:12:23 <cryoshakespeare> Wait, you can make buttons for GSs?
10:12:28 <cryoshakespeare> Ahh.
10:12:30 <locosage> only in the story book
10:15:53 *** _aD has quit IRC (Ping timeout: 480 seconds)
10:17:52 <andythenorth> hmm GS is so fragile sometimes
10:23:49 <Eddi|zuHause> you could, like, simulate stock holders in the GS
10:27:12 <andythenorth> stock holder personalities ๐Ÿ˜›
10:32:47 <andythenorth> pff https://docs.openttd.org/gs-api/classGSIndustry is missing GetLastMonthDelivery?
10:32:57 <andythenorth> or I'm looking the wrong way?
10:34:02 <andythenorth> seems I have to run GSCargoMonitor for every industry
10:34:11 <andythenorth> and cache the results
10:34:27 <locosage> GetLastMonthTransported ?
10:34:52 <andythenorth> I want amount of accepted cargo supplied
10:35:19 <andythenorth> I'm already using GSCargoMonitor for something else, and reading it clears the result
10:35:24 <andythenorth> so I'll have to refactor
10:35:25 <locosage> ah, yeah, that probably is not even stored
10:36:01 <andythenorth> my GS only uses 3MB currently
10:36:10 <locosage> ez to fix xD
10:36:18 <andythenorth> maybe I just GSCargoMonitor everything and cache it for a few months
10:43:09 <alfagamma_0007> Get GS to think like Andy
10:48:42 <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1143496966366572544/image.png
10:48:42 <andythenorth> such GS
10:49:24 <alfagamma_0007> CABBAGE 99
10:49:35 <alfagamma_0007> Badger badger badger
10:50:05 <Eddi|zuHause> mushroom mushroom
10:51:21 <andythenorth> oof most of my GS is stateless
10:51:34 <andythenorth> but I have stored state for the production increase timeseries
10:51:40 <andythenorth> now I need to change the format
10:51:44 <andythenorth> so I have to write a migration
10:52:13 <andythenorth> reasons I could never be a programmer #9134
10:53:21 <alfagamma_0007> *Is actually one*
10:53:42 <alfagamma_0007> Or are you?
10:53:42 <alfagamma_0007> *Vsauce theme*
10:59:15 <andythenorth> I guess I'll extend PersistentStorageManager to handle migrations
10:59:58 <DorpsGek> [OpenTTD/grfcodec] rubidium42 approved pull request #23: data: Fix Action5 table https://github.com/OpenTTD/grfcodec/pull/23#pullrequestreview-1589166618
11:05:50 <andythenorth> yo when versioning saves
11:06:00 <andythenorth> is it better to version the entire state, or specific properties?
11:06:43 <DorpsGek> [OpenTTD/grfcodec] rubidium42 merged pull request #23: data: Fix Action5 table https://github.com/OpenTTD/grfcodec/pull/23
11:10:53 *** _aD has joined #openttd
11:40:30 <_glx_> You decide
11:41:37 <_glx_> But entire state might be simpler
12:34:05 *** kstar892[m] has joined #openttd
12:37:53 *** SpComb has quit IRC (Ping timeout: 480 seconds)
12:45:09 *** esselfe has joined #openttd
12:50:46 <andythenorth> fricking GS, I'm going to play tanks ๐Ÿ˜›
12:51:00 <andythenorth> Squirrel rage ๐Ÿ™‚
12:51:43 <_jgr_> Using tanks on squirrels doesn't feel like a fair fight ๐Ÿ˜›
12:52:06 <andythenorth> what's the scope of `this._loaded_from_version` here? https://github.com/andythenorth/firs/blob/gs-is-real/src/gs/gs_templates/main.pynut#L345
12:52:30 <andythenorth> I'm trying to reference it from `function MainClass::Init()`
12:52:33 <andythenorth> but it's not in scope
12:53:05 <andythenorth> it's an instance attribute on Main class afaict
12:53:33 <andythenorth> this weird :: syntax
12:53:41 <andythenorth> "everything is a table"
12:56:01 <andythenorth> "because Squirrel is so flexible, almost anything is possible"
12:56:08 <andythenorth> or it could just have been good ๐Ÿ˜›
12:57:32 <locosage> squirrel-oriented programming
12:57:36 <locosage> everything is a squirrel
12:59:01 <andythenorth> did I mention I don't really love it?
12:59:41 <locosage> the fact that I actually prefer c++ to squirrel says a lot about it xD
13:00:22 <andythenorth> it's not frigging calling Load()
13:00:27 <andythenorth> the log lines have gone astray
13:00:38 <andythenorth> I don't think it's helpful to complain with "I hate"
13:00:41 <andythenorth> but this is just lol bad
13:00:48 <andythenorth> I prefer nfo to this
13:00:57 *** SpComb has joined #openttd
13:00:57 *** nielsm has joined #openttd
13:01:02 <andythenorth> it's like the worst world
13:01:57 <andythenorth> - high level language, but a badly designed one
13:01:57 <andythenorth> - outdated version of the high level language, with missing features
13:01:57 <andythenorth> - poor docs for the outdated version
13:01:57 <andythenorth> - inadequate API, which requires constructing many things from primitives
13:02:40 <andythenorth> * weird syntax footguns, like `foreach` requires a trailing `_` to unpack the values, but the error if you omit that is non-obvious
13:03:14 <andythenorth> * terrible debugging environment, if you can't log it, you're lost
13:03:14 <andythenorth> * if you don't have a log line before the crash, you're lost
13:06:30 *** calbasi[m]1 has joined #openttd
13:06:40 <locosage> nah, still better than nfo :p
13:06:53 <locosage> squrrel may be a high level language that sucks but at least it's high level
13:07:08 *** igor[m] has joined #openttd
13:07:33 <andythenorth> I never minded counting bytes
13:07:45 <andythenorth> as long as it was only up to 10
13:11:20 <andythenorth> oh fuck me backwards
13:11:27 <andythenorth> ok so Load has an implicit version check
13:11:48 <andythenorth> so if you bump SELF_VERSION, Load fails silently
13:11:51 <andythenorth> think I'm going to have a break
13:12:05 <andythenorth> how do I migrate the data in that case?
13:18:27 *** _aD is now known as Guest274
13:18:32 *** _aD has joined #openttd
13:20:10 *** Guest274 has quit IRC (Ping timeout: 480 seconds)
13:20:51 <andythenorth> all I wanted to do was put last month industry production in a storybook text ๐Ÿ˜„
13:20:59 <andythenorth> now I'm in OpenTTD src trying to figure out ScriptController
13:21:09 <_jgr_> MinVersionToLoad in info.nut seems like what you want?
13:22:54 <andythenorth> thanks
13:23:19 <andythenorth> ah that's not in my cargo-culted MinimalGS ๐Ÿ™‚
13:24:32 *** SpComb has quit IRC (Read error: Connection reset by peer)
13:25:54 *** _aD has quit IRC (Quit: leaving)
13:27:53 *** SpComb has joined #openttd
13:30:45 <andythenorth> thanks so much, I would never have found that ๐Ÿ™‚
14:19:50 <locosage> do I need a savegame version bump if I add a new field?
14:20:06 <locosage> need all that miss it to have default value
14:20:37 <locosage> non-zero
14:28:05 <andythenorth> hmm no way to concatenate an arbitrary number of GSText together
14:28:15 <andythenorth> if I substring them, I need a finite number
14:28:20 <locosage> also, what's `@game @pre` annotation doing? especially in game-only function? <https://github.com/OpenTTD/OpenTTD/blob/master/src/script/api/script_company.hpp#L249>
14:30:36 <andythenorth> wonder if horrific recursive substring will work?
14:31:33 <locosage> it should be able to do raw text in master
14:32:38 <andythenorth> I can RAWSTRING
14:32:46 <andythenorth> but I want to format dates without manually formatting them
14:32:47 <Rubidium> locosage: not much more than what `@pre` is doing. I guess the `@api -ai` was missed when adding the documentation/comment
14:32:59 <andythenorth> which means I need to use GSText with {LONGDATE} I think
14:33:21 <locosage> Rubidium: so if I do a new function with -ai I only need @pre?
14:34:44 <Rubidium> yes
14:37:15 <Rubidium> it's only used during the generation of the doxygen documentation, where @game means to only add it when creating the documentation for GS. But with @api -ai it will get excluded when creating the AI documentation, so @api -ai and @game @pre are essentially doing the same but at a different level
14:47:51 *** Wolf01 has joined #openttd
14:57:35 <DorpsGek> [OpenTTD/OpenTTD] zephyris updated pull request #11001: Feature: Transparency option for cost and income indicators https://github.com/OpenTTD/OpenTTD/pull/11001
15:07:13 *** beratsj has joined #openttd
15:07:13 <beratsj> I tried to make 32bpp sprite to 8bpp sprite. but it gave an error like "8bpp file not found".
15:07:13 <beratsj> I did this with `alternativesprites` . can you help me? i am new to this topic
15:37:33 <andythenorth> trying to recurse with GSTEXT
15:38:10 <andythenorth> https://gist.github.com/andythenorth/bd8f4481745589b152b75745a83b0980
15:38:41 <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1143569942629843034/image.png
15:38:41 <andythenorth> errors ๐Ÿ™‚
15:41:16 <andythenorth> I'm guessing the GSText objects aren't resolved until rendered?
15:41:23 <andythenorth> so the parameters can't be passed like this?
15:51:04 *** Deep3D has quit IRC (Ping timeout: 480 seconds)
16:05:21 <andythenorth> ach clipping to 10 doesn't work either https://gist.github.com/andythenorth/fd3f3ed6e02607291854c69fda4380ef
16:05:32 <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1143576698961535087/image.png
16:10:30 <andythenorth> this must be PEBKAC
16:10:47 <andythenorth> I just want a list of dates of arbitrary length
16:13:58 <_glx_> parameters are inlined into the string when passed to openttd
16:15:24 <_glx_> and they are validated during inlining
16:17:04 <andythenorth> seems it's not possible to nest substrings?
16:17:41 <andythenorth> I can do `GSText(GSText.TextWithSubstring, GSText(GSText.Cabbage))`
16:17:57 <andythenorth> but I can't do GSText(GSText.TextWithSubstring, GSText(GSText.Cabbage, date))
16:18:14 <_glx_> it should work
16:18:43 <_glx_> with the correct `{STRING}`
16:18:49 <andythenorth> must be PEBCAK
16:19:23 <andythenorth> I could avoid all this by recreating the story page every time it needs to update
16:19:30 <andythenorth> but that seems to be slow / prone to crashing
16:19:50 <andythenorth> so I'm trying to update existing story page text fields
16:19:57 <andythenorth> but they need to concatenate strings
16:22:54 *** gelignite has joined #openttd
16:23:58 <andythenorth> tried {RAW_STRING} because I had no better ideas
16:24:00 <andythenorth> fails
16:24:06 <_glx_> when there are less params than expected, missing parameters (0) are inserted, when there are more they are consumed later withoug validation
16:24:44 <andythenorth> I think what I'm trying to do is probably impossible
16:25:02 <andythenorth> nml can do it, but probably it's doing magic
16:26:16 <_glx_> it's doable but you need to be careful with the parameters
16:28:17 <_glx_> substring param count must match the number expected by `{STRINGN}`
16:29:19 <andythenorth> maybe I have an obiwan somewhere
16:29:20 <andythenorth> dunno
16:30:18 <andythenorth> I really wanted to do it recursively ๐Ÿ˜›
16:30:23 <_glx_> for `GSText(GSText.TextWithSubstring, GSText(GSText.CabbageWithDate, date))`, `GSText.TextWithSubstring` should have `{STRING1}`
16:30:57 <andythenorth> what? ๐Ÿ˜ฎ
16:31:11 <andythenorth> I wish I could find the docs for this ๐Ÿ™‚
16:32:18 <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1143583437073166346/image.png
16:32:18 <andythenorth> oh I've made it worse ๐Ÿ™‚
16:32:26 <andythenorth> `STR_TOWN_STORY_INDUSTRY_REPORT_HISTORY_10_DATES :{STRING1}{STRING2}{STRING3}{STRING4}{STRING5}{STRING6}{STRING7}{STRING8}{STRING9}{STRING10}`
16:33:02 <andythenorth> I don't understand how it's reaching parameter 27, but eh
16:33:15 <andythenorth> there are 10 substrings with 1 parameter each
16:33:29 <andythenorth> composed into a string where the 10 substrings are parameters
16:34:00 <_glx_> but you tell first string consumes 1, second consumes 2, ...
16:35:14 <_glx_> if you have 10 substring consuming 1, use {STRING1} 10 times
16:36:29 <_glx_> and you can't have more than 20 parameters in total
16:37:39 <andythenorth> I wonder where the docs are
16:37:49 <andythenorth> I thought they were in AI wiki page, but I can't find them
16:38:18 <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1143584948524154992/image.png
16:38:18 <andythenorth> _glx_: works ๐Ÿ˜ฎ
16:38:19 <_glx_> it's using the same format as openttd langfiles
16:38:32 <andythenorth> wonder if I can make the recursive version work
16:38:40 <andythenorth> although max 20 params anyway...
16:40:07 <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1143585404080107570/image.png
16:40:07 <andythenorth> recursive version works ๐Ÿ˜ฎ
16:42:21 <andythenorth> there's some AddParam API to GSText
16:42:23 <andythenorth> that might be cleaner
16:42:57 <_glx_> yeah you have 2 options for the params
16:43:21 <_glx_> there's also SetParam
16:53:11 *** _aD has joined #openttd
17:03:13 *** HerzogDeXtEr has joined #openttd
17:10:06 *** Deep3D has joined #openttd
17:12:53 <andythenorth> hmm
17:13:10 <andythenorth> if I have 10 dates I need 10 params consuming string1
17:13:16 <andythenorth> but if I have 5 dates
17:13:20 <andythenorth> not sure how to handle that
17:16:06 <andythenorth> I could just do it like grf
17:16:36 <andythenorth> `STR_TOWN_STORY_INDUSTRY_REPORT_HISTORY_1_DATE :{STRING1}`
17:16:36 <andythenorth> through to
17:16:36 <andythenorth> `STR_TOWN_STORY_INDUSTRY_REPORT_HISTORY_10_DATES :{STRING1}{STRING1}{STRING1}{STRING1}{STRING1}{STRING1}{STRING1}{STRING1}{STRING1}{STRING1}
17:16:36 <andythenorth> `
17:16:42 <andythenorth> then just a big if statement to select it
17:17:05 <andythenorth> I'll do that, life is too short for programming ๐Ÿ˜›
17:26:49 <andythenorth> `[2023-08-22 18:26:29] dbg: [script] [18] [S] Your script made an error: unknown error`
17:26:50 <andythenorth> super
17:28:33 <andythenorth> I don't understand the interface to SetParam()
17:28:34 <andythenorth> https://docs.openttd.org/gs-api/classGSText#aad6e6c72605ec8735e550f5a51219b72
17:28:36 <andythenorth> how do I use it?
17:31:19 <andythenorth> seems to be that parameters are indexed to 1, not 0
17:31:23 <andythenorth> that's unexpected
17:40:26 <andythenorth> I guess the first parameter is string ID?
17:41:35 *** Wormnest has joined #openttd
17:47:55 <_zephyris> beratsj: You always need an 8bpp sprite, then you can provide a 32bpp alternate too. You'll probably get better help in Discord channel #add-on-development
18:05:39 <beratsj> Oh thanks
18:39:14 <DorpsGek> [OpenTTD/OpenTTD] eints-sync[bot] pushed 1 commits to master https://github.com/OpenTTD/OpenTTD/commit/4d4a046d23e6e0439c19298ea00e0f9b7aa73958
18:39:15 <DorpsGek> - Update: Translations from eints (by translators)
18:40:40 <DorpsGek> [OpenTTD/OpenTTD] zephyris commented on pull request #11001: Feature: Transparency option for cost and income indicators https://github.com/OpenTTD/OpenTTD/pull/11001#issuecomment-1688727588
18:47:16 <DorpsGek> [OpenTTD/OpenTTD] 2TallTyler commented on pull request #11001: Feature: Transparency option for cost and income indicators https://github.com/OpenTTD/OpenTTD/pull/11001#pullrequestreview-1590084787
19:19:27 <NGC3982> /names
19:19:29 <NGC3982> รถops
19:56:42 *** frosch123 has quit IRC (Quit: User went offline on Discord a while ago)
20:07:50 *** gelignite has quit IRC (Quit: Stay safe!)
20:09:34 *** _aD has quit IRC (Ping timeout: 480 seconds)
21:09:48 *** keikoz has quit IRC (Ping timeout: 480 seconds)
21:19:49 *** nielsm has quit IRC (Ping timeout: 480 seconds)
21:31:06 <DorpsGek> [OpenTTD/OpenTTD] ldpl opened pull request #11224: Add: [GS] Allow to set max loan for each company separately https://github.com/OpenTTD/OpenTTD/pull/11224
21:33:51 <locosage> th is commit checker on about
21:34:14 <locosage> https://cdn.discordapp.com/attachments/1008473233844097104/1143659423018008739/Screenshot_from_2023-08-23_01-33-31.png
21:34:51 <locosage> https://cdn.discordapp.com/attachments/1008473233844097104/1143659577049624696/Screenshot_from_2023-08-23_01-34-34.png
21:36:23 <DorpsGek> [OpenTTD/OpenTTD] James103 commented on pull request #11224: Add: [GS] Allow to set max loan for each company separately https://github.com/OpenTTD/OpenTTD/pull/11224#issuecomment-1688964017
21:38:01 <DorpsGek> [OpenTTD/OpenTTD] ldpl updated pull request #11224: Add: [GS] Allow to set max loan for each company separately https://github.com/OpenTTD/OpenTTD/pull/11224
21:38:26 <locosage> nvm, rogue letter xD
21:44:03 *** berndj has quit IRC (Remote host closed the connection)
21:44:17 *** berndj has joined #openttd
22:26:00 *** HerzogDeXtEr has quit IRC (Read error: Connection reset by peer)
22:27:16 *** HerzogDeXtEr has joined #openttd
22:27:57 <DorpsGek> [OpenTTD/OpenTTD] Durchbruchswagen opened pull request #11225: Fix #11161: Apply cargo filter to shared groups. https://github.com/OpenTTD/OpenTTD/pull/11225
22:36:51 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
22:49:11 *** Flygon has joined #openttd
23:18:55 <Eddi|zuHause> i need to urgently close youtube... it lead me from amelie to katjusha, and i'm worried what comes next...
23:34:36 <kamnet> Eddi|zuHause: Upgrade to youTube Premium and it will tell you when to go to bed LOL
23:49:21 <peter1139> Gah I hate docker...