Author Topic: Special untriggered input event simply does not work  (Read 1146 times)

Okay, that is fixed. But another problem: packaging addEvent doesn't seem to work.
Code: [Select]
package BB_specialEvents
{
   function fxDTSBrick::addEvent(%this,%enabled,%delay,%input,%target,%output,%a,%b,%c,%d,%e,%f,%g,%h,%i,%j)
   {
      %input_ui = $InputEvent_NamefxDTSBrick_[%input];
      %output_ui = $OutputEvent_NameScriptObject_[%output];
      if($EVENTDEBUG)
      {
         announce(%this @ "::addEvent - "@%inputui@" -> (?) -> "@%output_ui);
      }
      Parent::addEvent(%this,%enabled,%delay,%input,%target,%output,%a,%b,%c,%d,%e,%f,%g,%h,%i,%j);
      if(%input_ui $= "Special" && $BB::EVT::EXIST[%output_ui] && isFunction($BB::EVT::FUNC[%output_ui]))
      {
         call($BB::EVT::FUNC[%output_ui],%this,trim(%a TAB %b TAB %c TAB %d TAB %e TAB %f TAB %g TAB %h TAB %i TAB %j));
      }
   }
};
activatePackage(BB_specialEvents);
(sorry for bad identation, copied directly from Torsion)

Even though $EVENTDEBUG is set to 1 (true), and I add a event to a brick and press send, nothing is "announced".
« Last Edit: December 03, 2010, 07:17:12 AM by Bauklotz »

If that script executed? Without errors?


Whatever is wrong is not that line. This works even without any script object for that existing.


Okay, that is fixed. But another problem: packaging addEvent doesn't seem to work.
Code: [Select]
package BB_specialEvents
{
   function fxDTSBrick::addEvent(%this,%enabled,%delay,%input,%target,%output,%a,%b,%c,%d,%e,%f,%g,%h,%i,%j)
   {
      %input_ui = $InputEvent_NamefxDTSBrick_[%input];
      %output_ui = $OutputEvent_NameScriptObject_[%output];
      if($EVENTDEBUG)
      {
         announce(%this @ "::addEvent - "@%inputui@" -> (?) -> "@%output_ui);
      }
      Parent::addEvent(%this,%enabled,%delay,%input,%target,%output,%a,%b,%c,%d,%e,%f,%g,%h,%i,%j);
      if(%input_ui $= "Special" && $BB::EVT::EXIST[%output_ui] && isFunction($BB::EVT::FUNC[%output_ui]))
      {
         call($BB::EVT::FUNC[%output_ui],%this,trim(%a TAB %b TAB %c TAB %d TAB %e TAB %f TAB %g TAB %h TAB %i TAB %j));
      }
   }
};
activatePackage(BB_specialEvents);
(sorry for bad identation, copied directly from Torsion)

Even though $EVENTDEBUG is set to 1 (true), and I add a event to a brick and press send, nothing is "announced".

I'm pretty sure it's serverCmdAddEvent

Args seem to be:

client, enabled, input ID, delay, target ID (in order), brick name (if target is named brick), output ID, arg1, arg2, arg3, arg4

Try packaging SimObject::addEvent instead of fxDTSBrick.

Chrono - This is in the Checkpoint bricks:
Code: [Select]
   %obj.enableTouch = true;

   %enabled     = 1;
   %delay       = 0;
   %inputEvent  = "OnPlayerTouch";
   %target      = "Self";
   %outputEvent = "PlaySound";
   %par1        = Beep_Popup_Sound.getId();
   %obj.addEvent(%enabled, %delay, %inputEvent, %target, %outputEvent, %par1);

I see. That never came up in trace though. :c

It didn't? I tried opening events dialog on a default installation, adding "onPlayerTouch -> Client -> CenterPrint -> Hello, World -> 5", typing trace(1); in console, pressing Send, then typing trace(0); in console. ::addEvent did appear.

Anyway, I'll try with SimObject.

EDIT: Changing fxDTSBrick to SimObject (SimObject::addEvent) doesn't work either.
« Last Edit: November 20, 2010, 01:44:26 AM by Bauklotz »

Are you sure that there are no errors, and that the file that code is in is run? Everything seems to work for everyone else...

Is this for my new problem, or the old problem with registering the event?


Anyone?

Repost of problem
Okay, that is fixed. But another problem: packaging addEvent doesn't seem to work.
Code: [Select]
package BB_specialEvents
{
   function fxDTSBrick::addEvent(%this,%enabled,%delay,%input,%target,%output,%a,%b,%c,%d,%e,%f,%g,%h,%i,%j)
   {
      %input_ui = $InputEvent_NamefxDTSBrick_[%input];
      %output_ui = $OutputEvent_NameScriptObject_[%output];
      if($EVENTDEBUG)
      {
         announce(%this @ "::addEvent - "@%inputui@" -> (?) -> "@%output_ui);
      }
      Parent::addEvent(%this,%enabled,%delay,%input,%target,%output,%a,%b,%c,%d,%e,%f,%g,%h,%i,%j);
      if(%input_ui $= "Special" && $BB::EVT::EXIST[%output_ui] && isFunction($BB::EVT::FUNC[%output_ui]))
      {
         call($BB::EVT::FUNC[%output_ui],%this,trim(%a TAB %b TAB %c TAB %d TAB %e TAB %f TAB %g TAB %h TAB %i TAB %j));
      }
   }
};
activatePackage(BB_specialEvents);
(sorry for bad identation, copied directly from Torsion)

Even though $EVENTDEBUG is set to 1 (true), and I add a event to a brick and press send, nothing is "announced".

Are you sure that there are no errors, and that the file that code is in is run? Everything seems to work for everyone else...