I have idea for a long time: use folks as "drivers" (only for view) or as passengers in AdvTrains-based vehicles. My question is: how much possible is it without complete rework of folks? Supports some about it actual Luanti core and AdvTrains or need it some changes?
It's possible to attach entities to Advtrains wagons, such as what is done with DlxTrains Cattle Van, but I think a fair bit of code is needed to make it possible to show the custom skins and models that Folks can use, and to make that load each time a wagon appears (Advtrains has code to destroy and re-create wagon entities when they disappear and re-appear inside player vision range, respectively). The Cattle Van also uses custom models.
It would need to be done as a cross-compatibility mod called something like folks4advtrains, where it would depend on both and then override wagon behaviour and add entities that look like Folks to wagons. You would also need a mechanism for actually attaching Folks to wagons, which could
(a) expose available wagon seats (and some wagons have no seats, so are not eligibile) to the player and let the player put the Folk in the seat. When done properly, no player should be able to sit in the same seat as the Folk - so maybe it would be better not to, or rather, you might need even more code to make sure that player drivers can kick out Folks into the passenger seats.
(b) Hardcode positions relative to the centre of the wagon entity for where a "Folk driver" will go, and leave the seats untouched (or copy the position, and let players overlap). Folks occupying passenger seats should usually not prove to be a problem, just make sure the train still has room for players (most passenger wagons have either 4 or 6 seats).
Hello,
I have idea for a long time: use folks as "drivers" (only for view) or as passengers in AdvTrains-based vehicles. My question is: how much possible is it without complete rework of folks? Supports some about it actual Luanti core and AdvTrains or need it some changes?
Regards, Matyáš Pilz / MatyasP
It's possible to attach entities to Advtrains wagons, such as what is done with DlxTrains Cattle Van, but I think a fair bit of code is needed to make it possible to show the custom skins and models that Folks can use, and to make that load each time a wagon appears (Advtrains has code to destroy and re-create wagon entities when they disappear and re-appear inside player vision range, respectively). The Cattle Van also uses custom models.
It would need to be done as a cross-compatibility mod called something like
folks4advtrains
, where it would depend on both and then override wagon behaviour and add entities that look like Folks to wagons. You would also need a mechanism for actually attaching Folks to wagons, which could(a) expose available wagon seats (and some wagons have no seats, so are not eligibile) to the player and let the player put the Folk in the seat. When done properly, no player should be able to sit in the same seat as the Folk - so maybe it would be better not to, or rather, you might need even more code to make sure that player drivers can kick out Folks into the passenger seats.
(b) Hardcode positions relative to the centre of the wagon entity for where a "Folk driver" will go, and leave the seats untouched (or copy the position, and let players overlap). Folks occupying passenger seats should usually not prove to be a problem, just make sure the train still has room for players (most passenger wagons have either 4 or 6 seats).