Cogito, ergo sum

Legacy:Mod Ideas/NukeRifles

From Unreal Wiki, The Unreal Engine Documentation Site
< Legacy:Mod Ideas
Revision as of 12:56, 18 July 2006 by Wormbo (Talk | contribs) (reverted)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

NukeRifles mutator[edit]

Combat using modified Sniperifles that fire nuclear bullets![edit]

Just as devastating as the Redeemer, but instant hit, and zoom too ;-)

Yes, I know it's totally silly, but it' good fun for about 5 minutes...

I'd like to do a version of it for UT2003, but am having trouble figuring out how the new Redeemer code works – specifically it uses states to gradually move the damage radius out as the shockwaves expand, so the victims get gibbed when the wave hits them. Each time I try to use states, the compiler throws up some error or other... :-( So at the moment, in my mut they just get gibbed instantly, which looks really lame. In good old UT, I could just spawn a Shockwave object, this did the whole lot automatically...  :-)

Thanks, \

Electric Mini:


Update... I've got it (mostly) working

I've managed to get it to work after poking around the Net all day :-)

I've had to spawn a custom class NukeRifleExplosion, based on the RedeemerFire stuff.

This spawns a nuke explosion, which is allowed to have states, so I get the nice shockwaves and huge BOOM explosion noise...

But... I can't get the kills to register properly! Up until 10 minutes ago I couldn't score a single kill with this mut, only suicides were counted (DOH!). The only way I've found to do this so far is to call Other.TakeDamage, this passes the Instigator along so kills are recorded for whichever victim you hit. But this sucks, 'cos it's instant, and you only get credit for killing the poor sucker the beam actually hits!

Everyone else that dies gets counted as a suicide (ugh!).

The Redeemer code uses HurtRadius, but I can't see how this gets info on who fired the thing to the victim (like Other.TakeDamage would).

Is there some easy way to hurt all the actors within a radius of a target, making sure that if they die the person who fired the shot gets the credit?

Am I just barking up the wrong tree here? Or am I just barking mad?  ;-)

P.S. If anyone wants the NukeRifles mut, put a comment here and I'll put it up on the www somewhere. Oh yes, I've now got zooming working too, like Zoom-Instagib.

P.P.S. I've also done NukeRifles for UT and a Nuclear-War mut for UT (replaces all weapons with 2-shot Redeemers... better run for cover). Again, if anyone wants them, shout.

Electric Mini


Eldhrin: Use HurtRadius for initiating the damage – I'm not sure how, but somehow it Just Works. Most of the time at least :-)

Electric Mini: That's what it does at the moment. I think the problem may be that I just "borrowed" the Redeemer code, and that spawns the Redeemer missile as a separate Pawn, which then explodes when it hits something. My hack just spawns it, and it explodes immediately ( gross hack or what? ;-).

So I think the kills are getting attributed to this Redeemer missile actor, rather than to the player who fired it (somewhere the chain of ownership is getting broken).

I guess I really should dig deeper and learn how the Redeemer stuff works, then think of a decent way to code it. A task to prove me worthy, eh?

Eldhrin: lol yes. However, it sounds like what you should really be doing is using a subclass of InstantFire, with code pulled out of the Redeemer's missile class in its hit-the-target routine. Or, have a look at the code in the Redeemer (or rather in one of its superclasses) which actually spawns the missile, and see if there's anything in that which looks like how the chain of ownership is preserved. It might be as simple as one of the optional parameters passed to Spawn.

Electric Mini: I've got it working properly now, I must have been doing something stupid before (no surprises there! ;-)). I'm using the SuperShockRifle (a.k.a InstaGib Rifle) as the basis for the weapon, so it is a weird hybrid of an instant-hit weapon (InstaGib Rifle) and a projectile weapon (Redeemer).

I've modified the TracePart() routine so it won't recursively trace until it hits the level (that was how you could shoot through one enemy and kill a second one with just one shot) now it spawns a modified Redeemer projectile (no skins or static meshes, so it's invisible).

function TracePart(Vector Start, Vector End, Vector X, Rotator Dir, Pawn Ignored)
{
    local Vector HitLocation, HitNormal;
    local Actor Other;
    local NukeRifleProjectile big_bang;
 
    Other = Ignored.Trace(HitLocation, HitNormal, End, Start, true);
 
    if ( (Other != None) && (Other != Ignored) )
    {
        //if ( !Other.bWorldGeometry )
        //{
            HitNormal = Vect(0,0,0);
            //if ( (Pawn(Other) != None) && (HitLocation != Start) && Weapon.IsA('NukeRifle') )
			//	TracePart(HitLocation,End,X,Dir,Pawn(Other));
        //}
    }
    else
    {
        HitLocation = End;
        HitNormal = Vect(0,0,0);
    }
	SpawnBeamEffect(Start, Dir, HitLocation, HitNormal, 0);
	if( Instigator.bDeleteMe != true )
		big_bang = Spawn(class'my_mod2.NukeRifleProjectile',Instigator,, HitLocation - (100*Normal(HitLocation - Start)) , Dir);                      
}

Am I right about what I think TracePart() is doing? The commented-out bits are how it did the recursive tracing, right?

NukeRifleProjectile is a copy of RedeemerProjectile, with a few of the default properties changed. It also blows up with a full-sized nuke explosion if it is damaged, rather than a small explosion like the Redeemer missile does.

In my previous attempts this projectile would automatically go into the Dying state, but it'd only produce a pretty explosion if you directly shot someone. If you hit something else, you'd get the damage but no visual explosion (weird).

This time, I've left its states alone, but I'm spawning it about 100 units back along the line of fire, so the projectile will slam into the target and explode normally.

Yeehaa! It works! :-)

It's also very deadly! :-) :-)

Now the real challenge is to see if it'll work over a network....

I can't test this – haven't got a network, and my ISP won't allow servers to be run off their cablemodem connections (bummer).

I've put the whole of the NukeRifles Code up.

Thanks \

Electric Mini

Eldhrin: yes, you've commented out the bits that caused recursive tracing :-) Congratulations

Wormbo: There are several other pages belonging to this one: MutNukeRifles, NukeRifle, NukeRifleFire, NukeRiflePickup and NukeRifleProjectile. Those are custom class pages but not in the wiki's usualy class page format. What to do with those?