Author Topic: initContainerBoxSearch Size Issue  (Read 1647 times)

I cannot get initContainerBoxSearch to correctly search within the boundaries of a single brick for a(n) item / player / vehicle. It will return with an object but the boundaries it searches seem to be stuck at a size larger than intended regardless of how large or small I set %boxSize to.

Code: [Select]
initContainerBoxSearch(%pos, %boxSize, %mask);

Code: [Select]
function fxDTSBrick::testBoxSearch(%brick)
{
%box = %brick.getWorldBox();

%x = getWord(%box, 3) - getWord(%box, 0);
%y = getWord(%box, 4) - getWord(%box, 1);
%z = getWord(%box, 5) - getWord(%box, 2);

%pos = %brick.getPosition();
%boxSize = %x SPC %y SPC %z;
%mask = $TypeMasks::ItemObjectType | $TypeMasks::PlayerObjectType | $TypeMasks::VehicleObjectType;

initContainerBoxSearch(%pos, %boxSize, %mask);

return containerSearchNext();
}

There are numerous topics on these forums discussing this same function (the most similar of which is found here). Does anyone else have an issue using this function?

The container used to box search players is very large. No matter how small you make the search, players will be matched from way too far away. In contrast, try searching for bricks. They work just fine.

In contrast, try searching for bricks.

What do you mean? I want to verify that there are no items, players and vehicles within a brick.

The container used to box search players is very large. No matter how small you make the search, players will be matched from way too far away. In contrast, try searching for bricks. They work just fine.
Where is this box actually set? Can't someone fix it?

What do you mean? I want to verify that there are no items, players and vehicles within a brick.

I mean that this is an issue with players themselves, not box searches. I said "try searching for bricks" as it would show how it's not a problem with the size of the search (bricks work fine).

Where is this box actually set? Can't someone fix it?

Dunno what it is specifically.

Oh I see. Thank you for the response. This issue has been very frustrating up to this point.



Where is this box actually set? Can't someone fix it?

I will look into this more when I get home but I think I remember the box that appears in the mission editor when selecting a Player object is significantly larger than its actual bounding box. Maybe it is to compensate for the larger X and Y area that the Player object can extend to when bending over?

Maybe it is to compensate for the larger X and Y area that the Player object can extend to when bending over?

I guess that could be the reason, but it doesn't make any sense coding wise to care about bent over players, you usually just want the collision box.

Yeah, all Players (including bots, and bot vehicles) have a world box that is 4x larger than it should be.


you mean a hitbox?

If that was meant for me or anyone else talking about the large player box; no, it definitely isn't the hitbox.

Yeah, all Players (including bots, and bot vehicles) have a world box that is 4x larger than it should be.
No, only ones that use the default player dts.

No, only ones that use the default player dts.

Using a debug function I created to draw the world box of objects:

Player/bot:


Horse:



Unless getWorldBox() is different to whatever is used for container searches, then it is for all bots.


Also, double checked with mission editor:


Apparently bricks and transparent materials are rendered above players in mission editor..


Ninja: Checked the pirate cannon and rowboat, same result. I don't have any other bot vehicles installed.

Well that's strange. Really thought it was only for the player...

Are they exactly 4 times as large as they're supposed to be?