You can't do this check in <Globals> because it's likely not all types have been defined yet, but you can do it from a run-once event a-la:
Code: Select all
<StationType unid="&stWhatever;" virtual="True">
<Events>
<OnGlobalPlayerEnteredSystem>
(block nil
(if (not (typIncGlobalData &stWhatever; 'done 1)) (block nil
(setq myGlobalUnidList (filter myGlobalUnidList unid (typFind (cat "* +unid:" unid))))
))
)
</OnGlobalPlayerEnteredSystem>
</Events>
</StationType>
Filter works here without opening the returned list because of two things:
- A list with any items in it counts as a true value when given to something requiring a boolean input
- An empty list or nil, which are actually interchangeable, count as a false value when ....