Basically I want a global event to trigger an input event for all bricks...
registerInputEvent("fxDTSBrick", "onNewDay", "Self fxDTSBrick");
function fxDTSBrick::onNewDay(%obj,%c)
{
$InputTarget_["Self"] = %obj;
%obj.processInputEvent("onNewDay",%c);
}
This defines the event.
And this triggers it as a part of a function...
for(%cs=0;%cs<clientgroup.getcount();%cs++)
{
%client = clientgroup.getobject(%cs);
if(isObject(%client))
{
%brickgroup = %client.brickgroup;
if(isObject(%brickgroup))
{
for(%bs=0;%bs<%brickgroup.getcount();%bs++)
{
%brick = %brickgroup.getobject(%bs);
if(isObject(%brick))
%brick.onNewDay(clientgroup.getobject(0));
}
}
}
}
But as you see, I use %brick.onNewDay(clientgroup.getobject(0)); just putting in a random client to get around it, this seems to have no effect as the input event has no client output, but I feel it is bad practice, is there anyway around a client field or will this work?