IRC logs for #openttd on OFTC at 2023-08-22
โด go to previous day
01:09:08 *** amal[m] 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 *** ChanServ sets mode: +v tokai
02:59:00 *** tokai|noir has quit IRC (Ping timeout: 480 seconds)
04:04:58 *** pikaHeiki 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:24:20 *** patrick[m]12 has joined #openttd
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: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
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: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: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: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: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: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: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: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: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> *Vsauce theme*
10:59:15 <andythenorth> I guess I'll extend PersistentStorageManager to handle migrations
11:05:50 <andythenorth> yo when versioning saves
11:06:00 <andythenorth> is it better to version the entire state, or specific properties?
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: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: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: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: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: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: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: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: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: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
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: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: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:43 <_glx_> with the correct `{STRING}`
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: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: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:31:11 <andythenorth> I wish I could find the docs for this ๐
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> _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> 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
17:03:13 *** HerzogDeXtEr has joined #openttd
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> `STR_TOWN_STORY_INDUSTRY_REPORT_HISTORY_10_DATES :{STRING1}{STRING1}{STRING1}{STRING1}{STRING1}{STRING1}{STRING1}{STRING1}{STRING1}{STRING1}
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:28:33 <andythenorth> I don't understand the interface to SetParam()
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:39:15 <DorpsGek> - Update: Translations from eints (by translators)
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:33:51 <locosage> th is commit checker on about
21:38:26 <locosage> nvm, rogue letter xD
21:44:03 *** berndj has quit IRC (Remote host closed the connection)
22:26:00 *** HerzogDeXtEr has quit IRC (Read error: Connection reset by peer)
22:27:16 *** HerzogDeXtEr has joined #openttd
22:36:51 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
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...
continue to next day โต