Author Topic: Setting events on a Brick through Script  (Read 351 times)

Hey, i'm trying to set a bricks events through script, and it's not working. Yes im trying to use zone events. More specifically, i'm trying to make it so the brick is evented so that when a player is on a brick, a client variable is set to true. when the person leaves, it sets to false. Here's what ive tryed:
Code: [Select]
%brick.eventInput0 = "onPlayerEnterZone";
%brick.eventTarget0 = "Client";
%brick.eventOutput0 = "isInBrickTrue";
%brick.eventInput1 = "onPlayerLeaveZone";
%brick.eventTarget1 = "Client";
%brick.eventOutput1 = "isInBrickFalse";
How can i get this to work?

Look at the Checkpoint brick.

Do
Code: [Select]
function YOURBRICKNAMEData::onPlant(%data, %obj)
{
   %obj.enableActivate = true;

   %enabled     = 1;
   %delay       = 0;
   %inputEvent  = "INPUT EVENT";
   %target      = "TARGET";
   %outputEvent = OUTPUT EVENT;
   %par1        = "PARAMETER(if you need it)";
   %par2        = "PARAMETER(if you need it)";
   %par3        = "PARAMETER(if you need it)";
   %par4        = "PARAMETER(if you need it)";
   %obj.addEvent(%enabled, %delay, %inputEvent, %target, %outputEvent, %par1(if you need it), %par2(if you need it), %par3(if you need it), %par4(if you need it));
}

function YOURBRICKData::onLoadPlant(%data, %obj)
{
   Parent::onLoadPlant(%data, %obj);
   %obj.enableActivate = true;
}
That should work if you do it correctly.

Alright, i'll try that when I get home from school.

What would be the function names for a 32x32 baseplate?
Also, do both those need to be in packages?