Page 1 of 1

[2.0.20][scripting] Rocket silo get_output_inventory returns the modules inventory

Posted: Thu Nov 21, 2024 10:46 pm
by caiotoon
I was trying to get a count of the number of rockets ready in the Rocket Silo and found out that `get_output_inventory` on a rocket silo seems to return the modules inventory instead.

Steps to reproduce:
1. create a rocket silo
2. add modules to the silo
3. mouse hover the silo
4. run the following script

Code: Select all

game.player.print(game.player.selected.get_output_inventory()[1])
Expected:
Either return the count of rockets ready to launch or `nil` (in this case fail as I'm trying to access an item on a `nil` array)

Actual:
Got the modules array, as verified in console output

Code: Select all

[LuaItemStack: 4x {speed-module-3, normal}]

Re: [2.0.20][scripting] Rocket silo get_output_inventory returns the modules inventory

Posted: Thu Nov 21, 2024 10:53 pm
by boskid
Are you 100% sure this is modules inventory? having 4 modules in a single ItemStack sounds quite suspicious for a modules inventory.

Anyway, i have this:
122437.png
122437.png (100.56 KiB) Viewed 344 times
and it gives reasonable values:
122437-2.png
122437-2.png (12.55 KiB) Viewed 344 times

Re: [2.0.20][scripting] Rocket silo get_output_inventory returns the modules inventory

Posted: Thu Nov 21, 2024 11:11 pm
by caiotoon
You are absolutely right. I accidentally ended up with the modules in the inventory and didn't see it.