For direct access use https://forums.oldunreal.com
It's been quite a while since oldunreal had an overhaul, but we are moving to another server which require some updates and changes. The biggest change is the migration of our old reliable YaBB forum to phpBB. This system expects you to login with your username and old password known from YaBB.
If you experience any problems there is also the usual "password forgotten" function. Don't forget to clear your browser cache!
If you have any further concerns feel free to contact me: Smirftsch@oldunreal.com

BatThwap for your custom weapon

The section related to UnrealScript and modding. This board is for coders to discuss and exchange experiences or ask questions.
User avatar
gopostal
OldUnreal Member
Posts: 1007
Joined: Thu Jul 31, 2008 9:29 pm

BatThwap for your custom weapon

Post by gopostal »

I grew up during the time of campy Batman and so I have a real fondness for the cartoonish "Bam" and "POW!" they would show. Yesterday I needed a pick-me-up so I added it into my coop rifle. Since there's not been a lot of project pasting I thought I'd add the code in here for anyone to use, no mutator required. This code can just be slipped into your weapon code pretty easily.

First, this is how it looks:
[img]http://imgur.com/rKAU1c0.jpg[/img]

And here is how you get it:

1. In your weapon code add this line

Code: Select all

var config float ShowChance;
This allows you to tailor the amount of times it shows the various sprites. I like a pretty good amount of them but tweak as you see fit.

2. Next in your weapon code find the section where damage is dealt. For example in my coop rifle I have this section:

Code: Select all

function ProcessTraceHit(Actor Other, Vector HitLocation, Vector HitNormal, Vector X, Vector Y, Vector Z)
{

      else if (Other!=None && Other!=Self)
      {
            if (Other.bIsPawn && (instigator.IsA('PlayerPawn') || (instigator.skill > 1)) && Pawn(Other).IsHeadShot(HitLocation,X))
            {
                  Other.TakeDamage(3000, Pawn(Owner), HitLocation, 35000 * X, 'decapitated');
so directly after that last line I will add

Code: Select all

                  chancehit = FRand();
                  if (chancehit
I don't want to give the end away
but we're all going to die one day
User avatar
[]KAOS[]Casey
OldUnreal Member
Posts: 4497
Joined: Sun Aug 07, 2011 4:22 am
Location: over there

Re: BatThwap for your custom weapon

Post by []KAOS[]Casey »

Oh, this is super neat. I'm sure koopa would've loved this for some of his stuff. Wonder if this is workable into a mutator/gamerules...

Return to “UScript Board”