Page 1 of 1

Entity.current_fuel_type

Posted: Fri Jul 31, 2015 11:36 am
by Xyfi
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

Re: Event .on_player_entered_vehicle & Entity.current_fuel_type

Posted: Fri Jul 31, 2015 12:37 pm
by cpy
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.

Re: Event .on_player_entered_vehicle & Entity.current_fuel_type

Posted: Fri Jul 31, 2015 1:12 pm
by Xyfi
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.

Re: Event .on_player_entered_vehicle & Entity.current_fuel_type

Posted: Fri Jul 31, 2015 6:31 pm
by Choumiko
For on_player_entered see https://forums.factorio.com/forum/vie ... =10#p91784

I'd love being able to change acceleration, friction etc via control.lua

Re: Event .on_player_entered_vehicle & Entity.current_fuel_type

Posted: Fri Jul 31, 2015 8:18 pm
by cpy

Re: Event .on_player_entered_vehicle & Entity.current_fuel_type

Posted: Sat Aug 01, 2015 10:37 am
by Xyfi
Choumiko wrote:For on_player_entered see https://forums.factorio.com/forum/vie ... =10#p91784

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?