Author Topic: Event not working  (Read 734 times)

So I have this simple input event
Code: [Select]
registerInputEvent("fxDTSBrick", "onDay", "Self fxDTSBrick");Whenever I activate it with brickID.processInputEvent("onDay"); it doesn't do anything at all. Why?

post the onDay function.

odds are something is buggering up in there.

post the onDay function.

odds are something is buggering up in there.
The way he's testing it, doesn't matter if an onDay function even exists.

However, you need to determine what "Self" is through some variable whenever you process the input.
Try testing it through named bricks.

However, you need to determine what "Self" is through some variable whenever you process the input.
Try testing it through named bricks.
I added some events like onDay >> NAMEDBRICK a >> SetColor >> Blue and triggered it but it still had no effect. I named all the bricks a and they still didn't do anything.

I added the "Minigame" parameter to the event and now it works.
But for some reason BrickID.processinputevent("onDay", MinigameID); still only triggers events that target a named brick.

only triggers events that target a named brick.

This is because your fxDTSBrick::onDay function is flawed or missing. Could we see it?

This is because your fxDTSBrick::onDay function is flawed or missing. Could we see it?
Didn't even have one. Maybe that's the problem.

Didn't even have one. Maybe that's the problem.

Use this:
Code: [Select]
function fxDTSBrick::onDay(%obj, %miniGame)
{
   $InputTarget_["Self"]   = %obj;
  
   if(isObject(%miniGame))
   {
      $InputTarget_["MiniGame"] = %miniGame;
   }
   else
   {
      $InputTarget_["MiniGame"] = 0;
   }
  
   %obj.processInputEvent("OnDay"); // removed ', %client'
}

You always need a function for an input event to set up the event targets.
« Last Edit: February 20, 2012, 01:01:39 PM by Port »

Use this:
Code: [Select]
function fxDTSBrick::onDay(%obj, %miniGame)
{
   $InputTarget_["Self"]   = %obj;
   
   if(isObject(%miniGame))
   {
      $InputTarget_["MiniGame"] = %miniGame;
   }
   else
   {
      $InputTarget_["MiniGame"] = 0;
   }
   
   %obj.processInputEvent("OnDay", %client);
}

You always need a function for an input event to set up the event targets.
What's %client supposed to be?

Oh, oops. Just remove the %client argument.

I'm pretty sure that %client variable is required for it to work right..

Got it working finally. Thanks guys.

I'm pretty sure that %client variable is required for it to work right..

He's making an event which would be triggered by the server. There is no client present in this system.

He's making an event which would be triggered by the server. There is no client present in this system.
Obviously. What I was saying though was that I thought a client was required for the event to be called.

Obviously. What I was saying though was that I thought a client was required for the event to be called.
Correct.