Get the station where the <ship> is docked at
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
Get the station where the <ship> is docked at
Hi,
Simple question : I'd like to get the $station where the playership is docked at, to retrieve its ID code. Is there a built-in function for that ? I can't find it...
Thanks.
Simple question : I'd like to get the $station where the playership is docked at, to retrieve its ID code. Is there a built-in function for that ? I can't find it...
Thanks.
if you spesifically want the player ship, then you can use
Both are acceptable, choose whichever you prefer - the second however has less instructions if the check were to fail, the first lets you use the environment in an else case if you want to do something if he is not docked, in this case the Environment would be the players sector. If you replace [PLAYERSHIP] with a argument for example $Ship, you can use the same code for any arbitrary ship passed to the script.
Code: Select all
$playerEnvironment = [PLAYERSHIP]->get environment
if $playerEnvironment->is of class {Station}
* We are docked at $playerEnvironment
end
or
if [PLAYERSHIP]->is docked
$playerEnvironment = [PLAYERSHIP]->get environment
end
[ external image ]
"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire
"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire