Page 1 of 1

Rocket Silo: Is rocket ready?

Posted: Sat Mar 12, 2016 5:58 pm
by NearlyDutch
Is there a way to check if the rocket inside a rocket silo is ready?

This gives 0 after the 100th rocket part is constructed and the rocket is ready to launch:

Code: Select all

entity.rocket_parts
And checking for a satellite in the silo is not the desired information, as there is a state inbetween, where the rocket is constructed and ready too launch, but a satellite isn't put into its inventory yet.

Re: Rocket Silo: Is rocket ready?

Posted: Mon Mar 14, 2016 12:24 pm
by NearlyDutch
Okay I found a way. For anybody looking for a solution now or in the future:

Code: Select all

if silo.get_item_count("satellite") == 1 then
    -- rocket ready with loaded inventory (ready to launch)
elseif silo.can_insert({name = "satellite", count = 1}) then
    -- rocket ready but not loaded
else
    -- rocket not ready
end