This could be very handy for modders creating mods around cars and trains.
Being able to modify the vehicle's behaviour based on the type of fuel currently used instead of having to check the fuel inventory can be a great addition to the modding interface.
The current_fuel_type could be nil if the car or train is out of fuel.
Current_fuel_type could also be used for all entities that use fuel of course.
Already Available
Event.player_entered_ vehicle (as pointed out by Choumiko, link)
Being able to track the player entering a vehicle can also open up a whole new world of possibilities. Maybe giving server-admins indestructible cars or something, with the new dedicated servers in mind. Of course this can be achieved in other ways, but they won't be near as pretty as a event.
cpy wrote:And maybe having API for dedicated fuel slot that actives with key? Like nitrous boost!
Extra fuel slot would start to use fuel from that slot and modify effectivity_Modifier and consumption_Modifier when you press some key.
So event.on_key_pressed already exists or not? That would be nice to know, and i'm way too new in factorio modding.
event.on_key_pressed does not exists, but I'm sure they are looking into it. For this kind of information you should always check the wiki. You could use a gui button to issue a command though. Check the blueprint-string mod for a example of a implemented gui.
I'd love being able to change acceleration, friction etc via control.lua
You can. These variables are part of entity. And thanks for the info.
Re: Entity.current_fuel_type
Posted: Sat Aug 01, 2015 11:41 am
by Choumiko
Seems only valid for cars/tanks, sadly not for locomotives
Re: Entity.current_fuel_type
Posted: Sat Aug 01, 2015 11:47 am
by Xyfi
Choumiko wrote:Seems only valid for cars/tanks, sadly not for locomotives
There isn't a way to change the entities settings in entity.lua during the game right?
Re: Entity.current_fuel_type
Posted: Sat Aug 01, 2015 11:56 am
by Choumiko
if by entity.lua you mean the prototype, then no.
I guess it would be nice if cars and locomotives shared the same api concerning physics (effectivity, friction, etc.) Not sure why locomotives don't have it, maybe because a train can have multiple locomotives with possibly different values?