I guess the reason is UnrealEd's algorithm how to place items - if a mapper adds an item in the perspective view, the item's pivot point is snapped into the grid. With the default grid of 16 UU some items stuck in the ground then (see pic). (Also the collision cylinder should be adapted to the shape of item's visible mesh.)papercoffee wrote:I had a buried Ripper in some maps.
I was annoyed by this also and added a function in my MapPatcher's auto state that sucks the inventory items out of the ground:
Code: Select all
function int FixGroundStuckStuff(ELogType LogLevel) {
const CFunctionNameFGS = "FixGroundStuckStuff";
local int result, i;
local Inventory Inv;
local vector Delta;
local bool bSuccess;
foreach AllActors(Class'Inventory', Inv)
if (Inv.AttachTag == '' && ! Inv.bHidden)
if (StucksInGround(Inv.CollisionHeight, Inv.Location))
{
bSuccess = false;
Logger(Log_Debug, CFunctionNameFGS, Inv @ "stucks in ground at" @ Inv.Location $ ", CollisionHeight=" $ Inv.CollisionHeight);
delta.z = 0;
while (delta.z < 2* Inv.CollisionHeight) // CollisionHeight is half the height of a Collision Cylinder
{
delta.z = delta.z + 1;
if (StucksInGround(Inv.CollisionHeight, Inv.Location + Delta))
Logger(Log_Debug, CFunctionNameFGS, Inv @ "still stucks in ground at" @ Inv.Location + Delta $ ", increasing z");
else if ( ! SetLocationEx(Inv, Inv.Location + Delta))
{
break;
}
else
{
Logger(Log_Verbose, CFunctionNameFGS, "changed location for" @ Inv @ "from" @ Inv.Location - Delta @ "to" @ Inv.Location);
result++;
bSuccess = true;
break;
}
}
if ( ! bSuccess)
Logger(Log_Verbose, CFunctionNameFGS, Inv @ "would even stuck in ground at" @ Inv.Location + Delta $ ", giving up");
}
return result;
}