IRC logs for #openttd on OFTC at 2025-06-01
⏴ go to previous day
00:29:26 *** Wormnest has quit IRC (Ping timeout: 480 seconds)
00:45:41 *** WormnestAndroid has quit IRC (Ping timeout: 480 seconds)
00:46:41 *** WormnestAndroid has joined #openttd
00:53:59 *** WormnestAndroid has quit IRC (Remote host closed the connection)
00:54:02 *** WormnestAndroid has joined #openttd
01:29:21 *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
01:29:31 *** WormnestAndroid has joined #openttd
02:44:35 *** Wormnest has joined #openttd
02:46:54 *** gnu_jj_ has quit IRC (Ping timeout: 480 seconds)
02:50:56 *** Wormnest has quit IRC (Quit: Leaving)
03:19:55 *** ipravd_ has joined #openttd
03:24:36 *** debdog has quit IRC (Ping timeout: 480 seconds)
03:25:41 *** ipravd_ has joined #openttd
03:26:23 *** D-HUND is now known as debdog
04:20:55 *** Extrems` has joined #openttd
04:27:26 *** Extrems has quit IRC (Ping timeout: 480 seconds)
04:27:26 *** Extrems` is now known as Extrems
04:44:41 *** ipravd_ has quit IRC (Ping timeout: 480 seconds)
06:03:14 <LordAro> peter1138[d]: couldn't sleep?
06:06:04 <peter1138[d]> Woke early. Kinda hot.
07:12:45 *** gelignite has joined #openttd
07:38:24 *** WormnestAndroid has quit IRC (Ping timeout: 480 seconds)
08:02:49 *** aperezdc has quit IRC (Remote host closed the connection)
08:45:58 *** aperezdc has joined #openttd
08:47:23 <pickpacket> Are goals a must for game scripts?
08:57:13 <pickpacket> actually I should be able to answer that myself...
08:59:06 <andythenorth> GS is wide ranging and flexible
09:15:30 <pickpacket> andythenorth: yeah, I should know because I haven't had to use it before :)
10:04:19 <pickpacket> I'm confused about GSText. I know you template the string in the lang file, but for this example which part is actually replaced with the GSText parameters?
10:04:22 <pickpacket> STR_SCORE_TOTAL :{LTBLUE}# {NUM} {BLACK}{COMPANY}
10:07:32 <andythenorth> probably NUM and COMPANY
10:07:40 <andythenorth> but it's quite contextual to the params
10:10:36 <pickpacket> andythenorth: textobj = GSText(GSText.STR_SCORE_TOTAL, rank, company.id);
10:11:07 <andythenorth> is it working as expected?
10:13:12 <pickpacket> andythenorth: I... uhm... I can't test it because I've screwed up the rest of the code :D
10:13:20 <pickpacket> Just trying to understand the syntax
10:13:36 <pickpacket> but yeah, it did work when I saw it run a few weeks ago
10:23:01 <pickpacket> So my theory is this: some {VALUES} are reserved for colours or special characters (like {COMMA} is used for the comma sign for example) and all others are replaced by parameters
10:27:49 <pickpacket> I really wish there was some documentation on this
10:28:21 <peter1138[d]> You asked for two parameters and provided two parameters, what's the issue?
10:31:41 <pickpacket> peter1138[d]: the issue is that I don't actually know which of these four enclosures count as "parameters": {LTBLUE}# {NUM} {BLACK}{COMPANY}
10:32:06 <pickpacket> I.e. NUM could have a special meaning afaik
10:38:06 *** WormnestAndroid has joined #openttd
10:42:43 <pickpacket> or which characters don't work in the string. I see {COMMA} in this lang file, which becomes an ordinary comma when printed. Do I need some special variable for other characters? Which ones?
10:42:56 <andythenorth> there is documentation, but it's buried
10:43:24 <pickpacket> andythenorth: I'd very, very, very much appreciate that ❤️
10:44:41 <andythenorth> I don't know if there's 100% correspondence between OpenTTD lang strings and AI/GS strings
10:59:33 <pickpacket> ohhhh. {COMMA} isn't a comma sign at all. I misremembered
11:28:55 <peter1138[d]> pickpacket: LTBLUE isn't a parameter, it just sets colour. COMMA formats a number with thousands separators. BLACK isn't a parameter... COMPANY takes a company id parameter.
11:29:29 <xarick> AddRectangle on a 4k map took 9,7 ms seconds
11:34:43 <peter1138[d]> That's not because it's a 4k map.
11:35:06 <peter1138[d]> Is it safe to assume you are just adding the whole map?
11:40:00 <LordAro> i suppose it could just store the edges
11:40:21 <LordAro> awful lot more complicated to deal with thpigh
11:42:29 <_glx_> How do you Valuate if not storing the tiles?
11:42:59 <_jgr_> Using AddRectangle with the whole map is the wrong thing to do no matter what map size you are using
11:43:58 <_jgr_> ScriptList and Valuate encourage code patterns which perform badly
11:44:09 <peter1138[d]> Unfortunately so.
11:47:50 <LordAro> _glx_: by computing the tiles on Valuate, rather than onrectangle
11:48:04 <peter1138[d]> LordAro, pub finish today, shame the coffee is meh..I hear their beer is okay...............
11:48:12 <LordAro> i can see certain cases where it'd be more efficient
11:48:22 <LordAro> peter1138[d]: "oh no"
11:48:42 <peter1138[d]> The ScriptList structure is also bad.
11:49:18 <peter1138[d]> I had a vector version which performs better but handling all the weird ops that are allowed is a pain.
11:51:22 <peter1138[d]> After 50 miles with no breakfast, I didn't fancy ione 🙂
11:51:24 <andythenorth> I was a bit surprised when I started writing GS
11:51:36 <andythenorth> all the 'use this example' stuff seemed to be endless valuatins
11:51:44 <andythenorth> treated as a feature
11:52:01 <andythenorth> which seems odd in an opcode-limited execution environment
11:52:20 <andythenorth> someone implied to me that valuate has some magic free pass on opcodes, and that's why it should be used
11:52:36 <peter1138[d]> I think it did initially.
11:52:48 <_jgr_> The reverse mapping functionality is the main problem. I've modified the structure in my branch to have less terrible performance, but it's still pretty bad and fairly ugly.
11:52:53 <peter1138[d]> But it still takes cpu cycles.
11:53:15 <andythenorth> so many of the examples I saw were valuate with the second result as just `_`
11:53:18 <peter1138[d]> Reverse mapping is only really needed when sorting by value
11:53:35 <andythenorth> I wondered why the squirrel methods weren't just used
11:54:08 <peter1138[d]> It's possible to actually just sort the data (if it's in a vector), but it risks wasting time doing that.
11:54:29 <andythenorth> ach I am supposed to have gone swimming
11:54:29 <peter1138[d]> Iterator invalidation with vector is one issue.
11:54:45 <andythenorth> one day....new Squirrel 😛
11:54:56 <peter1138[d]> Because it's maps and maps of sets, they have a bit of immunity.
11:55:43 <peter1138[d]> I used a lookup table to provide sorting, but it was all a bit pants.
11:56:35 <peter1138[d]> ScriptList allows you to remove items by item or value, or by math comparisons, and magically allows you to do that while iterating.
11:57:47 <_glx_> Valuate changes values while iterating, but it always iterate by item
12:42:00 <xarick> who dictates max map height?
12:42:07 <xarick> that I can raise land to
12:42:31 <pickpacket> hmm. I'm trying out my GS now. It doesn't work, which is no surprise as I expected *something* to go wrong. But I have log statements pretty much everywhere (including the first line in the ::Start() function) but the log just doesn't say anything at all
12:42:38 <pickpacket> no crash, no messages... nothing
12:50:15 *** boydsquirrel has joined #openttd
12:50:15 <boydsquirrel> Im new btw but does anyone know if there is a way to directly change the textures of planes I just wanted to test something
12:52:55 <pickpacket> boydsquirrel: the textures are set in the graphics set (for base game vehicles) or in newGRFs (for vehicles belonging to them)
12:54:34 <pickpacket> boydsquirrel: if the planes you want to change are from a NewGRF you're out of luck. If they're from the base game you can change the graphics pack in the Game Options menu (though you'll have to get them through the Check Online Content -- search for gfx); you're probably running OpenGFX now
12:54:45 <pickpacket> boydsquirrel: that'll change all textures, though
12:55:23 <pickpacket> boydsquirrel: what is it you'd like to test?
13:12:55 <pickpacket> How do I insert a regular string in a string template? "STR_EX :{COMPANY}, {STRING}", for example. I assumed that "GSText(GSText.STR_EX, company_id, 'something something);" would work, but apparently {STRING} expects a GSText object 🤔
13:18:19 <xarick> oh, I need to be in company mode to terraform?
13:19:15 <pickpacket> _glx_: "Use in english.txt only; in other language files use {STRING} instead."
13:20:19 <_glx_> yes, master file is english.txt and use the full commands `{RAW_STRING}`, `{STRING1}`, ...
13:20:35 <_glx_> translations just need `{STRING}`
13:21:06 <_glx_> only master file matters for GSText
13:21:31 <pickpacket> a GS can't have translations?
13:21:59 <pickpacket> so how does {STRING} work, then?
13:22:04 <_glx_> and they will use {STRING}, all validation is based on master string
13:22:39 <_glx_> it's the same for openttd strings
13:24:35 <pickpacket> I don't understand... if my english.txt says "STR_EX :{RAW_STRING}" would my other-lang.txt say "STR_EX :{STRING}" and that would work?
13:24:53 <_glx_> STR_NEWS_INDUSTRY_CLOSURE_GENERAL :{BIG_FONT}{BLACK}{STRING2} announces imminent closure!
13:24:53 <_glx_> STR_NEWS_INDUSTRY_CLOSURE_SUPPLY_PROBLEMS :{BIG_FONT}{BLACK}Supply problems cause {STRING2} to announce imminent closure!
13:24:53 <_glx_> STR_NEWS_INDUSTRY_CLOSURE_LACK_OF_TREES :{BIG_FONT}{BLACK}Lack of nearby trees causes {STRING2} to announce imminent closure!
13:25:07 <_glx_> STR_NEWS_INDUSTRY_CLOSURE_GENERAL :{BIG_FONT}{BLACK}{STRING} announces imminent closure!
13:25:07 <_glx_> STR_NEWS_INDUSTRY_CLOSURE_SUPPLY_PROBLEMS :{BIG_FONT}{BLACK}Supply problems cause {STRING} to announce imminent closure!
13:25:07 <_glx_> STR_NEWS_INDUSTRY_CLOSURE_LACK_OF_TREES :{BIG_FONT}{BLACK}Lack of nearby trees causes {STRING} to announce imminent closure!
13:29:16 <_glx_> eints doc is up-to-date about existing commands, but it lacks some info like number of params for each command
13:30:56 <_glx_> black book list has the details but misses a lot of commands
13:34:03 <boydsquirrel> pickpacket: just to see how big I could make the texture, thanks for your help
13:36:20 <xarick> i tried to level the whole map, but only a few tiles were changed
13:36:34 <xarick> yet it still says it returns true
13:37:35 <_glx_> it changes some, so it succeded
13:38:05 <peter1138[d]> There's a limit to leveling. You can't do that as a player either.
13:42:10 <xarick> but i'm in single player
13:45:42 <_glx_> it's per company, GS are unlimited (unless map has more than INT32_MAX tiles)
14:00:34 <andythenorth> (Didn’t compile it yet, afk)
14:01:39 <xarick> terraform_per_64k_frames
14:30:46 <peter1138[d]> Oh yeah, I got rid of that file.
14:38:14 <xarick> but for a good reason, so nvm
14:51:58 *** Wormnest has joined #openttd
15:10:57 <andythenorth> maybe this time I'll save my game before quitting to build a PR 😛
15:15:54 <xarick> I just watched someone map hacking in hots
15:18:01 <xarick> that red guy with the name "Player", watch him cast spells against the blue guy named "Player" without vision
15:18:25 <xarick> what a proud level 999 map hacker
15:21:12 <peter1138[d]> andythenorth: Consistency in coke.
15:21:37 <peter1138[d]> Okay, town "production" seems a bit... when it's passengers.
15:22:34 <peter1138[d]> Depends how it's
15:22:39 <peter1138[d]> transported? Dunno.
15:24:10 <peter1138[d]> I doubt it's a bug.
15:24:57 <xarick> make toyland have different industry rules/callbacks etc
15:26:27 <andythenorth> the ships are 360t and it's averaging at 360t
15:29:02 <peter1138[d]> Titles should be changed 🙂
15:29:07 <peter1138[d]> "Cargo history" probably.
15:44:05 <xarick> if the list is empty to begin with, could it perhaps not check HasItem, since it's coming from AddRectangle
15:53:52 *** gelignite has joined #openttd
15:54:13 <peter1138[d]> How about just not adding the whole map?
15:56:34 <peter1138[d]> If it was just a vector, it would be 128MB just for the indexes.
15:57:07 <andythenorth> I once cached the whole map in GS
15:57:16 <andythenorth> it was 'exciting'
15:57:54 <andythenorth> not as bad as it should be
15:58:07 <peter1138[d]> Xarick already discovered that making a list of tiles in native code is a terrible idea.
15:58:22 <peter1138[d]> So why they are trying to do it in scripts... no idea.
15:58:41 <andythenorth> we all have to have a hobby I guess
15:58:50 <andythenorth> mine is adding variants to Horse, then deleting them
16:00:12 <_jgr_> ScriptList and derived classes should probably be more proactive about charge script opcodes for doing daft/expensive operations
16:08:14 <andythenorth> maybe we should sell more opcodes as DLC
16:19:11 *** WormnestAndroid has quit IRC (Ping timeout: 480 seconds)
16:19:53 *** WormnestAndroid has joined #openttd
16:19:54 *** Wormnest has quit IRC (Ping timeout: 480 seconds)
16:23:20 <_zephyris> The faces PR looks good... Not exactly qualified to review the code, but functionality looks good.
16:23:34 <_zephyris> I'll do a build and try to break things 😉
17:19:39 <peter1138[d]> Hmm, population and number of houses don't chart well.
17:19:51 <peter1138[d]> Not to mention the cargo list can't hold non-cargo entries.
17:25:04 <xarick> then I'd do this to all other list generators, perhaps
17:31:11 *** Wormnest has joined #openttd
17:31:12 *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
17:31:22 *** WormnestAndroid has joined #openttd
17:35:24 <peter1138[d]> Not all that useful 😮
17:35:34 <_glx_> you won't gain much I think
17:55:40 *** ipravd_ has joined #openttd
18:00:07 <andythenorth> town cargo stuff exposed to GS you say? 👀
18:00:23 <peter1138[d]> How, and what purpose?
18:00:32 <andythenorth> dunno, let me look
18:01:02 <andythenorth> I have multiple cargo monitors running I think
18:01:12 *** Wormnest_ has joined #openttd
18:01:29 *** Wormnest has quit IRC (Read error: Connection reset by peer)
18:01:31 *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
18:02:08 <andythenorth> I should read if I kept a timeseries or not
18:02:13 <andythenorth> but....cooking RN
18:04:40 *** WormnestAndroid has joined #openttd
18:16:43 <peter1138[d]> Heh, I never titled it.
18:48:42 <xarick> owww there's so many Script Lists...
18:50:56 *** gelignite has quit IRC (Read error: Connection reset by peer)
18:51:40 *** gelignite has joined #openttd
18:52:30 <_zephyris> I hope that's useful feedback!
19:14:04 <peter1138[d]> Relevance issues detected.
19:14:43 <peter1138[d]> (Worrying about the wording of the label on button that isn't changed by the PR is out-of-scope)
19:21:02 <pickpacket> how much in the red do you have to be to go bankrupt in the latest build?
19:22:05 <peter1138[d]> In single player, never.
19:23:59 <pickpacket> I'm running a multiplayer server with only one connected client, but three companies that I switch between
19:41:46 <pickpacket> The "connected client" is the server player. Sorry.
19:46:19 <_glx_> not much IIRC, just red for long enough
19:48:00 <peter1138[d]> 3 months of being in the red.
19:50:06 <peter1138[d]> Oh, 3 months for a warning 🙂
19:50:15 <peter1138[d]> Offered for sale after 6 months.
19:50:51 <peter1138[d]> Bankrupt after 6 months (if it has no value) or 9 months if it was offered for sale.
19:53:20 <peter1138[d]> Fixed the width when in simple mode.
19:53:46 <peter1138[d]> Tried masking instead of hiding inactive layers, but I'm not convinced.
20:02:51 <xarick> i mean tested only one
20:04:07 <xarick> oh, regression failed? wow why
20:05:22 <xarick> Your script made an error: wrong number of parameters
20:06:34 <xarick> why isn't this thing smart
20:49:09 *** ipravd_ has quit IRC (Ping timeout: 480 seconds)
20:52:24 <xarick> regression tests passed
21:21:54 *** keikoz has quit IRC (Ping timeout: 480 seconds)
21:29:11 <xarick> what would happen if an item is added again?
21:33:11 <xarick> oops, this error again
21:33:57 <xarick> I thought it was fixed
21:38:40 <xarick> oh, I think AIAI made a mistake
21:39:04 <_glx_> oh wrong event type, so conversion returns null
21:39:26 <xarick> ScriptEventCompanyBankrupt, but he used CompanyInTrouble
21:40:05 <_glx_> yes, and Convert() returns null
21:41:15 <_glx_> it used to work, but now the conversion is strict
21:44:32 <xarick> i changed 24+ lists to use this AddItemUnsafe
21:45:43 <xarick> 24 + those covered by FillList
21:47:08 <_glx_> haha and all these to gain 1s on something that will still take more than 5s ?
21:50:15 <xarick> every tiny bit helps imo
21:50:31 <_glx_> would be easier to put SQOpsLimiter
21:50:40 <_glx_> and kill script doing silly things
22:01:01 *** ChanServ sets mode: +v tokai
22:08:01 *** tokai|noir has quit IRC (Ping timeout: 480 seconds)
22:41:45 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
22:58:01 *** ipravd_ has joined #openttd
continue to next day ⏵