Rocket silo: allow landing rockets
Posted: Sat Nov 13, 2021 3:45 pm
After a rocket launch space science packs magically appear in the silo. I want to have the option to have rockets return from space and unload their inventory instead. With this it should be possible to use rocket silos and rockets similar to trains to send goods into space and have the rocket land on another rocket silo. Or just go into space, retrieve samples (modify rocket inventory) and land back on the originating silo to return the samples.
It would be up to mods to change the rocket inventory after launch and land the rocket or direct it to a different silo, possibly on another surface. The request here is just for an interface to trigger the graphics sequences and a bit more information of the state of the silo.
land_rocket(rocket) -> bool
Parameters
rocket : LuaEntity (RocketSiloRocket) -- Rocket to land on silo or nil
Returns true if the rocket silo is empty and will have the rocket landing.
Closes silo doors and goes into closed/building state if rocket is nil.
Effects:
Play the rocket launch sequence in reverse. Optional: have separate landing animation.
Events:
on_rocket_landing_ordered -- analog to on_rocket_launch_ordered
on_rocket_landed -- analog to on_rocket_launched
lower_rocket() -> bool
Returns true if the silo has a rocket on the launch pad and will lower it. Returns false if no rocket is on the launch pad or there isn't enough space in the rocket silos output inventory.
Effects:
Lowers the rocket into the silo and closes the doors (just the opening sequence in reverse). The rockets inventory is transferred to the silos output inventory after the doors have closed.
Events:
on_rocket_lower_ordered -- fires when a rocket starts to sink into the silo
on_rocket_lowered -- fires when the rocket is lowered and the doors are closed
Returns true if the silo is closed and has a rocket.
Events:
on_rocket_rising_ordered -- fires when a rocket silo has build a rocket and starts to open the doors
on_rocket_risen -- fires when the rocket is risen
Effects:
Open doors and rise rocket.
build_rocket() -> bool
Start building a new rocket. Returns true if silo enters building state. Returns false if opening, opened, launching, landing, landed, closing.
wait_for_landing :: boolean [RW] -- Whether this rocket silo gives science after launch or waits for landing
auto_build :: boolean [RW] -- Whether this rocket silo goes into building or empty state after launch (or after landing if wait_for_landing)
auto_lower :: boolean [RW] -- Whether this rocket silo automatically lowers landed rockets
auto_rise :: boolean [RW] -- Whether this rocket silo automatically rises rockets
rocketsilo_status :: SiloStatus [R] -- Current status of the silo
SiloStatus:
building -- waiting for rocket parts to build the rocket
opening -- opening doors and rising rocket
opened -- rocket it sitting on the launch pad before launch
launching -- rocket is launching
launched -- waiting for a rocket to land
landing -- rocket is landing
landed -- rocket is sitting on the launch pad before lowering
closing -- lowering rocket and closing doors
closed -- closed silo but not building a new rocket
It would be up to mods to change the rocket inventory after launch and land the rocket or direct it to a different silo, possibly on another surface. The request here is just for an interface to trigger the graphics sequences and a bit more information of the state of the silo.
Rocket landing
It would be nice to have a rocket land on a rocket silo on command:land_rocket(rocket) -> bool
Parameters
rocket : LuaEntity (RocketSiloRocket) -- Rocket to land on silo or nil
Returns true if the rocket silo is empty and will have the rocket landing.
Closes silo doors and goes into closed/building state if rocket is nil.
Effects:
Play the rocket launch sequence in reverse. Optional: have separate landing animation.
Events:
on_rocket_landing_ordered -- analog to on_rocket_launch_ordered
on_rocket_landed -- analog to on_rocket_launched
Lower rocket
It would be nice to have a rocket be lowered back into the silo and the doors closed on command:lower_rocket() -> bool
Returns true if the silo has a rocket on the launch pad and will lower it. Returns false if no rocket is on the launch pad or there isn't enough space in the rocket silos output inventory.
Effects:
Lowers the rocket into the silo and closes the doors (just the opening sequence in reverse). The rockets inventory is transferred to the silos output inventory after the doors have closed.
Events:
on_rocket_lower_ordered -- fires when a rocket starts to sink into the silo
on_rocket_lowered -- fires when the rocket is lowered and the doors are closed
Opening silo
rise_rocket() -> boolReturns true if the silo is closed and has a rocket.
Events:
on_rocket_rising_ordered -- fires when a rocket silo has build a rocket and starts to open the doors
on_rocket_risen -- fires when the rocket is risen
Effects:
Open doors and rise rocket.
Building rockets
If the rocket silo has auto_build == false (see below) there should still be an option to go into building mode:build_rocket() -> bool
Start building a new rocket. Returns true if silo enters building state. Returns false if opening, opened, launching, landing, landed, closing.
Rocket silo status and new options
rocket :: LuaEntity (RocketSiloRocket) [RW] -- Rocket that is launching/landing/standing on/in this silo or nil.wait_for_landing :: boolean [RW] -- Whether this rocket silo gives science after launch or waits for landing
auto_build :: boolean [RW] -- Whether this rocket silo goes into building or empty state after launch (or after landing if wait_for_landing)
auto_lower :: boolean [RW] -- Whether this rocket silo automatically lowers landed rockets
auto_rise :: boolean [RW] -- Whether this rocket silo automatically rises rockets
rocketsilo_status :: SiloStatus [R] -- Current status of the silo
SiloStatus:
building -- waiting for rocket parts to build the rocket
opening -- opening doors and rising rocket
opened -- rocket it sitting on the launch pad before launch
launching -- rocket is launching
launched -- waiting for a rocket to land
landing -- rocket is landing
landed -- rocket is sitting on the launch pad before lowering
closing -- lowering rocket and closing doors
closed -- closed silo but not building a new rocket