Page 1 of 1

What is the inventory define "player_vehicle" for?

Posted: Wed Apr 27, 2016 5:58 pm
by slindenau
Simple question, which inventory is described by defines.inventory.player_vehicle (7).
http://lua-api.factorio.com/0.12.30/def ... #inventory

I tried getting this inventory on a player, character or a vehicle, and all return the error "... doesn't have an inventory with index(7)".

Re: What is the inventory define "player_vehicle" for?

Posted: Wed Apr 27, 2016 6:33 pm
by steinio
I guess its active if the character is in a vehicle.
There are only 2 slots in the down right bar, one with the vehicle and one with a tool.
inventory_player_vehicle.PNG
inventory_player_vehicle.PNG (26.78 KiB) Viewed 2973 times
Greetings steinio

Re: What is the inventory define "player_vehicle" for?

Posted: Wed Apr 27, 2016 6:52 pm
by slindenau
Right, but like i said, i tried to access this when in a vehicle, and nothing returned an inventory :)

Re: What is the inventory define "player_vehicle" for?

Posted: Wed Apr 27, 2016 6:56 pm
by steinio
Sorry read only the first sentence :D

If anyone is doing two things at the same time, only one half of each is done.

Did you specify an index/slot [1] ?
https://wiki.factorio.com/index.php?title=Lua/Inventory

Re: What is the inventory define "player_vehicle" for?

Posted: Wed Apr 27, 2016 7:01 pm
by slindenau

Re: What is the inventory define "player_vehicle" for?

Posted: Sun Sep 18, 2016 9:33 pm
by MrDoomah
Perhaps one of the devs can comment on this, since I'm also curious on that inventory it actually tries to access.

Re: What is the inventory define "player_vehicle" for?

Posted: Mon Sep 19, 2016 2:32 am
by Rseding91
It's actually only used internally when the character transfers from the vehicle they're in to their own inventory through shift click to prevent putting the items back into the vehicle ammo slots. It was included with the defines list because I setup all of the defines from everything that had defines without checking if they where actually useful to the scripts :)

Also what version are you running? I changed get_inventory() to return nil a while ago instead of giving an error.

Re: What is the inventory define "player_vehicle" for?

Posted: Mon Sep 19, 2016 10:04 am
by slindenau
This was a very old topic, i think this was in the period when we got from 0.12.x to 0.13.x

It's not relevant anymore for me, but thanks for clearing it up! Always nice to get some looks under the hood ;).