Code: Select all
StaticShapeData LargeForceField { shapeFile = "ForceField_4x8"; debrisId = defaultDebrisSmall; maxDamage = 7.0; isTranslucent = true; description = "Large Force Field"; };
StaticShapeData LargeForceFieldFake { shapeFile = "ForceField_4x8"; debrisId = defaultDebrisSmall; maxDamage = 1000.0; isTranslucent = true; description = "Large Force Field"; disableCollision = true; };
function LargeForceField::onCollision(%this, %object)
{
//echo("ok got this far");
%thisteam = GameBase::getTeam(%this);
%objectteam = GameBase::getTeam(%object);
%objtype = getObjectType(%object);
if(%thisteam == %objectteam && %objtype == "Player")
{
%originalpos = GameBase::getPosition(%this);
%originalrot = GameBase::getRotation(%this);
%turret = newObject("largeforcefieldfake","StaticShape",largeforcefieldfake,true);
addToSet("MissionCleanup", %turret);
GameBase::setPosition(%this,"0 0 -999");
GameBase::setPosition(%turret,%originalpos);
GameBase::setRotation(%turret,%originalrot);
Gamebase::setMapName(%turret,"Large Force Field");
schedule("deleteobject("@%turret@");",1);
schedule("GameBase::setPosition('" @ %this @ "', '" @ %originalpos @ "');",1);
schedule("GameBase::setRotation('" @ %this @ "', '" @ %originalrot @ "');",1);
}
}
basically instead of the force field disappearing when you collide with it, the force field stays there but you can walk through it. It goes back to normal after 1 second.