Author Topic: Torque Typemask List  (Read 4792 times)

What is $TypeMasks::VehicleBlockerObjectType used for?

Code: [Select]
function Player::lookingAtWater(%client, %range)
{
%player = %client.player;

What are you doing? You're defining player::lookingAtWater and then getting .player from the Player.

Code: [Select]
%typemasks = $TypeMasks::PlayerObjectType | $TypeMasks::WaterObjectType;
Umm, what else am I supposed to do?
I thought you only wanted water?
Slick said to use those masks.

Umm, what else am I supposed to do?
You should have this: Player::lookingAtWater(%this, %range). %this would be the player.

You should have this: Player::lookingAtWater(%this, %range). %this would be the player.
So Player::lookingAtWater(%player, %range) and then to get the client I would do %player.client?


It works with water but not water bricks : /
Code: [Select]
function Player::lookingAtWater(%player, %range)
{
%client = %player.client;

if(!isObject(%player) || (!isObject(%client)))
{
return 0;
}

%typemasks = $TypeMasks::WaterObjectType;
%start = %player.getEyePoint();
%beam = vectorScale(%player.getEyeVector(), %range * 0.5);
%end = vectorAdd(%start, %beam);
%target = containerRayCast(%start, %end, %typemasks, %player);

return isObject(firstWord(%target));
}

Probably because water bricks are not water object types.

look for brick object types then check if they are water bricks maybe

look for brick object types then check if they are water bricks maybe
Like this?
Code: [Select]
function Player::lookingAtWater(%player, %range)
{
%client = %player.client;

if(!isObject(%player) || (!isObject(%client)))
{
return 0;
}

%typemasks = $TypeMasks::WaterObjectType | $TypeMasks::FxBrickObjectType;
%start = %player.getEyePoint();
%beam = vectorScale(%player.getEyeVector(), %range * 0.5);
%end = vectorAdd(%start, %beam);
%target = containerRayCast(%start, %end, %typemasks, %player);
%obj = firstWord(%target);

if(%obj.getClassName() $= "FxDTSBrick" && (%obj.getDatablock().isWaterBrick) && (%obj.physicalZone))
{
return 1;
}

return isObject(%obj);
}

You'd be better off checking for $TypeMasks::PhysicalZoneObjectType over bricks.

Look through my recent posts, i just answered this not too long ago.

Why don't you quote it here so people searching for help threads in the future will be able to see too, since your recent posts will change.

Also yeah, water is a physical zone.

You'd be better off checking for $TypeMasks::PhysicalZoneObjectType over bricks.
Would it not be better to search for if it's a brick and it's isWaterBrick is true and it's a physical zone? Because don't zone bricks also have physical zones?

Would it not be better to search for if it's a brick and it's isWaterBrick is true and it's a physical zone? Because don't zone bricks also have physical zones?

Zone bricks can also be water. You can just check if the physical zone is water.

Zone bricks can also be water. You can just check if the physical zone is water.
How?

if(%physicalzone.iswater)
{
   //foobles
}

getting the ID of zones and calling .dump() can yield may interesting things