You know how I was saying the Events weren't working properly? Well take a look at this. Say I use this output in the direction of up. With the way this is written, it would only work if the target brick overlaps the center. In the case that the target brick is offset away from the center (which is my case all the time) the event doesn't even work.
The default events of fireRelayUp etc. use some sort of dynamic tracking system that tracks the nearest target brick no matter it's position along the original brick's edge. It also (surprise, surprise) can activate ALL the bricks along it's edge. So to everyone who thought I just sucked, go suck an egg. Anyhoo, how do I take a look at the default directional fireRelay events' code so I can edit/report this VCE event?
function fxDtsBrick::VCE_relayCallFunction(%brick,%direction,%name,%args,%client)
{
%start = posFromTransform(%brick.getTransform());
%db = %brick.getDatablock();
%angle = %brick.getAngleID();
if(%angle == 1 || %angle == 3)
{
%addX = %db.brickSizeY * 0.55;
%addY = %db.brickSizeX * 0.55;
}
else
{
%addX = %db.brickSizeX * 0.55;
%addY = %db.brickSizeY * 0.55;
}
%addZ = %db.brickSizeZ * 0.22;
//Up Down North East South West
switch(%direction)
{
case 0:
%add = 0 SPC 0 SPC %addZ;
case 1:
%add = 0 SPC 0 SPC -%addZ;
case 2:
%add = 0 SPC %addY SPC 0;
case 3:
%add = %addX SPC 0 SPC 0;
case 4:
%add = 0 SPC -%addY SPC 0;
case 5:
%add = -%addX SPC 0 SPC 0;
}
%end = vectorAdd(%start,%add);
%ray = containerRaycast(%start,%end,$TypeMasks::FxBrickAlwaysObjectType,%brick);
%col = firstWord(%ray);
if(isObject(%col))
{
if(getTrustLevel(%col,%brick) < 2)
return;
%col.VCE_callFunction(%name,%args,%client);
}
}