What is the inventory define "player_vehicle" for?

Place to get help with not working mods / modding interface.
Post Reply
slindenau
Long Handed Inserter
Long Handed Inserter
Posts: 73
Joined: Fri Mar 25, 2016 1:46 pm
Contact:

What is the inventory define "player_vehicle" for?

Post 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)".
My mod: "Auto Deploy Destroyers" (follower robots) viewtopic.php?f=97&t=24545

User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2633
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

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

Post 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 2902 times
Greetings steinio
Image

Transport Belt Repair Man

View unread Posts

slindenau
Long Handed Inserter
Long Handed Inserter
Posts: 73
Joined: Fri Mar 25, 2016 1:46 pm
Contact:

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

Post by slindenau »

Right, but like i said, i tried to access this when in a vehicle, and nothing returned an inventory :)
My mod: "Auto Deploy Destroyers" (follower robots) viewtopic.php?f=97&t=24545

User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2633
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

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

Post 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
Image

Transport Belt Repair Man

View unread Posts

slindenau
Long Handed Inserter
Long Handed Inserter
Posts: 73
Joined: Fri Mar 25, 2016 1:46 pm
Contact:

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

Post by slindenau »

My mod: "Auto Deploy Destroyers" (follower robots) viewtopic.php?f=97&t=24545

MrDoomah
Fast Inserter
Fast Inserter
Posts: 196
Joined: Mon Jun 01, 2015 1:11 pm
Contact:

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

Post by MrDoomah »

Perhaps one of the devs can comment on this, since I'm also curious on that inventory it actually tries to access.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

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

Post 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.
If you want to get ahold of me I'm almost always on Discord.

slindenau
Long Handed Inserter
Long Handed Inserter
Posts: 73
Joined: Fri Mar 25, 2016 1:46 pm
Contact:

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

Post 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 ;).
My mod: "Auto Deploy Destroyers" (follower robots) viewtopic.php?f=97&t=24545

Post Reply

Return to “Modding help”