[ut2004] basic rocketlauncher mutator

  • 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.

monkey8

New Member
Apr 4, 2004
87
0
0
I want to make my own version of a bouncing rocket launcher. The problem is, when I play, the rocket launcher base is there, but the gun is invisible and i can't pick it up. And it does this to all of the weapons bases, not just rocketlauncher ones...

The line i'm pretty sure is wrong, is bolded. I'm using MutArena and the wiki as a reference.

I don't understand what class'SomeClassName' does, Is it typecasting?
Code:
//=========================================================================
// MutRocketLauncherBouncy.uc
//   replaces regular RocketLauncher with one that fires bouncy missiles
//=========================================================================

class MutRocketLauncherBouncy extends Mutator;

function bool CheckReplacement( Actor Other, out byte bSuperRelevant )
{
  bSuperRelevant = 0;
  if ( xWeaponBase(Other) != None )
  {
    if(xWeaponBase(Other).WeaponType == class'RocketLauncher')
      [b]xWeaponBase(Other).WeaponType = class'RocketLauncherBouncy';[/b]
    else
      return true;
  }
  else if(WeaponPickup(Other) != None)
  {
//if i change ammo pickup replace it here
  }
  else
    return true;
  return false;
}

defaultproperties
{
     GroupName="RocketLauncher"
     FriendlyName="(monkey) RocketLauncher bouncy"
     Description="Rockets fired will bounce!"
}
Code:
//=========================================================================
// RocketLauncherBouncy.uc
//   rockets bounce
//=========================================================================

class RocketLauncherBouncy extends RocketLauncher;

defaultproperties
{
     Description="Same old launcher, only bouncy rockets!"
     ItemName="Bouncy Rocket Launcher"
}
If I did it correctly, it should just replace the rergular rocket launcher with mine which currently only has a different name.

thanks,
--monkey
 

GlassBoy

Nano-augmented Modder
Jan 6, 2004
169
0
0
I don't know if you knew this, but i'm working on a reflective weapons mutator, in which there are rockets that bounce off walls. It will be a while before i release, still fixing stuff, but you could just wait for that if you wanted to. Your choice. Just thought I'd let you know.
 

monkey8

New Member
Apr 4, 2004
87
0
0
GlassBoy said:
I don't know if you knew this, but i'm working on a reflective weapons mutator, in which there are rockets that bounce off walls. It will be a while before i release, still fixing stuff, but you could just wait for that if you wanted to. Your choice. Just thought I'd let you know.
I'd like to see how you did it when its done.

Do you see anything wrong with my replacement code? Because the above mutator ends up removing all weapons, but the bases stay. I just want to replace the rocketlauncher with my rocketlauncher, leaving all other weapon untouched.
 

JamesKilton

UA Coder
Oct 6, 2002
210
0
0
Everywhere and Nowhere
Visit site
First things first, always check the log to see if you have any Accessed Nones or Class Not Found errors. As for your code, it looks right but there could be something else that's messing it up, like where your classes are layed out.

class'SomeName' is just saying "I want this class." You could try putting the Package in there, like this:

change
xWeaponBase(Other).WeaponType = class'RocketLauncherBouncy';

to
xWeaponBase(Other).WeaponType = class'MyPackage.RocketLauncherBouncy';
 

GlassBoy

Nano-augmented Modder
Jan 6, 2004
169
0
0
monkey8 said:
I'd like to see how you did it when its done.

Do you see anything wrong with my replacement code? Because the above mutator ends up removing all weapons, but the bases stay. I just want to replace the rocketlauncher with my rocketlauncher, leaving all other weapon untouched.

I didn't do the code for the rocket launcher, dstoddar(sp?) did it. he also did the shock projectiles, and i did the lightning gun and shock rifle beam.
 

monkey8

New Member
Apr 4, 2004
87
0
0
Glassboy: if you and him decide to release your mod source that'd be cool to learn off from.

JamesKilton: I think my weapon code is okay because if I go settings->weapons, it shows up on the list. I tried a map with my mutator, but when I got the rocket launcher, it said I got the rocket launcher. I dont know if I didn't set a variable in my rocket launcher code or if It didn't actually replace. Now the weapons all stay in the game.

The errors don't even look like they are my fault, but something to do with the map I happened to play:
Code:
ScriptLog: START MATCH
Warning: Translauncher CTF-Maul.Translauncher (Function XWeapons.Translauncher.ViewPlayer:008B) Accessed None 'TransBeacon'
Warning: Translauncher CTF-Maul.Translauncher (Function XWeapons.Translauncher.ViewPlayer:00B4) Accessed None 'TransBeacon'
Warning: Translauncher CTF-Maul.Translauncher (Function XWeapons.Translauncher.ViewPlayer:00BC) Attempt to assign variable through None
Warning: Translauncher CTF-Maul.Translauncher (Function XWeapons.Translauncher.ViewPlayer:00C2) Accessed None 'TransBeacon'
Warning: Translauncher CTF-Maul.Translauncher (Function XWeapons.Translauncher.ViewPlayer:008B) Accessed None 'TransBeacon'
Warning: Translauncher CTF-Maul.Translauncher (Function XWeapons.Translauncher.ViewPlayer:00B4) Accessed None 'TransBeacon'
Warning: Translauncher CTF-Maul.Translauncher (Function XWeapons.Translauncher.ViewPlayer:00BC) Attempt to assign variable through None
Warning: Translauncher CTF-Maul.Translauncher (Function XWeapons.Translauncher.ViewPlayer:00C2) Accessed None 'TransBeacon'
ScriptLog: Attempting to close a non-existing menu page
Thanks everyone for the help so far :)