DraZtiK
11-13-2002, 09:30 AM
heh peeps I no nothing about scripting so I'm asking you...how can I create a script like the one in the link so I can change the default aircontol by map design instead of my game settings cause I would like to increase the aircontrol in a zone within a map.
and possibly have it extend or expand a skyzoneinfo?
heres the one for ut but I couldn't get it to compile without errors.
/*
This zone allows the map maker to change some of the players movement settings.
Version By Description
------- --- -------------------------------------------------------------------------
1.00 DML Created for Smiley from the UT Editing fourm.
*/
class PlayerMovementZone extends ZoneInfo;
var() float SpeedModifier; // This value modifies the speed of the player in air and water.
var() float JumpModifier; // This value increases the height the player can jump.
var() float AirControl; // This value sets the air control within for the zone.
// Return true if the player has jump boots, and false if not.
function bool HasJumpBoots( Pawn myPlayer )
{
if ( myPlayer.FindInventoryType( class'UT_JumpBoots' ) == None )
return false;
return true;
}
/*
When a player enters the zone tweak their movement characteristics. If they have jump
boots then leave their AirControl untouched (it will already be at 1.0) but still change
their Jumping power (mad jumps R us).
*/
event ActorEntered( actor Other )
{
Super.ActorEntered( Other );
// Apply changes
if( Pawn(Other) != None && Pawn(Other).bIsPlayer )
{
if ( !HasJumpBoots(Pawn(Other)) )
{
Pawn(Other).AirControl = self.AirControl;
}
Pawn(Other).JumpZ *= self.JumpModifier;
Pawn(Other).GroundSpeed *= self.SpeedModifier;
Pawn(Other).WaterSpeed *= self.SpeedModifier;
}
}
/*
When a player leaves the zone then reset their movement attributes back to the defaults.
If the player has jump boots then only reset the jump height - their air control should
remain at 1.0. If they don't have jump boots then reset everything.
*/
event ActorLeaving( actor Other )
{
Super.ActorLeaving(Other);
if( Pawn(Other) != None && Pawn(Other).bIsPlayer )
{
if ( HasJumpBoots( Pawn(Other) ) )
{
Pawn(Other).JumpZ = Pawn(Other).Default.JumpZ * 3;
}
else
{
Pawn(Other).JumpZ = Pawn(Other).Default.JumpZ;
if ( Level.Game.IsA('DeathMatchPlus') )
Pawn(Other).AirControl = DeathMatchPlus(Level.Game).AirControl;
else
Pawn(Other).AirControl = Pawn(Other).Default.AirControl;
}
Pawn(Other).GroundSpeed = Pawn(Other).Default.GroundSpeed;
Pawn(Other).WaterSpeed = Pawn(Other).Default.WaterSpeed;
}
}
defaultproperties
{
SpeedModifier=1.0
JumpModifier=1.0
AirControl=0.35
}
alink to the uc script is here:
http://www.snout-clan.co.uk/mapsnmods/PlayerMovementZone.uc
________
CARMENSEXY live (http://camslivesexy.com/cam/CARMENSEXY)
and possibly have it extend or expand a skyzoneinfo?
heres the one for ut but I couldn't get it to compile without errors.
/*
This zone allows the map maker to change some of the players movement settings.
Version By Description
------- --- -------------------------------------------------------------------------
1.00 DML Created for Smiley from the UT Editing fourm.
*/
class PlayerMovementZone extends ZoneInfo;
var() float SpeedModifier; // This value modifies the speed of the player in air and water.
var() float JumpModifier; // This value increases the height the player can jump.
var() float AirControl; // This value sets the air control within for the zone.
// Return true if the player has jump boots, and false if not.
function bool HasJumpBoots( Pawn myPlayer )
{
if ( myPlayer.FindInventoryType( class'UT_JumpBoots' ) == None )
return false;
return true;
}
/*
When a player enters the zone tweak their movement characteristics. If they have jump
boots then leave their AirControl untouched (it will already be at 1.0) but still change
their Jumping power (mad jumps R us).
*/
event ActorEntered( actor Other )
{
Super.ActorEntered( Other );
// Apply changes
if( Pawn(Other) != None && Pawn(Other).bIsPlayer )
{
if ( !HasJumpBoots(Pawn(Other)) )
{
Pawn(Other).AirControl = self.AirControl;
}
Pawn(Other).JumpZ *= self.JumpModifier;
Pawn(Other).GroundSpeed *= self.SpeedModifier;
Pawn(Other).WaterSpeed *= self.SpeedModifier;
}
}
/*
When a player leaves the zone then reset their movement attributes back to the defaults.
If the player has jump boots then only reset the jump height - their air control should
remain at 1.0. If they don't have jump boots then reset everything.
*/
event ActorLeaving( actor Other )
{
Super.ActorLeaving(Other);
if( Pawn(Other) != None && Pawn(Other).bIsPlayer )
{
if ( HasJumpBoots( Pawn(Other) ) )
{
Pawn(Other).JumpZ = Pawn(Other).Default.JumpZ * 3;
}
else
{
Pawn(Other).JumpZ = Pawn(Other).Default.JumpZ;
if ( Level.Game.IsA('DeathMatchPlus') )
Pawn(Other).AirControl = DeathMatchPlus(Level.Game).AirControl;
else
Pawn(Other).AirControl = Pawn(Other).Default.AirControl;
}
Pawn(Other).GroundSpeed = Pawn(Other).Default.GroundSpeed;
Pawn(Other).WaterSpeed = Pawn(Other).Default.WaterSpeed;
}
}
defaultproperties
{
SpeedModifier=1.0
JumpModifier=1.0
AirControl=0.35
}
alink to the uc script is here:
http://www.snout-clan.co.uk/mapsnmods/PlayerMovementZone.uc
________
CARMENSEXY live (http://camslivesexy.com/cam/CARMENSEXY)