I'm a doctor, not a mechanic

Difference between revisions of "Legacy:VitalOverdose/Short Scripts"

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
m
 
(One intermediate revision by one other user not shown)
Line 3: Line 3:
 
===Overview===
 
===Overview===
  
These scripts all contain only a few lines of modified code each. All the scripts listed here are part of the  [[Legacy:VitalOverdose/Vital'S_Pro_Mapping_Tools | Vitals Pro Mapping Tool's]] MOD.
+
These scripts all contain only a few lines of modified code each.  
  
 
===AmphibiousVolume===
 
===AmphibiousVolume===
Line 82: Line 82:
 
     }
 
     }
 
  else
 
  else
    {
 
 
     UWTBacks[0].OldUnderWaterTime = -1;
 
     UWTBacks[0].OldUnderWaterTime = -1;
    }
 
 
}
 
}
  
Line 92: Line 90:
 
}
 
}
 
</uscript>
 
</uscript>
 
This script can be downloaded in .u or .uc format:[http://www.fataloverdose.copperstream.co.uk/files/protools/amphibiousvolume/AmphibiousVolume.uc AmphibiousVolume.uc],[http://www.fataloverdose.copperstream.co.uk/files/protools/amphibiousvolume/Mylevel.u Mylevel.u]
 
  
 
----
 
----
Line 145: Line 141:
 
}
 
}
 
</Uscript>
 
</Uscript>
 
This script can be downloaded in .u or .uc format:[http://www.fataloverdose.copperstream.co.uk/files/protools/notelleportmonstercontroller/NoTelleportMonsterController.uc NoTelleportMonsterController.uc],[http://www.fataloverdose.copperstream.co.uk/files/protools/notelleportmonstercontroller/mylevel.u Mylevel.u]
 
  
 
----
 
----
Line 169: Line 163:
 
}
 
}
 
</uscript>
 
</uscript>
 
