New Wepaons

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

dominado

New Member
Oct 13, 2001
80
0
0
Mithrill Hall
Visit site
I am trying to make the most basice weapon i can. i have made a gun (enforecer) by just saving the gun as something else, like copying it and then editing it a little. I have one problem that i cant seem to work out. How do i increase the fire speed? i cant see any other posts whith this question in them, so i f i repaet something sorry
 

Col Kassad

Banz0red
Mar 6, 2001
97
0
0
Look for something like

PlayAnim('Shoot',0.5 + 0.31 * FireAdjust, 0.02);

I *think* the first number (.5) is the rate at which the firing animation is played. Try changing it to .2 or something. Might work.
 

dominado

New Member
Oct 13, 2001
80
0
0
Mithrill Hall
Visit site
hm prblems

ok, when i create a custom weapon that is based off the enforcer there is no code for it, therefore i cant find playanim. when i copy all the code of the enforcer it doesnt display in the editor, and i think it gives the 3rd person view, and doesnt shoot. Do u guys know any <b>GOOD </b> weapon tutorials. Sorry for the reiteration if ther is any from other such topics. Also hey PotFarmer, this is {aka}{+Ð0MIN/\T0R+}. Rember when i asked u how to nmake mpas?
HA!
thanks guys
 

Col Kassad

Banz0red
Mar 6, 2001
97
0
0
class MyEnforcer extends Enforcer;


simulated function PlayFiring()
{
PlayOwnedSound(FireSound, SLOT_None,2.0*Pawn(Owner).SoundDampening);
bMuzzleFlash++;
PlayAnim('Shoot',1.0 + 0.31 * FireAdjust, 0.02);
}


That will make the Enforce fire twice as fast (I changed the number after Shoot from 0.5 to 1.0 and tested it).

What I did was find the function for the firing sequence in the Enforcer code and overrode it in the MyEnforcer script. You can do this with any function.

As for good weapon tut's, the best place I know of for the coding end of weapons is Weapons of Destruction.
 

dominado

New Member
Oct 13, 2001
80
0
0
Mithrill Hall
Visit site
Re: hm prblems

but still this -
Originally posted by dominado
ok, when i create a custom weapon that is based off the enforcer there is no code for it, therefore i cant find playanim. when i copy all the code of the enforcer it doesnt display in the editor, and i think it gives the 3rd person view, and doesnt shoot.
does that mean i can pu JUST that code in the compiler for the gun and it will execute it? i am just learning C++, and dont know much about Uscript.
thanks :)
 

Col Kassad

Banz0red
Mar 6, 2001
97
0
0
Yep :) C++ and UScript are both object oriented so when you subclass it you're using all the Enforcer code by default except for any function that you override (like that playanim function). You can also add your own functions (beyond my scope).

If you're using unrealed it will create "class WhateverYouCallIt extends Enforcer;" automatically, all you have to do is copy/paste from "simulated function...." on underneath it and compile/save. When you get used to doing this you may want to start using a text editor and UCC MAKE for writing and compiling code so you can get to the default properties easier. All that's explained at Weapons of Destruction I think.
 
Last edited:

dominado

New Member
Oct 13, 2001
80
0
0
Mithrill Hall
Visit site
yyyyyyyyyyaaaaaaaayyyyy!

this is awsome. thanks alot col kassad! you rule! i made it shoot FAST!
woohoo!!!!! you rule man. hmmmmm im trying to make it say something else when i pick it up now, just about to test it again. So another question :) how do i make it more accurate, more damaging, not two enforcers(even when i dont start with one) and make its own weapon, so when i throw the regualr enforecer it doesnt go with it, or is that impossible since i have expands enforcer?really,
thanks so much :)
 

Col Kassad

Banz0red
Mar 6, 2001
97
0
0
Hehe, cool. Open your Unrealed and load your package. Right click on your weapon class and choose Default Properties. Look for the Enforcer field and change the hitdamage to 300 for happy go lucky instagib enforcers. Save your package and that should do it. There's alot of other stuff in the default props to play with too.

I'm not sure about accuracy but it may be in this Enforcer function:

function ProcessTraceHit(Actor Other, Vector HitLocation, Vector HitNormal, Vector X, Vector Y, Vector Z)
{
local UT_Shellcase s;
local vector realLoc;

realLoc = Owner.Location + CalcDrawOffset();
s = Spawn(class'UT_ShellCase',, '', realLoc + 20 * X + FireOffset.Y * Y + Z);
if ( s != None )
s.Eject(((FRand()*0.3+0.4)*X + (FRand()*0.2+0.2)*Y + (FRand()*0.3+1.0) * Z)*160);
if (Other == Level)
{
if ( bIsSlave || (SlaveEnforcer != None) )
Spawn(class'UT_LightWallHitEffect',,, HitLocation+HitNormal, Rotator(HitNormal));
else
Spawn(class'UT_WallHit',,, HitLocation+HitNormal, Rotator(HitNormal));
}
else if ((Other != self) && (Other != Owner) && (Other != None) )
{
if ( FRand() < 0.2 )
X *= 5;
Other.TakeDamage(HitDamage, Pawn(Owner), HitLocation, 3000.0*X, MyDamageType);
if ( !Other.bIsPawn && !Other.IsA('Carcass') )
spawn(class'UT_SpriteSmokePuff',,,HitLocation+HitNormal*9);
else
Other.PlaySound(Sound 'ChunkHit',, 4.0,,100);

}
}



Just copy that into your code and start messing around with the numbers, maybe starting near the "FRand" parts and take notes so you don't get lost.

As for your own doble enforcers, I think you'd have to subclass a DoubleEnforcer class, overriding any referances to the enforcer class with your own class name in any functions and default properties. I'm not really sure. I pretty much code by the seat of my pants.
 

dominado

New Member
Oct 13, 2001
80
0
0
Mithrill Hall
Visit site
i think

i think i understand a little
but no matter what enforcer-hit damage i have i have an instant kill since i changed ammo type and back!
thanks you got that enfocer problem solved with the doubles and normal enforcer. So what is the alt fire speed?thanks. . . again!!!!! :minigun:
enforcer speed!
 

Papapishu

我是康
Jun 18, 2001
2,043
0
0
42
void
www.vovoid.com
repeat the process, but do it on every "altfire" function instead...

and a good tip... use a normal texteditor and ucc.exe to edit and comepile you programs...

Unrealed can screw things up very bad, like overwriting your existing packages (bad thing) and it's also harder to use (lousy texteditor)
I myself use Ultraedit and UCC.exe.

check this simple tutorial (made by me... :D) about how you extract code... (tip: you can also use WotGreal to extract code. much more user-friendly...)

Extracting code tutorial

And feel free to ask me anything... ;)