Don't get me wrong, the spawned station idea proved to be flexible and stable, this is another solution to it, and I like it for its simplicity.
The idea is to use an event handler on the playership :
Code: Select all
(block Nil
(objSetEventHandler gPLayership &evtest;)
(objFireEvent gPLayership "IMTESTEVENT")
)
Code: Select all
<ShipClass UNID="&evtest;"
class= "(test)"
virtual= "true"
>
<Events>
<IMTESTEVENT>
(dbglog "IT WORKS!!!!!!!!!!!!!!")
</IMTESTEVENT>
</Events>
</ShipClass>
This can work on the playership, or on any other spaceobject.
when the player installs an item
<OnInstall>
add the event handler and fire the recurring event
<OnUninstall>
stop the recurring event
What do you think ?