IRC logs for #openttd on OFTC at 2024-07-12
β΄ go to previous day
01:06:21 *** Alkel_U3 has quit IRC (Quit: maintenance)
01:07:14 *** Alkel_U3 has joined #openttd
02:42:49 *** D-HUND has quit IRC (Ping timeout: 480 seconds)
02:55:07 *** bryjen has quit IRC (Quit: Leaving)
04:42:45 <DorpsGek> - Update: Translations from eints (by translators)
08:13:33 <truebrain> I am re-routing some traffic over Cloudflare. This should go unnoticed by anyone, but just a heads-up I am making some configuration changes to openttd.org π
08:57:26 <truebrain> and now for some DNS rerouting ... "should be fiinnnneeee" π
09:01:10 <truebrain> meh, I need to redeploy the gamecoordinator for this. It uses a DNS entry I am changing. Owh well .. sorry TURN users π¦
09:15:34 *** SigHunter has joined #openttd
12:38:11 <truebrain> then .. I managed to kick out all our connectors from our AWS infra to Cloudflare
12:38:16 <truebrain> no clue how I did that, I have to admit
12:45:03 <truebrain> but everything should be back now π Nothing to see .... π
12:45:52 <yiffgirl> locosage: what's the bug called? i did a search and couldn't find it
13:04:28 *** gelignite has joined #openttd
13:25:19 *** Leopold_ has joined #openttd
13:27:22 <LordAro> ` --workaround-gcc296-bugs=no|yes self explanatory [no]. Deprecated.` new favourite command line option
14:58:28 *** Wormnest has joined #openttd
15:02:33 <_glx_> it's a number, scripts are meant to not care about exact meaning of type, but you can find the CargoID you want using GSCargoList and filtering with GSCargo functions
15:05:01 <pickpacket> so the cargo itself has an ID specific to the cargo of that vehicle?
15:05:41 <_glx_> it's specific to the whole game
15:06:23 <_glx_> in vanilla passengers should be 0 but never trust hardcoded values
15:10:08 <pickpacket> Maybe I'm just tired and confused, but given that I have a VehicleID I don't understand all the steps I would need to get the amount of passengers with GSVehicle.GetCargoLoad(vehicle_id, [SOME CargoID HERE]);
15:10:26 <pickpacket> is "CargoID" really a Cargo*Type*ID?
15:13:15 <pickpacket> I don't know if that's how you access an enum in a public class, or if it's that enum I want :P
15:14:23 <LordAro> no, that's a CargoClass :p
15:14:30 <LordAro> a CargoClass can have many CargoIDs
15:15:07 <pickpacket> ... but what is a CargoID then?
15:15:45 <pickpacket> and what does the CargoList contain?
15:16:53 <LordAro> CargoIDs, as far as I can tell
15:17:42 <pickpacket> and CargoID is *not* an ID for the specific type of cargo? I.e. "Passengers" has one CargoID, "Coal" another, etc?
15:18:33 <LordAro> i don't understand the question
15:18:44 <LordAro> (or, the i.e. doesn't fit)
15:18:55 <pickpacket> Neither do I, that's the problem π
15:19:57 <LordAro> multiple cargoes may be members of the same class - i.e. passengers & tourists are cc_passengers
15:20:13 <pickpacket> Oh! Wait. I think I get it. A Cargo *class* is about which type of vehicles can take it, and Cargo *ID* is about the specific type of cargo
15:20:13 <LordAro> or gold & valuables are cc_armoured (?)
15:20:43 <pickpacket> I was completely fooled by CC_PASSENGERS there. I thought it was the same as the CargoID for passengers
15:21:01 <pickpacket> so soylent green would be...? ;)
15:21:36 <LordAro> GSEngine::GetCargoType is probably the way to go
15:22:00 <LordAro> though i have no idea how that works with refitting, or vehicles with multiple cargoes
15:22:09 <pickpacket> Not GSVehicle::GetCargoLoad?
15:22:42 <pickpacket> yeah, that's why I thought it would make more sense to get a number of units for a specific cargo type
15:22:44 <LordAro> that gives you a quantity, given an existing cargoid
15:23:02 <pickpacket> exactly. I don't know how to find the cargoid. Yet.
15:23:10 <pickpacket> cargoid for passengers, that is
15:23:25 <LordAro> i'm struggling to find anything except GSEngine::GetCargoType
15:25:40 <LordAro> iterating over GSCargoList and checking might be the only other way
15:25:45 <LordAro> which does seem suboptimal
15:26:02 <LordAro> there's the other GSCargoList_* objects as well, of course
15:26:10 <LordAro> but that's just for station & industries
15:27:08 <pickpacket> yeah... I believe GSEngine::GetCargoType could be hard for, say, a train with several different types of cargo
15:29:13 <LordAro> i can't remember if wagons are treated as separate (non-primary) vehicles
15:29:29 <LordAro> it's been 10 years since i did any AI stuff, and i never touched trains when i did :D
15:29:41 <pickpacket> Iterating through CargoList as the game initiates and saving the cargoID could work. Except I have no idea how CargoList works. It's a list of key/value pairs where key is an int and value is another int. Which is what? How do I know that I've found a cargoID for passengers?
15:30:26 <LordAro> GSCargo::HasCargoClass(id, CC_PASSENGERS)
15:30:47 <LordAro> and hope ECS vectors isn't loaded and you get tourists first :p
15:31:01 <LordAro> ah, there's GetTownEffect for that
15:31:20 <LordAro> actually, that's probably better than HasCargoClass
15:31:54 <LordAro> that'll give you a cargo that definitely has the effect you're presumably after
15:32:32 <pickpacket> ugh... this is getting complicated since many different cargos can be passengers. I want to figure out the death toll in a vehicle crash
15:35:05 <LordAro> i'm pretty sure there's a random component to that
15:35:15 <LordAro> so if it's not in the event data...
15:37:46 <LordAro> i could be wrong about that though
15:39:25 <pickpacket> It's not. At least not that I've seen. A vehicle has a number of drivers/operators depending on type, and then an amount of passengers if it takes any
15:39:59 <pickpacket> a non-passenger train will always have two dead in a crash, for example. A train carrying 27 passengers will have 29 dead
15:39:59 <LordAro> yeah, source code seems to confirm
15:42:43 <pickpacket> it's a little ambiguous whether a GSVehicle is the whole thing or if each wagon on a train is a GSVehicle of its own
15:43:56 <LordAro> i'm pretty sure it's each part
15:44:09 <LordAro> (e.g. articulated road vehicles too)
15:44:16 <pickpacket> could be π€· I guess I'll have to test
15:44:17 <LordAro> who knows how it handles aircraft
15:44:49 <LordAro> (where the shadow is a second vehicle, and helicopter rotors are a third)
15:46:41 <pickpacket> how come helicopter rotors are their own vehicle?
15:48:08 <LordAro> probably something to do with the animation
15:48:18 <LordAro> or how they appear in the purchase windows
15:54:20 <pickpacket> Okay. I have an idea.
15:56:46 <pickpacket> When I initiate the GS I loop through the CargoList and for each cargoID I get (assuming that's what I get; I still have no idea what the keys or values are other than int) I can check with GSCargo::HasCargoClass whether it's CC_PASSENGERS. If it is I save the CargoID in a list and for each crash I check the vehicle in question for the amount of
15:56:46 <pickpacket> each of those cargoes
15:58:24 <pickpacket> it appears that a call to GSVehicle::GetCargoLoad gives me the total number in the whole vehicle, including wagons
15:58:30 <pickpacket> that makes it easier, at least
15:59:48 <pickpacket> Anyways, going out for a bike ride
16:00:33 <LordAro> peter1138: bit of an easier day today?
16:03:26 <_glx_> local cargo_list = GSCargoList();
16:03:26 <_glx_> cargo_list.Valuate(GSCargo.HasCargoClass, CC_PASSENGER);
16:03:26 <_glx_> cargo_list.KeepValue(1);
16:03:43 <_glx_> should give you all CC_PASSENGER cargoes
16:05:01 <pickpacket> Oh! That'd be awesome!
16:05:51 <pickpacket> I have a feeling the enum is written as GSCargo.CargoClass.CC_PASSENGER but I'll have to test that
16:06:35 <_glx_> most likely GSCargo.CC_PASSENGERS
16:07:49 <peter1138> Now that we're on our way, yeah. Still bumpy.
16:29:35 <audigex> pickpacket: I always figure itβs driver of vehicle 1 + driver of vehicle 2 + passengers
16:29:35 <audigex> But then it assumes no other crew on either unit
16:38:07 *** Smedles has joined #openttd
16:48:29 *** merni has quit IRC (Quit: User went offline on Discord a while ago)
16:50:49 <pickpacket> audigex: I think I'll end up checking the source to make sure I get it right
16:54:42 *** soylent_cow[m] has joined #openttd
16:59:19 <_glx_> could be simpler to add the info to the event
17:05:01 <_glx_> as the number is already known when the event is created
17:26:06 *** gelignite has quit IRC (Quit: Stay safe!)
17:41:22 <pickpacket> _glx_: you mean make a PR to add it to the event in the GS api?
17:51:47 *** HerzogDeXtEr has joined #openttd
18:20:46 <pickpacket> audigex: some vehicles have more than one driver
18:35:15 *** gelignite has joined #openttd
18:55:09 *** Wolf01 is now known as Guest1299
19:01:38 *** Guest1299 has quit IRC (Ping timeout: 480 seconds)
20:00:47 <pickpacket> _glx_: Adding it to the event was my first idea, but from a philosophical point of view I don't know if it really belongs there
20:01:18 <pickpacket> if victims belong there, why not other cargoes?
20:01:50 <_glx_> only victims are in the news, event would match the news
20:02:52 <pickpacket> I mean, adding it to the event would make my GS *a lot* simpler to write :D
20:05:31 <pickpacket> _glx_: I haven't looked at the full code, but I don't think the "pass" variable is the full number of victimes
20:06:11 <_glx_> it's the number returned by Vehicle::Crash, and it's the one shown in news
20:06:41 <pickpacket> I believe this is the one in the news: StringID newsitem = (pass == 1) ? STR_NEWS_ROAD_VEHICLE_CRASH_DRIVER : STR_NEWS_ROAD_VEHICLE_CRASH;
20:08:18 <_glx_> if one it uses `{BIG_FONT}{BLACK}Road Vehicle Crash!{}Driver dies in fireball after collision with train` else `{BIG_FONT}{BLACK}Road Vehicle Crash!{}{COMMA} die in fireball after collision with train`
20:08:43 <_glx_> and {COMMA} is SetDParam(0, pass)
20:10:04 <_glx_> but pass is the number of victims
20:15:33 <peter1138> LordAro, an easier day, but legs are still aware of the loaded touring bike. Still, no mammoth rides until I decide how to get back home.
20:17:13 <pickpacket> _glx_: I'm going to have a closer look at it in a few days, and test a bit if I can :) I would love to have this merged. Not that I have any power to affect it :D
20:17:27 <peter1138> And now it's raining , hope this tent is watertight.
20:24:40 <andythenorth> peter1138: I camped in my van last week, that was watertight
20:24:48 <andythenorth> can't pack it on a bike though
21:08:49 *** nielsm has quit IRC (Ping timeout: 480 seconds)
21:26:48 *** keikoz has quit IRC (Ping timeout: 480 seconds)
21:43:51 *** tokai|noir has joined #openttd
21:43:51 *** ChanServ sets mode: +v tokai|noir
21:50:41 *** tokai has quit IRC (Ping timeout: 480 seconds)
22:19:39 *** Flygon has quit IRC (Quit: A toaster's basically a soldering iron designed to toast bread)
22:40:29 *** HerzogDeXtEr has quit IRC (Read error: Connection reset by peer)
23:02:46 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
continue to next day β΅