Blockland Forums > Modification Help
Event not working
<< < (2/3) > >>
Port:

--- Quote from: Jasa1 on February 19, 2012, 11:57:31 PM ---only triggers events that target a named brick.

--- End quote ---

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

--- Quote from: Port on February 20, 2012, 10:19:53 AM ---This is because your fxDTSBrick::onDay function is flawed or missing. Could we see it?

--- End quote ---
Didn't even have one. Maybe that's the problem.
Port:

--- Quote from: Jasa1 on February 20, 2012, 12:34:30 PM ---Didn't even have one. Maybe that's the problem.

--- End quote ---

Use this:

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

--- End code ---

You always need a function for an input event to set up the event targets.
Jasa1:

--- Quote from: Port on February 20, 2012, 12:44:51 PM ---Use this:

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

--- End code ---

You always need a function for an input event to set up the event targets.

--- End quote ---
What's %client supposed to be?
Port:
Oh, oops. Just remove the %client argument.
Navigation
Message Index
Next page
Previous page

Go to full version