This script can be downloaded in .u or .uc format:[http://www.fataloverdose.copperstream.co.uk/files/protools/untouchvolume/UntouchVolume.uc UntouchVolume.uc],[http://www.fataloverdose.copperstream.co.uk/files/protools/untouchvolume/Mylevel.u mylevel.u].
 
  
 
----
 
----
Line 176: Line 168:
 
===VariZoomGunner===
 
===VariZoomGunner===
  
A stationary gunner with extended zoom options, designed for the excellent map [http://www.outpt.co.uk/ ONS-Minus-ece] By Biv.  
+
A stationary gunner with extended zoom options, designed for the excellent map ONS-Minus-ece By Biv.  
  
 
<uscript>
 
<uscript>
Line 214: Line 206:
  
 
</Uscript>
 
</Uscript>
 
This script can be downloaded in .u or .uc format:[http://www.fataloverdose.copperstream.co.uk/files/protools/varizoomgunner/VariZoomGunner.uc VariZoomGunner.uc],[http://www.fataloverdose.copperstream.co.uk/files/protools/varizoomgunner/Mylevel.u mylevel.u].
 
  
 
----
 
----
 
===Related===
 
 
[[Legacy:VitalOverdose/Vital'S_Pro_Mapping_Tools | Vitals Pro Mapping Tool's]]
 
  
 
==Discussion==
 
==Discussion==
 
'''MythOpus:''' Tarq, I tested out the Amphibious Volume myself and it works fine.  The only problem might be there is no untouch function to restore the pawn to its defaults, but I'm not sure if thats even necessary.  (I'm too lazy to go looking through the source.)
 
 
[[Category:Legacy Custom Class (UT2004)|{{PAGENAME}}]]
 
[[Category:Legacy Custom Class (UT2004)|{{PAGENAME}}]]

Latest revision as of 08:48, 14 September 2011

UT2004 :: Actor>>Various Short scripts (Package: custom)

Overview[edit]

These scripts all contain only a few lines of modified code each.

AmphibiousVolume[edit]

Hardley any code is changed here just the time before the player start to drown is pushed up far higher than a game is likley to last.

//-----------------------------------------------------------
// AmphibiousVolume.  Updated Oct2007
// By Vitaloverdose : http://www.Vitaloverdose.com
// A water volume that wont drown players / bots .
//-----------------------------------------------------------
 
class AmphibiousVolume extends WaterVolume
Placeable;
 
struct                           UnderWaterTimeBacks
{
var Pawn                         PawnRef;
Var float                        OldUnderWaterTime;
Var float                        OldPawnDrawscale;
};
var array<UnderWaterTimeBacks> UWTBacks;
 
Var() float                      PawnDrawscale;
Var() float                      SafeSwimTime;
 
simulated event Touch(Actor Other)
{
 if ((Other.isa('pawn')) && (pawn(Other).UnderWaterTime < SafeSwimTime) && (CheckExistingSwimmerList(pawn(Other)) > -1))
     ProcessNewSwimmer(pawn(Other));
 super.touch(Other);
}
 
simulated event UnTouch(Actor Other)
{
 local int  RecordNumber;
 local Pawn ASwimmer;
 
 if (Other.isa('pawn'))
    {
    ASwimmer     = Pawn(Other);
    RecordNumber = CheckExistingSwimmerList(ASwimmer);
 
    if ( RecordNumber == -1 )
         return;
 
    if ( SafeSwimTime > 0 )
         ASwimmer.UnderWaterTime = UWTBacks[RecordNumber].OldUnderWaterTime;
 
    }
super.Touch(Other);
}
 
function int CheckExistingSwimmerList(Pawn ASwimmer)
{
local int Inc;
 
if (UWTBacks.Length < 1)
    return -1;
 
for (inc=0;inc<UWTBacks.Length;inc++)
     if (UWTBacks[inc].PawnRef == ASwimmer)
         return inc;
 
return -1;
}
 
simulated function ProcessNewSwimmer(Pawn NewSwimmer)
{
 UWTBacks.Insert(0,1);
 UWTBacks[0].PawnRef = NewSwimmer;
 
 if ( SafeSwimTime > -1 )
    {
     UWTBacks[0].OldUnderWaterTime = NewSwimmer.UnderWaterTime;
     NewSwimmer.UnderWaterTime = SafeSwimTime;
    }
 else
     UWTBacks[0].OldUnderWaterTime = -1;
}
 
defaultproperties
{
SafeSwimTime=10000
}

No teleport monster controller[edit]

A monster controller that will stop the monsters from randomly teleporting around the level when they cant anything to fight.

//-----------------------------------------------------------
 
// NoTelleportMonsterController by vitaloverdose
 
// To stop the monsters teleporting around the level when they
 
// dont have anyone to fight.
 
//-----------------------------------------------------------
 
class NoTelleportMonsterController extends MonsterController;
 
function FightEnemy( bool bCanCharge)
 
{
 
if ( (Enemy == None ) || (Pawn == None))
    log("HERE 3 Enemy "$Enemy$" pawn "$Pawn) ;
 
if ( (Enemy == FailedHuntEnemy) && (Level.TimeSeconds == FailedHuntTime))
   {
   if ( !Enemy.Controller.bIsPlayer )
        FindNewEnemy() ;
 
   if ( Enemy == FailedHuntEnemy )
      {
       GoalString = "FAILED HUNT - HANG OUT";
       if ( EnemyVisible())
            bCanCharge = false;
  else if ( (LastRespawnTime != Level.TimeSeconds) && ( (LastSeenTime == 0 ) || (Level.TimeSeconds - LastSeenTime) > 0 ) && !Pawn.PlayerCanSeeMe())
             LastRespawnTime = Level.TimeSeconds;
 
       if ( !EnemyVisible())
          {
           WanderOrCamp(true) ;
           return;
           }
       }
    }
 
}

PhysicsVolume with Untouch()[edit]

The untouch function is available higher up the class tree but not implemented in this class.

//-----------------------------------------------------------
// UntouchVolume .By Vitaloverdose.
// physics volume with added Untouch event
//-----------------------------------------------------------
class UntouchVolume extends physicsvolume
Placeable;
var() name              UntouchEvent;
event untouch(Actor Other)
{
if (other.isa('pawn'))
   triggerEvent(UntouchEvent,Self,Instigator);
 super.Untouch(other);
}

VariZoomGunner[edit]

A stationary gunner with extended zoom options, designed for the excellent map ONS-Minus-ece By Biv.

//-----------------------------------------------------------
 
//  VariZoomGunner. By Vitaloverdose.
 
//  ONSManualGunPawn with mapper setable distance on the zoom.
 
//-----------------------------------------------------------
 
class VariZoomGunner extends ONSManualGunPawn;
 
var() float VariZoom; // this is the max range of the zoom
 
function AltFire(optional float F)
 
{
 
if (PlayerController(Controller) != None) 
   {
    bWeaponIsAltFiring = true;
    PlayerController(Controller).ToggleZoomWithMax(VariZoom);
   }
 
Super.AltFire(F);
 
}
 
defaultproperties
 
{
 VariZoom=0.900000
 
}

Discussion[edit]