[UT2004] Nasty Combo/Weapon situation

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

Zer0Zer0

New Member
Apr 1, 2004
35
0
0
As some of you know I'm making a weapons upgrade mod blah blah uses combos to upgrade weapons. Ok so I've modified an arena mut to get rid of all weapons in a level and replace the default AR770 (Assault rifle) with my new "upgradeable" one, I've replaced adrenaline with Weapons Upgrade Points and am onto my first combo.

So I thought I'll try something simple - change the secondary firemode from grenade to FlakShells. Oh how wrong I was. Anyhow I've been searching for over 2 days trying to figure the damn thing out: finally came across the MultiAmmoWeapons Article on Wiki (thank god for wiki). So I now have an exec function in my new weapon:

Code:
class WPAssaultRifle extends UpgradeableWeapon
      config(user);

......

exec function UpgradeWeapon(string Mode)
{
    //Adapted from the Wiki - MultiAmmoWeapon Tut
    //Thank god for you people!!!

    //Can't Upgrade while your firing
    if (FireMode[0].bIsFiring || FireMode[1].bIsFiring)
       return;
   //Stops stuff firing while Upgrading
   if (Pawn(Owner) != none && Pawn(Owner).Controller != none)
   {
        Pawn(Owner).Controller.bFire = 0;
        Pawn(Owner).Controller.bAltFire = 0;
   }
   if Mode == "AddScope" {
      if (FireMode[1] != none)
                 FireMode[1].Destroy();
                 // primary fire
                 FireMode[1] = Spawn(class'XWeapons.FlakAltFire', self);
                 FireMode[1].ThisModeNum = 1;
                 FireMode[1].Weapon = self;
                 FireMode[1].Instigator = Instigator;
                 FireMode[1].AmmoClass =None;    // need these two to change the ammo
   }
   else
   {
     return;
   }
}

(my wep is infinite ammo (i hope)). Anyway moving on as you can see the function replaces the grenade with the flak shell. So I think oh great so in my Uprades (Combos) I just use Upgrade(AddMinigunFire) or whatever and It will do it. So I wrote my Combo:

Code:
class AddScope extends Combo;
//I know it says addscope but thats a lot harder
function StartEffect(xPawn P)
{
    local Pawn Player;
    local<Weapon> Upgradeable
    if 
    if (P. == class'WeaponUpgrade.WPAssaultRifle')
        WPAssaultRifle.Upgrade(AddScope);
    else
        return;
}

function StopEffect(xPawn P)
{

  local Pawn Player;
    if (Owner..Weapon == class'WPAssaultRifle')
        MutWeaponsUpgrades.WPAssaultRifle.Upgrade(AddScope);
    else
        return;
}

defaultproperties
{
     ExecMessage="Scope Upgrade Activated"
     ComboAnnouncementName="Pint_sized"
     keys(0)=1
     keys(1)=2
     keys(2)=1
     keys(3)=2
}

I know its a complete mess but you see what I'm trying to do. Theres about 70 things wrong with this combo but if you can help me out with the first three I think it will at least do something! Its driving me insane. So my questions:

Edit: Solved this one
1. Combo no worky! As in when i press up down up down (this was before adding any messed up code into the functions it was originally ComboMiniMe) it doesn't do ****! Is there a list of combos somewhere? No other people making new combos seem to have this problem!

EDIT: Ok Worked this out now from MutCrateCombo

2. How do I get at the weapon that a player is carrying from my combo? I'm just about to try some more code for this but my previous 10 attempts cause UCC errors (call will fail, missing param etc).

3. How do I make a Weapon have infinite ammo? I've tried stealing a couple of things from the SuperShockRifle but it has no effect.

Thankyou good people, any help at all will be greatly appreciated!
 
Last edited:

Alkanphel

New Member
Mar 30, 2004
19
0
0
if (P. == class'WeaponUpgrade.WPAssaultRifle')
WPAssaultRifle.Upgrade(AddScope);
else
return;
I think you have a typo in there somewhere ..
 

Zer0Zer0

New Member
Apr 1, 2004
35
0
0
Hmm something not right here, I'm trying to compile my mut and in my weapon's Upgrade function I'm getting type mismatch errors for every line. It should work.

Code:
FireMode[1] = class'XWeapons.FlakAltFire'
                 FireMode[1].ThisModeNum = 1;
                 FireMode[1].Weapon = class'Weapon.Upgradeable.WPAssaultRifle';
                 FireMode[1].Instigator = self.Instigator;
                 FireMode[1].AmmoClass = FireMode[0].default.AmmoClass;

All of this fails. I've tried commenting out each line and all of them fail. I've changed some of them to try and compensate. (For the original code see my first post).

Why did I have to change FireMode[1] = Spawn(class...FlakAltFire) to just class? Said type mismatch in spawn parameter 1.

The compiler doesn't seem to recognise that FlakAltFire is a subclass of ProjectileFire which is a subclass of WeaponFire. (important because the FireMode is a Weaponfire var.

Whats going on?

I know its referencing FireMode in Weapon Correctly :S
I adapted this code from http://wiki.beyondunreal.com/wiki/Multiammo_Weapons if some1 could take a look at that and see if i've obviously done something stupid?
 
Last edited:

[SAS]Solid Snake

New Member
Jun 7, 2002
2,633
0
0
40
New Zealand
www.digitalconfectioners.com
I believe the FireMode variable expects an object within the game not a class reference, hence why it is mismatching. For FireMode[1] = class'XWeapons.FlakAltFire' to work, then the definition of FireMode should be var class<WeaponFire> FireMode but I believe it is var WeaponFire FireMode. I hope this clears that one up. FireMode[1] = Spawn(syntax) works because it spawns an object in Unreal and then sets FireMode[1] to it.

FireMode[1].Weapon = syntax is the same deal.