If playing with player.character=nil, quickbar and main inventory are swapped:
player.get_inventory(defines.inventory.player_quickbar) will give you the main inventory while
player.get_inventory(defines.inventory.player_main) will give you the quickbar.
Since I can't see any good reason for this behavior, I consider it a bug.
Quickbar confusion when playing without character
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: Quickbar confusion when playing without character
If it does work as you say, then I would say it is a bug.
Re: Quickbar confusion when playing without character
That's because without character your are in god mode, and therefore you should be using different constants
Personally, I think it is annoying and unnecessary behavior, but I can't foresee consequences of changing it and previously it was qualified as Not a bug by other developers, I am going to do the same.
Code: Select all
defines.inventory.god_quickbar
defines.inventory.god_main
Re: Quickbar confusion when playing without character
I still can't see why those constants are defined in the opposite way. You could just define them as the normal ones and everything should be fine.posila wrote:That's because without character your are in god mode, and therefore you should be using different constantsPersonally, I think it is annoying and unnecessary behavior, but I can't foresee consequences of changing it and previously it was qualified as Not a bug by other developers, I am going to do the same.Code: Select all
defines.inventory.god_quickbar defines.inventory.god_main
Re: Quickbar confusion when playing without character
Changing the inventory index order changes the order they're iterated when you do something like "insert" or "remove_item".
If you want to get ahold of me I'm almost always on Discord.
Re: Quickbar confusion when playing without character
That means you're not using the definitions in the code but iterate over numbers, how dare you!Rseding91 wrote:Changing the inventory index order changes the order they're iterated when you do something like "insert" or "remove_item".
Well, it's a minor issue, but annoying when I have to manually fix mods like autofill every time (I strongly prefer playing in RTS mode without a character, playing with a character is just too annoying and pointless to me).
Re: Quickbar confusion when playing without character
Mod(s) should really just use player.get_quickbar() and player.get_inventory() which does exactly what you'd want for character entities or the god controller.
If you want to get ahold of me I'm almost always on Discord.
Re: Quickbar confusion when playing without character
Didn't know these APIs, thanks for the hint, I will try to get the author of autofill to fix this!Rseding91 wrote:Mod(s) should really just use player.get_quickbar() and player.get_inventory() which does exactly what you'd want for character entities or the god controller.