I've written a bit of code where the player ship docks and receives new orders, the helm station can then press a key to "warp" to a new location.
However, I wanted, for a laugh, to put in a bit of script where if helm pressed the key while still docked, you get a fail sound and a note that the "Parking brake" is still on.
This is fine for when you ARE docked:
<event>
<if_client_key keyText="L" />
<if_docked name="Deep Space 9" />
<if_variable name="ReadytoWarp" comparator="EQUALS" value="1.0" />
<play_sound_now filename="TranswarpFail.wav" />
<warning_popup_message message="Ship is docked! External inertial dampner is set. Undock before going to warp" consoles="HE" />
</event>
But in the code to go to warp successfully, both the criteria are still met, even if you are actually docked!
<event>
<if_client_key keyText="L" />
<if_variable name="ReadytoWarp" comparator="EQUALS" value="1.0" />
<end_getting_keypresses_from consoles="H" />
<play_sound_now filename="LeaveSystem.wav" />
<set_timer name="WarpOut1" seconds="6" />
<set_variable name="ReadytoWarp" value="2.0" />
</event>
Is there a command for "Player is not docked"?
"We should give him the send-off he deserves. He died saving us all. Prepare a Rocket-Shed for immediate launch."