Code works, nothing happens

Freeform discussion about anything related to modding Transcendence.
Post Reply
Shaman
Commonwealth Pilot
Commonwealth Pilot
Posts: 95
Joined: Fri Sep 20, 2013 2:03 pm

I have a new idea, the code works but nothing happens. digdug and StarWeaver gave some code to me, but it's the same. I think I'm overlooking something.
I want to show a message after a timer has run out. For testing this timer is set to 1.
Even remove the timer and only leaving the message in the code didn't help.

Code: Select all

<?xml version="1.0" ?>
<!DOCTYPE TranscendenceExtension
[
   <!ENTITY unidExtension   "0xEE13002">
   <!ENTITY stcoderunner   "0xD518FF092">
]>
<TranscendenceExtension UNID="&unidExtension;" version="1.0" name="Random Missions" credits="Shaman">
 <StationType UNID="&stcoderunner;"
     
     virtual="true"
     >
     
     <Events>
       <OnGlobalSystemCreated>
         (sysAddObjTimerEvent 1 gSource "WE_KickStart")
       </OnGlobalSystemCreated>
        <WE_KickStart>
      (block Nil
 
             (plyMessage gPlayer "Success")
                
             )
         </WE_KickStart>
     </Events>
   </StationType>
</TranscendenceExtension>
This is the code digdug gave to me. I have a slightly different from StarWeaver. Thanks to both of them for their help.
george moromisato
Developer
Developer
Posts: 2989
Joined: Thu Jul 24, 2003 9:53 pm
Contact:

The main problem is that <OnGlobalSystemCreated> is a "global" event, which means it runs outside of the context of any particular object. Specifically, gSource will be Nil when it runs.

Try

Code: Select all

...
<Events>
...
<OnCreate>
   (sysAddObjTimerEvent 1 gSource "WE_KickStart")
</OnCreate>
</Events>
The above will register the timer event when the stcoderunner station is created.
Shaman
Commonwealth Pilot
Commonwealth Pilot
Posts: 95
Joined: Fri Sep 20, 2013 2:03 pm

No, still no message. I tried many events, like <OnGameStart> <OnPlayerEnteredSystem> <OnGlobalUniverseLoad> and some others. I copied code from RPGPlayer.xml. Nothing worked. I removed the timer to show the message instantly, but that didn't change anything.

SOLVED by RPC
the station wasn't created, so the event couldn't start there.
Post Reply