modding rifles???
-
- Novice
- Posts: 10
- Joined: Mon Apr 21, 2008 10:20 am
modding rifles???
Hi all does anyone know of a good (simple Tutorial for modding rifles? I have tried wot greal a little but I am absolutely lost here I also have umake which I believe will compile when I am ready lol any help much appreciated!!!
-
- Novice
- Posts: 17
- Joined: Mon Apr 21, 2008 12:39 pm
- Personal rank: UT Master
Re: modding rifles???
Yea that would be great.
I would like to creat a rifle when while your standing still or crouched you'll shoot fast. I thought that they use the name 'crossfire' for it.
Hopefully someone can help us out
I would like to creat a rifle when while your standing still or crouched you'll shoot fast. I thought that they use the name 'crossfire' for it.
Hopefully someone can help us out
-
- Godlike
- Posts: 5498
- Joined: Wed Feb 27, 2008 6:24 pm
- Personal rank: Work In Progress
- Location: Liandri
Re: modding rifles???
@ */)nT... : To build a simple rifle, I have to know how to build a basic weapon first
Here's a link to a good tutorial: Unreal Wiki
@ {UTM}Warrior : That's very simple too (and a good ideia, congratulations ).
Let's think the sniper rifle for example:
1) Create a new subclass of SniperRifle (and save on you own package or in MyLevel);
2) Then just put this code on:
And if this piece of coding (that I made in about a minute) doesn't work, well I am noob programmer so you have to ask another programmer.
Here's a link to a good tutorial: Unreal Wiki
@ {UTM}Warrior : That's very simple too (and a good ideia, congratulations ).
Let's think the sniper rifle for example:
1) Create a new subclass of SniperRifle (and save on you own package or in MyLevel);
2) Then just put this code on:
This piece of code might work, and the result is double firing rate of sniper rifle when you are crouched.simulated function PlayFiring()
{
local int r;
PlayOwnedSound(FireSound, SLOT_None, Pawn(Owner).SoundDampening*3.0);
If (Pawn(Owner).bDuck == 0)
PlayAnim(FireAnims[Rand(5)],0.5 + 0.5 * FireAdjust, 0.05);
Else
PlayAnim(FireAnims[Rand(5)],(0.5 + 0.5 * FireAdjust) * 2, 0.05);
if ( (PlayerPawn(Owner) != None)
&& (PlayerPawn(Owner).DesiredFOV == PlayerPawn(Owner).DefaultFOV) )
bMuzzleFlash++;
}
And if this piece of coding (that I made in about a minute) doesn't work, well I am noob programmer so you have to ask another programmer.
-
- Novice
- Posts: 17
- Joined: Mon Apr 21, 2008 12:39 pm
- Personal rank: UT Master
Re: modding rifles???
First of all thanks for your great help m8{UTM}Warrior wrote:Yea that would be great.
I would like to creat a rifle when while your standing still or crouched you'll shoot fast. I thought that they use the name 'crossfire' for it.
Hopefully someone can help us out
Would you like to add me for helping me out via msn or something?
I really appreciate that.
My msn is: m.schuiling@hotmail.com
Greets,
-
- Novice
- Posts: 10
- Joined: Mon Apr 21, 2008 10:20 am
Re: modding rifles???
Thanks for ya help there mate I am receiveing this error message when compiling my project :NormalFire overrides version in parent class its a longshot but does anyone have any idea what I have done wrong ??? Once Again any much apreciated!!!
-
- Godlike
- Posts: 5498
- Joined: Wed Feb 27, 2008 6:24 pm
- Personal rank: Work In Progress
- Location: Liandri
Re: modding rifles???
Strange...*/)nT... wrote:Thanks for ya help there mate I am receiveing this error message when compiling my project :NormalFire overrides version in parent class its a longshot but does anyone have any idea what I have done wrong ??? Once Again any much apreciated!!!
First off, which version of UT are you running (v432 or v436 or another one), and which version of Ued (1.0 or 2.0)?
Second, post here your code to see what the problem might be.
-
- Novice
- Posts: 10
- Joined: Mon Apr 21, 2008 10:20 am
Re: modding rifles???
Hi version 451 and unreal ed 2.0 (which fails to open with general protection fault) Ive been wondering if that would cause the problem lol
Here is my code :
unction Fire (float Value)
{
if ( (AmmoType == None) && (AmmoName != None) )
{
GiveAmmo(Pawn(Owner));
}
if ( AmmoType.UseAmmo(1) )
{
GotoState('NormalFire');
bPointing=True;
bCanClientFire=True;
ClientFire(Value);
TraceFire(0.00);
}
}
state NormalFire extends NormalFire
{
function EndState ()
{
Super.EndState();
OldFlashCount=FlashCount;
}
Begin:
FlashCount++;
}
function Timer ()
{
Thanks for your help mate much appreciated
Here is my code :
unction Fire (float Value)
{
if ( (AmmoType == None) && (AmmoName != None) )
{
GiveAmmo(Pawn(Owner));
}
if ( AmmoType.UseAmmo(1) )
{
GotoState('NormalFire');
bPointing=True;
bCanClientFire=True;
ClientFire(Value);
TraceFire(0.00);
}
}
state NormalFire extends NormalFire
{
function EndState ()
{
Super.EndState();
OldFlashCount=FlashCount;
}
Begin:
FlashCount++;
}
function Timer ()
{
Thanks for your help mate much appreciated
Last edited by */)nT... on Tue Apr 22, 2008 6:18 pm, edited 1 time in total.
-
- Godlike
- Posts: 5498
- Joined: Wed Feb 27, 2008 6:24 pm
- Personal rank: Work In Progress
- Location: Liandri
Re: modding rifles???
First off, v451 of UT crashes Ued2.0 for sure, that's the main problem of your editor. You have to Downgrade your UT version to v440 or v436 (i have 436 with no problems at all), because v451 has that "bug" wich crash Ued2.0.
Second, yep, you made a mistake when you were writing your code, so this is the problem:
1) You only use "extends" or "expands" on the definition of the subclass, like:
Class YourClass extends ParentClass
And in your code this is already there:
2) As writed above, then this you coded is wrong:
state NormalFire
So delete the "extends NormalFire" and the problem is solved
The same apllies to all "states" that you have badly placed "extends whatever"
I hope this solves your problem
Second, yep, you made a mistake when you were writing your code, so this is the problem:
1) You only use "extends" or "expands" on the definition of the subclass, like:
Class YourClass extends ParentClass
And in your code this is already there:
So you don't have to use this anymore in the rest of your code, you have to use this only on the first line of your codeclass CcKrifle extends TournamentWeapon;
2) As writed above, then this you coded is wrong:
To override the state NormalFire on your parent class, you don't need and can't extend it, so the right form is:state NormalFire extends NormalFire
state NormalFire
So delete the "extends NormalFire" and the problem is solved
The same apllies to all "states" that you have badly placed "extends whatever"
I hope this solves your problem
-
- Novice
- Posts: 10
- Joined: Mon Apr 21, 2008 10:20 am
Re: modding rifles???
Hi thanks mate sorted that part now its failing on this lol
type mismatch in =.
Failing here : X=AdjustedAim;
here is the part of the code :
PawnOwner=Pawn(Owner);
Owner.MakeNoise(PawnOwner.SoundDampening);
GetAxes(PawnOwner.ViewRotation,X,Y,Z);
StartTrace=Owner.Location + PawnOwner.EyeHeight * Z;
AdjustedAim=PawnOwner.AdjustAim(1000000.00,StartTrace,2 * aimerror,False,False);
EndTrace=StartTrace + Accuracy * (FRand() - 0.50) * Y * 1000 + Accuracy * (FRand() - 0.50) * Z * 1000;
X=AdjustedAim;
EndTrace += 100000 * X;
Other=PawnOwner.TraceShot(HitLocation,HitNormal,EndTrace,StartTrace);
ProcessTraceHit(Other,HitLocation,HitNormal,X,Y,Z);
is that enough of the code ?
Once again thanks for your much appreciated help
type mismatch in =.
Failing here : X=AdjustedAim;
here is the part of the code :
PawnOwner=Pawn(Owner);
Owner.MakeNoise(PawnOwner.SoundDampening);
GetAxes(PawnOwner.ViewRotation,X,Y,Z);
StartTrace=Owner.Location + PawnOwner.EyeHeight * Z;
AdjustedAim=PawnOwner.AdjustAim(1000000.00,StartTrace,2 * aimerror,False,False);
EndTrace=StartTrace + Accuracy * (FRand() - 0.50) * Y * 1000 + Accuracy * (FRand() - 0.50) * Z * 1000;
X=AdjustedAim;
EndTrace += 100000 * X;
Other=PawnOwner.TraceShot(HitLocation,HitNormal,EndTrace,StartTrace);
ProcessTraceHit(Other,HitLocation,HitNormal,X,Y,Z);
is that enough of the code ?
Once again thanks for your much appreciated help
-
- Godlike
- Posts: 5498
- Joined: Wed Feb 27, 2008 6:24 pm
- Personal rank: Work In Progress
- Location: Liandri
Re: modding rifles???
Well, the problem when that error ocurrs is when you type:
Variable A = Variable B
but the variable type A is different from type B, which means that if you have, for example, Variable A as a String and Variable B as a Integer, of course you can't equal Characters to Numbers, do you understand?
So, your problem here is exactly this: you can't have X = AdjustedAim, because:
X is a Vector variable
and
AdjustedAim is a Rotator variable
which means that X represents a point at 3D space, and AdjustedAim represents an orthogonal rotation at 3D space, so you can't equal a Vector to a Rotator.
You have to find another way to build that part of code, if it's really needed to.
Variable A = Variable B
but the variable type A is different from type B, which means that if you have, for example, Variable A as a String and Variable B as a Integer, of course you can't equal Characters to Numbers, do you understand?
So, your problem here is exactly this: you can't have X = AdjustedAim, because:
X is a Vector variable
and
AdjustedAim is a Rotator variable
which means that X represents a point at 3D space, and AdjustedAim represents an orthogonal rotation at 3D space, so you can't equal a Vector to a Rotator.
You have to find another way to build that part of code, if it's really needed to.
-
- Novice
- Posts: 10
- Joined: Mon Apr 21, 2008 10:20 am
Re: modding rifles???
Hi mate im really getting confused now as i am new to this (very)lol ive tried decompiling different guns and recompiling them straight back up and they seem to fail on similar things but they havnt even been modified? yet they all work fine before this proccess are there any tutorials on doing this as i carnt find one anywhere
it seems the code that my rifle is failing to compile with is the same as a few others yet they work fine before being decompiled
Thanks for your help mate Its just a pity im too noobish at this to understand fully lol
Im just about ready to give up on the idea lol
it seems the code that my rifle is failing to compile with is the same as a few others yet they work fine before being decompiled
Thanks for your help mate Its just a pity im too noobish at this to understand fully lol
Im just about ready to give up on the idea lol
-
- Godlike
- Posts: 5498
- Joined: Wed Feb 27, 2008 6:24 pm
- Personal rank: Work In Progress
- Location: Liandri
Re: modding rifles???
Well, decompiling weapons sometimes give you errors when you compile them again, without modifying nothing, for example, the Guided Redeemer gives you an error about a texture when you recompile it. LOL
Just coment that line, like:
X=AdjustedAim
now replace by:
//X=AdjustedAim
to convert that code line to a comment
then recompile and if it doesn't give you any errors at all, then try your weapon and see where it fails in game.
Then tell here where it fails
Just coment that line, like:
X=AdjustedAim
now replace by:
//X=AdjustedAim
to convert that code line to a comment
then recompile and if it doesn't give you any errors at all, then try your weapon and see where it fails in game.
Then tell here where it fails
-
- Novice
- Posts: 10
- Joined: Mon Apr 21, 2008 10:20 am
Re: modding rifles???
Hi once again thankyou
it now fails here lol
FireDir=P.ViewRotation;
Type missmatch in =.
lol
it now fails here lol
FireDir=P.ViewRotation;
Type missmatch in =.
lol
-
- Godlike
- Posts: 5498
- Joined: Wed Feb 27, 2008 6:24 pm
- Personal rank: Work In Progress
- Location: Liandri
Re: modding rifles???
Well, exactly the same story I told you previously
FireDir=P.ViewRotation
FireDir is a Vector
ViewRotation is a Rotator
Then, do the same thing I told you previously:
Replace that line with:
//FireDir=P.ViewRotation
To make it a comment, then recompile a see what happens
P.S.: I think I will write a simple tutorial on how to do a simple rifle, this weekend , because your doubt is maybe the doubt of many more starting UnrealScript coders
FireDir=P.ViewRotation
FireDir is a Vector
ViewRotation is a Rotator
Then, do the same thing I told you previously:
Replace that line with:
//FireDir=P.ViewRotation
To make it a comment, then recompile a see what happens
P.S.: I think I will write a simple tutorial on how to do a simple rifle, this weekend , because your doubt is maybe the doubt of many more starting UnrealScript coders
-
- Novice
- Posts: 10
- Joined: Mon Apr 21, 2008 10:20 am
Re: modding rifles???
Hi I changed the line to a comment and it failed again somewhere else lol
a simple tutorial would be great help as I would really like to learn then I can maintain and change rifles ect if I choose
that would be very much appreciated and useful!!
Thanks for your help
a simple tutorial would be great help as I would really like to learn then I can maintain and change rifles ect if I choose
that would be very much appreciated and useful!!
Thanks for your help