Looking around, I've seen several requests for various ways to influence train speeds. The one I want is pretty simple, and was already added to cars because of an interface request. viewtopic.php?f=65&t=3637
I want to be able to apply this to rolling stock at runtime. All rolling stock already has the friction/friction_force entry in their prototype, just like the car does.
friction_modifier :: Read|Write float
Multiplies the car friction rate.
Can only be used if this is Car
Example
-- This will allow the car to go much faster
game.player.vehicle.friction_modifier = 0.5
The thing I want to use this for is cargo-based acceleration. I could compare the weight of the empty train to it's cargo, and then increase this resistance by the ratio to get my desired effect, in a way that doesn't require on_tick lua scripting.
Allow setting friction_modifier on rolling stock on control stage, not just cars.
Re: Allow setting friction_modifier on rolling stock on control stage, not just cars.
for cargo based acceleration you'd want to manipulate weight(currently impossible)
even on_tick mods have a huge issue with the braking force multiplier (which is only possible per force)
that friction approach would make your trains slow down as if they were braking all the time, which is not how loaded trains work, they usually maintain momentum pretty well because rails just have almost no friction.
i guess you could generate a hundred variations of each train or wagon and replace them dynamically... that would make it less on-ticky but comes with a nightmare of other mod compatibility (for example if a mod adds wagon shields or electric locomotives, so wagons are probably the safer approach) and maybe the cargo (door closing) animation would look weird
even on_tick mods have a huge issue with the braking force multiplier (which is only possible per force)
that friction approach would make your trains slow down as if they were braking all the time, which is not how loaded trains work, they usually maintain momentum pretty well because rails just have almost no friction.
i guess you could generate a hundred variations of each train or wagon and replace them dynamically... that would make it less on-ticky but comes with a nightmare of other mod compatibility (for example if a mod adds wagon shields or electric locomotives, so wagons are probably the safer approach) and maybe the cargo (door closing) animation would look weird
creator of 55 mods
My api requests/suggestions: ui relative for overlay||Grenade arc||Player Modifiers||textbox::selection||Singleplayer RCON||disable car's ground sounds
My api requests/suggestions: ui relative for overlay||Grenade arc||Player Modifiers||textbox::selection||Singleplayer RCON||disable car's ground sounds
Re: Allow setting friction_modifier on rolling stock on control stage, not just cars.
Would a sticker work?
Re: Allow setting friction_modifier on rolling stock on control stage, not just cars.
That friction approach would allow me to set it when they change state (and checking every few ticks until they're at max speed to undo it), rather than requiring on_tick all the time to constantly look at all trains.ownlyme wrote: ↑Fri Jan 10, 2025 12:55 am for cargo based acceleration you'd want to manipulate weight(currently impossible)
even on_tick mods have a huge issue with the braking force multiplier (which is only possible per force)
that friction approach would make your trains slow down as if they were braking all the time, which is not how loaded trains work, they usually maintain momentum pretty well because rails just have almost no friction.
i guess you could generate a hundred variations of each train or wagon and replace them dynamically... that would make it less on-ticky but comes with a nightmare of other mod compatibility (for example if a mod adds wagon shields or electric locomotives, so wagons are probably the safer approach) and maybe the cargo (door closing) animation would look weird
*And* it would mean everything about the train speed is handled by the engine, so I don't get any weirdness with having to calculate their speed in script and set it every tick, and all the effects that brings.
And all I need is the functionality of something they've already expanded before. I know there would obviously be better additions to the API to do what I want, but I picked this one because I think it's actually likely to be implemented. They have refused control stage changing of train weight multiple times. AFAICT, they have never refused this (Because nobody has asked for it)
Re: Allow setting friction_modifier on rolling stock on control stage, not just cars.
I also have a backup idea if this doesn't happen. If I do have to use it, hopefully I can horrify someone with it
Re: Allow setting friction_modifier on rolling stock on control stage, not just cars.
You assume it will reach maximum speed.
Except you'd still have to check frequently to undo it. While with a weight (or at least acceleration) modifier the engine will handle it in truth. Any of those two modifiers is as likely to be added as the one for friction and also haven't been refused.JamesFire wrote: ↑Fri Jan 10, 2025 11:37 am *And* it would mean everything about the train speed is handled by the engine, so I don't get any weirdness with having to calculate their speed in script and set it every tick, and all the effects that brings.
And all I need is the functionality of something they've already expanded before. I know there would obviously be better additions to the API to do what I want, but I picked this one because I think it's actually likely to be implemented. They have refused control stage changing of train weight multiple times. AFAICT, they have never refused this (Because nobody has asked for it)
Re: Allow setting friction_modifier on rolling stock on control stage, not just cars.
If it doesn't reach max speed, then there's no issue. Unsetting my modification when they start braking takes full care of that.
Weight *absolutely* has been refused before. viewtopic.php?f=221&t=85133&p=494911&hi ... ht#p494911
I literally searched for this before making this request.
I'm not here to argue about whether there's a better implementation to get what I want, because I *know* there is. I'm also not here to be told the shortcomings of what I want to do with this. I'm to make this request *that has been done before* because I think I can make use of it to get what I want, better than the way I would currently have to implement it.
Weight *absolutely* has been refused before. viewtopic.php?f=221&t=85133&p=494911&hi ... ht#p494911
I literally searched for this before making this request.
I'm not here to argue about whether there's a better implementation to get what I want, because I *know* there is. I'm also not here to be told the shortcomings of what I want to do with this. I'm to make this request *that has been done before* because I think I can make use of it to get what I want, better than the way I would currently have to implement it.
Re: Allow setting friction_modifier on rolling stock on control stage, not just cars.
Except the train starts braking with the old friction in mind. It can't stop in time and either passes the station or stops abruptly and unnaturally.
And I literally searched for all of those properties before making that post.JamesFire wrote: ↑Sun Jan 12, 2025 8:20 pm Weight *absolutely* has been refused before. viewtopic.php?f=221&t=85133&p=494911&hi ... ht#p494911
I literally searched for this before making this request.
If you are going to bring up that malformed request, it also mentions friction. So changing friction has been already refused, by your criterion.
Re: Allow setting friction_modifier on rolling stock on control stage, not just cars.
https://mods.factorio.com/mod/Overloade ... /downloads
done. on_tick-less train weight.
will soon get merged on OverloadedTrains11
friction would be a terrible idea for your usecase, it's not even up for debate.
friction would allow your trains to brake even faster, which makes no sense if you wanna simulate weight
i'm not saying that i don't want runtime-manipulable friction, maybe there would be another usecase for it: like simulating a broken tire, tire equipment that is specialized for road/offroad or other terrain stuff
but thanks for motivating me to make this update
done. on_tick-less train weight.
will soon get merged on OverloadedTrains11
friction would be a terrible idea for your usecase, it's not even up for debate.
friction would allow your trains to brake even faster, which makes no sense if you wanna simulate weight
i'm not saying that i don't want runtime-manipulable friction, maybe there would be another usecase for it: like simulating a broken tire, tire equipment that is specialized for road/offroad or other terrain stuff
but thanks for motivating me to make this update
creator of 55 mods
My api requests/suggestions: ui relative for overlay||Grenade arc||Player Modifiers||textbox::selection||Singleplayer RCON||disable car's ground sounds
My api requests/suggestions: ui relative for overlay||Grenade arc||Player Modifiers||textbox::selection||Singleplayer RCON||disable car's ground sounds