codeing

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

Radiosity

Minty Fresh!
Jan 3, 2003
2,217
0
0
45
UK
www.radiant-studios.net
You will need the AssaultAmmoPickup, GrenadeAmmo and yes you'll also need to use the above mutator to get it working.

In the ammopickup class change ammoamout to whatever amount you want the pickup to give when you pick it up, and change the InventoryType to your GrenadeAmmo class.

In the grenadeammo class change the maxammo to however much you want the weapon to hold (16, 24 whatever). InitialAmount is how much ammo the weapon starts with. Change the pickupclass to your new ammopickup class.

In the AssaultGrenade class (the grenade fire class) change AmmoClass to your new one (GrenadeAmmo).


Now, I've just realised that the mutator I mentioned won't work for what you want :) Think I was asleep at the time lol. You're replacing the AssaultRifle which is an Inventory Weapon and doesn't normally have a pickup base like the other weapons. Therefore you have to use a slightly different mutator:

Code:
class AssaultRifleMut extends Mutator
    config(user);

function string GetInventoryClassOverride(string InventoryClassName)

{
     if ( InventoryClassName == "XWeapons.AssaultRifle") 
     {
		InventoryClassName = "YourPackage.YourAssaultRifle";
     }

     if ( NextMutator != None )
		return NextMutator.GetInventoryClassOverride(InventoryClassName);
	return InventoryClassName;
}

function bool CheckReplacement( Actor Other, out byte bSuperRelevant )
{
  if ( AssaultAmmoPickup(Other) != None )
        {
          ReplaceWith( Other, "YourPackage.YourAssaultAmmoPickup");
        }
        else
          return false;
        }
  else
   return true;
   return false;
}

defaultproperties
{
     GroupName="AssaultRifle"
     FriendlyName="Custom Assault Rifle"
     Description="Description goes here."
}

Use that code for the mutator instead. The other one can be used for any of the other weapons that use a pickupbase.
 

ZippyDSM

New Member
Jun 17, 2001
23
0
0
Visit site
the RocketLaucher is now being a pain

I copied RocketFire.uc, RocketMultiFire.uc, RocketLauncher.uc, RocketLauncherPickUp.uc and put them in my work foulder renamed them to

zrlRocketFire.uc, zrlRocketMultiFire.uc, zrl.uc, zrlPickUp.uc

changed them class names in the file with notepad fired up WOTGREAL changed the names in the codeing to the new names of the files

I can summon it up but it wont fire 0-o I changed the seekenabled time and that worked but fireing dose not 0_o
 

Radiosity

Minty Fresh!
Jan 3, 2003
2,217
0
0
45
UK
www.radiant-studios.net
If you're editing the original scripts, there are various things that need to be changed throughout the script for the weapon to work properly. For example, in RocketFire.uc you'll see the following code:

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

I've made part of it bold to illustrate what needs changing here. If you've renamed your RocketLauncher to zrlRocketLauncher.uc then the above bit of code needs to be changed to reflect that:

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

Like that. It's pretty obvious that if these pieces of code are still all pointing to the original weapon then your new weapon won't work correctly. So go through all your scripts and find any reference like the above one that points to a script you've edited, then change it.

However, if all you're doing is changing some default variables, you'd be a lot better off by simply extending the RocketLauncher class and changing the defaults like that:

Code:
class zrlRocketLauncher extends RocketLauncher

Much easier and less messing around :)
 

ZippyDSM

New Member
Jun 17, 2001
23
0
0
Visit site
I'm used to codeing this way *L* but I guess I'll have to take your advice if I want to get anythign done on UT2003K,even if I leave the rocktfirte and mutifire in xweapons and just copy the rocketlauncher and pickup over to recode it still wont fire whitch is odd mabye I missed soemthing 0_o

ok since I put all the uc files I change in zippy package ,wouldnt I have to change the xWeaponBase in

xWeaponBase(Other).WeaponType = class'zrl'; //name of your new weapon

and finaly dont I need an int file to use the mutor?
 
Last edited:

ZippyDSM

New Member
Jun 17, 2001
23
0
0
Visit site
Dumb question of the moment
Is there an easy way to make the Ioncannon a simple to use projectile?

ok so I have 2...how can I get the flakshell to spawn grenades..I tried it in Unreal gold soemwhat works but the frist exsplosion takes out most of them *L*

thanks for youer help *L*