UE2 - UT2kX Modifying Rocket Launcher Projectile Damage

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Premonition2035

New Member
Dec 2, 2008
19
0
0
Hi, guys! I'm a newbie who's trying to get his feet wet with some weapon modifications, and so far I've duplicated the Concussion Rifle from the 3D Buzz VTM's (a Shock Rifle that throws enemies 10 times further) and the OMFG Gun (a Rocket Launcher with a ludicrous fire rate – mine is simply named the Super Rocket Launcher). Now I'm trying to adjust the damage of my Super Rocket Launcher, and this is where I'm running into problems. Here are the two classes in question:

Code:
class SuperRocketFire extends RocketFire;

defaultproperties
{
	FireRate=0.400000
	ProjectileClass=class'SuperRocketProj'
}

Code:
class SuperRocketProj extends RocketProj;

defaultproperties
{
	Damage=2000.000000
}

I've properly packaged and compiled everything, and SuperRocketProj appears in the Actor browser, but I still can't get my Super Rocket Launcher's projectiles to change. I can even state the ProjectileClass to be LinkProjectile and that won't do anything. Could someone please tell me what I'm doing wrong? I need to know exactly how projectiles work for future modifications.
 

Angel_Mapper

Goooooooats
Jun 17, 2001
3,532
3
38
Cape Suzette
www.angelmapper.com
<3 the OMFG gun. That was my first UnrealScript project.

If you've used the coding tutorial on my site, you'll see that you need to change the SpawnProjectile function in your SuperRocketFire class:
Code:
function Projectile SpawnProjectile(Vector Start, Rotator Dir)
{
    local UberLinkGunProj Proj;

    Proj = Spawn([b]class'UberLinkGun.UberLinkGunProj'[/b],,, Start, Dir);  
    return Proj;
}
Dunno why they had a ProjectileClass property and then specified the class in the function, but eh.
 

Premonition2035

New Member
Dec 2, 2008
19
0
0
Thank you very much, Angel_Mapper! :) I was able to successfully modify the projectile damage property. The RocketFire class made it difficult for me, though. Here's its SpawnProjectile function:

Code:
function Projectile SpawnProjectile(Vector Start, Rotator Dir)
{
    local Projectile p;
    
    p = RocketLauncher(Weapon).SpawnProjectile(Start, Dir);
    if ( p != None )
		p.Damage *= DamageAtten;
    return p;
}

Not very easy to tell what the hell to do with that, as opposed to the nice Link Gun example you gave above. I swear, these things are NASTY for a beginner. Here's what I ended up doing, very simply:

Code:
function Projectile SpawnProjectile(Vector Start, Rotator Dir)
{
    local Projectile p;

    p = Weapon.Spawn(class'SuperRocketLauncher.SuperRocketProj',,, Start, Dir);
    return p;
}

A little copy and paste goes a long way. Anyway, your coding tutorial was very helpful. I learned some new and very useful things. First and foremost, I didn't know that you can download all of the game's scripts. I hadn't been able to see all of the functions and default properties from the script editor in UnrealEd, and without that I would not have been able to get at RocketFire's SpawnProjectile function. I'll be sure to use all of your tutorials in conjuction with the 3D Buzz VTM's and whatever other resources I have available to me.
 

Angel_Mapper

Goooooooats
Jun 17, 2001
3,532
3
38
Cape Suzette
www.angelmapper.com
In that case you would alter the function to look like this:
Code:
function Projectile SpawnProjectile(Vector Start, Rotator Dir)
{
    local Projectile p;
    
    p = [b]SuperRocketLauncher[/b](Weapon).SpawnProjectile(Start, Dir);
    if ( p != None )
		p.Damage *= DamageAtten;
    return p;
}
And then copy and alter the SpawnProjectile function in RocketLauncher into your SuperRocketLauncher.

[edit] 2222 posts, which is incidentally my personal record for number of pogo jumps.
 
Last edited:

Premonition2035

New Member
Dec 2, 2008
19
0
0
Sorry, Angel_Mapper, it doesn't seem to be working. I realize what I did was probably sloppy coding, but I replaced the function exactly with what you gave and it isn't working. I don't know, the Rocket Launcher is an enigma to me. o_O Hopefully I've got the right idea, so in the meantime I'm going to move on to recreating the Plasma Rifle from Halo (slowly at first). I'm sure it's been done a thousand times before, but it's good practice and it ought to be fun. :)