Author Topic: Easiest way to get typemask for everything but player  (Read 618 times)

Code: [Select]
~$Typemasks::PlayerObjectType;This gives me -16385 or -101111111111111. Not sure if this would work because I think some masks have more bits than that? (the negative was also messing up).

Code: [Select]
$Typemasks::All;This gives me -1, I dont think there's much that I can do with this one to exclude the player mask, nothing like $Typemasks::All - $Typemasks::PlayerObjectType or anything.

Code: [Select]
$Typemasks::A|$Typemasks::B|$Typemasks::C|$Typemasks::D...This would work, but it'd look messy but I also thing that out of all the available typemasks, some span more than one object class (because of inheritance) so I really wounldnt know which ones to include.

Code: [Select]
Some square of 2 (eg 1,2,4,8,...I could make my own, but I dont know how many total bits I would need as I dont know the maximum that a typemask holds? (or is it the highest an int can go?)

Someone help me out please :)

Can i see the full code for what you're trying to do.

Can i see the full code for what you're trying to do.
It was more of a general question, but the context is I'm just firing a simple raycast from the eye and I wanted it to hit anything that wasn't a player or and item. I tried  using FxBrickObjectType just as a test but it didn't seem to be colliding with things I wanted it to collide with, like FxPlane. That's why I want everything but player and item so I don't have to worry about so many execptions.

Code: [Select]
//Starting selection, let's fire a raycast from the player's eye
//This get's the first position the player clicked with the item...
%eye = %this.getEyePoint();
%ev = %this.getEyeVector();
%mask = $Typemasks::FxBrickObjectType;
%raycast = containerRaycast(%eye, VectorAdd(%eye,VectorScale(%ev,50)),%mask);

I thought this was supposed to be some easy thing?

Don't know if this would work for you but you can exclude certain objects
Code: [Select]
%raycast = containerRaycast(%eye, VectorAdd(%eye,VectorScale(%ev,50)),%mask,%ignore_this_object);

I'm not sure if it works, but try using $TypeMasks::All & $TypeMasks::PlayerObjectType as the mask.