Code: Select all
singular function ZoneChange( ZoneInfo NewZone )
{
if (NewZone.bWaterZone || NewZone.bPainZone)
{
SetLocation(OldLocation);
Velocity = vect(0,0,0);
Acceleration = vect(0,0,0);
MoveTimer = -1.0;
}
}
In testing, the only thing this seems to do is cause the birds to pause, very briefly, before they proceed to fly around underwater, or fly into the PainZone and die quickly...
They pause is very brief. 1 or 2 tics I believe. (OldLocation is defined in class Actor, and is the pawns location from 1 tic previous)
Does it accomplish something other than that? Am I missing something? Or is it just a bit broken?
I am currently playing around with coding a new type of bird, that acts more like a bird than the default one, and also attacks players and bots.
Wanted them to not chase players into the water or pain zones (slime pits/lava etc). These birds are not penguins, cormorants, ducks etc. and have no
reason to be flying around under water IMHO. If a bird is attacking you, you should be able to escape in the water I would think....
I have written a replacement function I am using that accomplishes this. Just want to make sure I am not breaking something else with it....
Here is the current version of that:
Code: Select all
singular function ZoneChange( ZoneInfo NewZone )
{
if (NewZone.bWaterZone || NewZone.bPainZone)
{
SetLocation(OldLocation);
Velocity.Z *= -1;
Destination.Z *= -1;
Enemy = None; GoalActor = None; // This line only in State where the bird has an Enemy/GoalActor
MoveTimer = -1.0;
}
}