Toggle Velocity ZoneInfo

//=============================================================================
// ToggleVelocity.
// Changes zone velocity vectors from default to 'other' when triggered
// To use, place a ToggleVelocity zone info in your zone. Set the zone velocity
// to suit your needs. Set the 'other' velocity and whether it is on or not at start.
// Create a ZoneTrigger. Give it's Events/Event the name of the event you want,
// like 'ChangeWind' Give your ToggleVelocity zone info a ZoneTag that matches (forget
// about it's Events tag). When triggered, will switch between base and 'other'
// velocity.
// Useful for: flushing toilets, wind tunnels, blasting into space, any fluid
// movement that needs triggering.
//=============================================================================
class ToggleVelocity expands ZoneInfo;

var() bool bOtherOn; //is the other wind on or off?
var () vector OtherVelocity;

var vector origVelocity; // what mapper set

function PreBeginPlay()
{

origVelocity = zoneVelocity;

//log ("setting up togglevelocity");

if (bOtherOn)
{ // wind off initially, set to zero at startup

zoneVelocity = OtherVelocity;

}
Super.PreBeginPlay();

}

function Trigger( actor Other, pawn EventInstigator )
{

bOtherOn = !bOtherOn;
//log ("triggered");
//toggle the gravity on or off
if (bOtherOn)
{

// velocity back on, restore the velocity values
//log ("other on");
zoneVelocity = OtherVelocity;

}
else
{

//wind has been turned off, set velocity to other

//log ("orig on");

zoneVelocity = origVelocity;

}
//call the parent's trigger function
Super.Trigger( Other, EventInstigator);

}

Home