Legacy:RocketLauncher - Unreal Wiki

# Legacy:RocketLauncher

### From Unreal Wiki, The Unreal Engine Documentation Site

UT2003 :: Actor >> Inventory >> Weapon >> RocketLauncher (Package: XWeapons)

The RocketLauncher weapon.

## Properties

### Magic Numbers

NUM_BARRELS = 3 (const)
BARREL_ROTATION_RATE = 2.95 (const)

### Main

float SeekCheckFreq
float SeekRange
float LockRequiredTime
float UnLockRequiredTime
float LockAim
Color CrosshairColor
float CrosshairX
float CrosshairY

### Hidden

float BarrelRotation
float FinalRotation
bool bRotateBarrel
Pawn SeekTarget
float LockTime
float UnLockTime
float SeekCheckTime
bool bLockedOn
bool bBreakLock
bool bTightSpread

## Functions

Tick( float dt )
bool CanLockOnTo( Actor Other )
Projectile SpawnProjectile( vector Start, rotator Dir )
PlayIdle() (simulated)
  Calls `LoopAnim( IdleAnim, IdleAnimRate, 0.25 )`.
PlayFiring( bool plunge ) (simulated)
  If `plunge`, calls `GotoState('AnimateLoad', 'Begin')`.
PlayLoad( bool full ) (simulated)
  If `full`, calls `GotoState('AnimateLoad', 'Begin')`.
AnimEnd( int Channel ) (simulated)
RotateBarrel() (simulated)
UpdateBarrel( float dt ) (simulated)
Plunge() (simualted)
  Calls `PlayAnim('load', 0.8, 0.0, 1)` and `PlayAnim('load', 0.8, 0.0, 2)`.
bool StartFire( int Mode ) (simulated)
SetTightSpread( bool bNew, optional bool bForce ) (simulated)
ServerClearTightSpread()
  Sets `bTightSpread = false`.
ServerSetTightSpread()
  Sets `bTightSpread = true`.
BringUp( optional Weapon PrevWeapon ) (simulated)

#### AI Interface

float SuggestAttackStyle()
float GetAIRating()
  Tell bot how valuable this weapon would be to use, based on the bot's combat situation also suggest whether to use regular or alternate fire mode.
byte BestMode()
  Choose between regular or alt-fire.

## Events

RenderOverlays( Canvas Canvas ) (simulated)
ClientStartFire( int Mode ) (simulated)

## States

### AnimateLoad (simulated)

#### Functions

Tick( float dt ) (simulated)
  If `bRotateBarrel`, calls `UpdateBarrel(dt)`.
Begin:

    Sleep(0.15);
        RotateBarrel();
        Sleep(0.07);
        PlayOwnedSound(Sound'WeaponSounds.RocketLauncher.RocketLauncherLoad', SLOT_None,,,,,false);
        ClientPlayForceFeedback( "RocketLauncherLoad" );  // jdf
        Sleep(0.28);
        Plunge();
        PlayOwnedSound(Sound'WeaponSounds.RocketLauncher.RocketLauncherPlunger', SLOT_None,,,,,false);
        ClientPlayForceFeedback( "RocketLauncherPlunger" );  // jdf
        Sleep(0.29);
        GotoState('');

## Custom RocketLauncher Code

Important: Through a bad implementation of the Rocket Launcher and Bots it doesn't matter what ProjectileType you have set in your modified Projectiles. The bots will always spawn a regular RocketProjectile or SeekingRocketProjectile!

This is the code for that:

    class myRocketLauncher extends RocketLauncher config(user);

    function Projectile SpawnProjectile(Vector Start, Rotator Dir)
    {
    local RocketProj Rocket;
    local SeekingRocketProj SeekingRocket;
    local bot B;

    bBreakLock = true;

    // decide if bot should be locked on
    B = Bot(Instigator.Controller);
    if ( (B != None) && (B.Skill > 2 + 5 * FRand()) && (FRand() < 0.6)
    && (B.Target == B.Enemy) && (VSize(B.Enemy.Location - B.Pawn.Location) > 2000 + 2000 * FRand())
    && (Level.TimeSeconds - B.LastSeenTime < 0.4) && (Level.TimeSeconds - B.AcquireTime > 1.5) )
    {
    bLockedOn = true;
    SeekTarget = B.Enemy;
    }

    if (bLockedOn && SeekTarget != None)
    {
    SeekingRocket = Spawn(class'SeekingRocketProj',,, Start, Dir);
    SeekingRocket.Seeking = SeekTarget;
    if ( B != None )
    {
    //log("LOCKED");
    bLockedOn = false;
    SeekTarget = None;
    }
    return SeekingRocket;
    }
    else
    {
    Rocket = Spawn(class'MyRocketProj',,, Start, Dir); // !! MODIFIED CODE
    return Rocket;
    }
    }

    defaultproperties
    {
    }

## Related Topics

- Pickup
  - RocketLauncherPickup
- Projectile
  - RocketProj
    - SeekingRocketProj

## Discussion

Wormbo: OK, this is clearly not useful. ;) To whoever created this page: Please replace it with a standard class page. If you need an example, look at Pickup.

Bullet: I felt free to remove it although I didn't create it :)

darQ: Should work now, just add your own Projectile Class, posted by sploreg @ http://www.ataricommunity.com/forums/showthread.php?t=366804&highlight=RocketProj :)

SuperApe: I agree this page was in need of a real class page. Who would like to suggest a new home for the above custom code?

OlympusMons: Dunno how useful this custom code is, personally Id just remove it. Since that may cause some hastles it might be worth creating a custom class page called MyRocketLauncher then link it from here in the related topics.

SuperApe: Or perhaps give it a unique name and page (descriptive). The code above was just recently modified by darQ, perhaps it could go to a subpage of his personal page. (I'm not touching it)

Graphik: The owner should please move it to a personal page.

OlympusMons: Just so happens Im working with this class myself for a mod, I'll see if I can come up with some kind of work around to the problem above but it'll probably contain a Projectile subclass as well. Hmm dunno what this will do for compatability but the custom class is probably a good idea for people to extend from.

Category:Legacy Class (UT2003)

Category:Legacy Class (UT2004)

Category:Legacy To Do – (re)move custom class code?

Categories: Legacy Class (UT2003) | Legacy Class (UT2004) | Legacy To Do

##### Views

- Legacy
- Discussion
- Current revision

##### Search