Author Topic: OnPlayerTouch  (Read 2238 times)

you don't need to even use triggers, just have the bank datablock and set code to happen when you touch it by packaging onPlayerTouch.
How can I package onPlayerTouch? What are the arguments it passes?

Code: [Select]
package packageName
{
function fxDTSBrick::onPlayerTouch(%this,%obj,%player)
{
// do stuff
return parent::onPlayerTouch(%this,%obj,%player);
}
};
activatePackage(packageName);

Make sure to set %brick.enabletouch to true.

Code: [Select]
package packageName
{
function fxDTSBrick::onPlayerTouch(%this,%obj,%player)
{
// do stuff
return parent::onPlayerTouch(%this,%obj,%player);
}
};
activatePackage(packageName);
You know %this is the brick, right? What is %player going to since the %obj is the player? (I think)


hurr flippin' durr
He's saying that there are only two arguments for fxDTSBrick::onPlayerTouch. %brick and %player.

Then what's with the 3rd argument returning things

It doesn't for me. Just %brick and %player.

Code: [Select]
function fxDTSBrick::onPlayerTouch(%obj, %player) {
    %data = %obj.getDatablock();
    %data.onPlayerTouch(%obj, %player);
}

Yup, just two.
« Last Edit: May 03, 2014, 06:08:42 PM by $trinick »

Then what's with the 3rd argument returning things
Maybe the client?

Maybe the client?

If his returns a third argument then there's a mod that's messing with it-- Blockland's source code (as I posted above) only defines 2 variables for the function.