Entity.current_fuel_type

Xyfi
Inserter
Inserter
Posts: 40
Joined: Tue May 20, 2014 7:10 am
Contact:

Entity.current_fuel_type

Post 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
Last edited by Xyfi on Sat Aug 01, 2015 10:45 am, edited 3 times in total.
User avatar
cpy
Filter Inserter
Filter Inserter
Posts: 839
Joined: Thu Jul 31, 2014 5:34 am
Contact:

Re: Event .on_player_entered_vehicle & Entity.current_fuel_type

Post 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.
Xyfi
Inserter
Inserter
Posts: 40
Joined: Tue May 20, 2014 7:10 am
Contact:

Re: Event .on_player_entered_vehicle & Entity.current_fuel_type

Post 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.
Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: Event .on_player_entered_vehicle & Entity.current_fuel_type

Post 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
Last edited by Choumiko on Fri Jul 31, 2015 10:39 pm, edited 1 time in total.
Xyfi
Inserter
Inserter
Posts: 40
Joined: Tue May 20, 2014 7:10 am
Contact:

Re: Event .on_player_entered_vehicle & Entity.current_fuel_type

Post 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.
Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: Entity.current_fuel_type

Post by Choumiko »

Seems only valid for cars/tanks, sadly not for locomotives
Xyfi
Inserter
Inserter
Posts: 40
Joined: Tue May 20, 2014 7:10 am
Contact:

Re: Entity.current_fuel_type

Post 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?
Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: Entity.current_fuel_type

Post 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?
Post Reply

Return to “Implemented mod requests”