Config
Log for #openttd on 15th March 2023:
Times are UTC Toggle Colours
00:30:31  *** peter1138 has quit IRC
00:33:45  *** peter1138 has joined #openttd
00:33:45  *** ChanServ sets mode: +o peter1138
00:45:07  *** Wormnest has quit IRC
01:51:12  *** gelignite has quit IRC
02:01:24  *** debdog has joined #openttd
03:31:05  *** D-HUND has joined #openttd
03:34:26  *** debdog has quit IRC
14:00:22  *** Eddi|zuHause has joined #openttd
14:01:32  <glx[d]> but I can understand why it's done that way
14:03:05  <Xarick> i'm trying to create a class named Caches, and i'm trying to figure out if i want `class Caches extends LuDiAIAfterFix` or just `class Caches`. purpose is to have it store engine capacities, costs, if they can attach to each other, their length. I'd like to have it accessible accross the entire AI
14:03:40  <glx[d]> does it extends LuDI or is it independent ?
14:04:05  <Xarick> it's independent, I guess
14:04:37  <glx[d]> so you do class without extent, then you create an instance of it in LuDi
14:05:09  <glx[d]> or a global variable
14:05:17  <glx[d]> whichever fits
14:08:47  <glx[d]> classic example for extends, `class Coord2D { x = 0; y = 0; }` then `class Coord3D extends Coord2D { z = 0; }`
14:10:18  <glx[d]> missing constructors and any other possible functions, but you should get the idea
14:39:56  <Xarick> i have to convert everything that is a AIList into a {} equivalent
14:40:10  <Xarick> really wish AIList could be saved
14:41:19  <Xarick> create an instance of a class hmm
14:42:13  <Xarick> something similar to railBuildManager = RailBuildManager(); like i have in main.nut?
14:42:21  <Xarick> caces = Caches(); ?
14:42:42  <Xarick> caches*
14:43:40  <Xarick> then how do i access the caches from somewhere else from another class that isn't LuDiAIAfterFix?=
14:43:42  *** nielsm has joined #openttd
14:44:36  <Xarick> I do LuDiAIAfterFix.caches?
14:44:48  <Xarick> need to test
14:46:29  <Xarick> the way I do right now is Caches.GetLength(engine) for example
22:45:08  <dP> <https://github.com/OpenTTD/OpenTTD/blob/master/src/lang/english.txt#L531>
22:45:36  <dP> any better way to extend them than adding a hundred or two more strings? xD
22:46:51  <JGR> Drop the ordinal suffix and just use {NUM} instead?
22:48:17  <dP> it's somewhat better with the suffix imo
22:48:42  <dP> makes it clear that's rank
22:51:04  <glx[d]> Xarick: I confirm it doesn't work
22:51:20  <glx[d]> maybe a bug in `require`
22:51:21  <Xarick> 😦
22:57:38  <glx[d]> weird `getconsttable` is not found, but it should be a built-in function
22:58:51  <glx[d]> oh it's disabled
23:01:36  <Xarick> where is it?
23:03:42  <glx[d]> not important, I wanted to do some debug
23:13:17  <Xarick> how do I enable
23:13:27  <Xarick> or why was it disabled
23:17:24  <glx[d]> https://cdn.discordapp.com/attachments/1008473233844097104/1085703325632184360/image.png
23:17:24  <glx[d]> it won't help, I needed it for
23:18:38  <glx[d]> so const (enums) are passed to required, but not from required
23:18:44  <glx[d]> interesting

Powered by YARRSTE version: svn-trunk