containerraycast(%start, %end, %typemasks, %obj)
%start, %end are self explanatory
%typemasks are the kinds of things the raycast will detect. Right now you're only detecting bricks.
The raycast types are
$TypeMasks::FxBrickObjectType - hits raycasted bricks
$TypeMasks::FxBrickAlwaysObjectType - hits all bricks, even unraycasted
$TypeMasks::TerrainObjectType - Not sure if its depreciated but i suspect its used for hitting the ground or maybe modter
$TypeMasks::PlayerObjectType - Players and bots
$TypeMasks::VehicleObjectType
$TypeMasks::StaticObjectType - Probably staticshapes; haven't tested. Seems like it would require the staticshape to also have collision, since Port's new brick tool doesnt let you cast on other player brick beams
There's likely more, but i dont remember how to dump variables of $wildcard* to a file off the top of my head.
%obj is the object firing the raycast; im not exactly sure what that's used for.
example code:
%start = %obj.getMuzzlePoint(%slot);
%end = vectorAdd(%start, vectorScale(%obj.getMuzzleVector(%slot), 1000));
%TypeMasks = $Typemasks::PlayerObjectType | $Typemasks::FxBrickObjectType | $Typemasks::TerrainObjectType |
$TypeMasks::StaticObjectType | $TypeMasks::VehicleObjectType;
%ray = containerRaycast(%start, %end, %typemasks, %obj);
The format of %ray is the "objectID posx posy posz objectID posx posy posz" and so on i believe. Check for yourself and correct me i guess - I've only ever used the first object.