Custom rifle and UTPURE - Problem with scope.

Get some cool tips about how to tweak your UT graphic, gameplay, and much more!
[FsA]Lordinario
Novice
Posts: 20
Joined: Tue Feb 12, 2008 1:11 pm

Custom rifle and UTPURE - Problem with scope.

Post by [FsA]Lordinario »

If you are running UTPURE on your server and you have custom rifles, there's a chance that the scope does not work as supposed to.

This is because of the way the Weapon has been coded.

The Symptoms: When you try to zoom, you get the scope to tremble, but never actually zooms.

The solution: Search on your server Unrealtournament.ini (or corresponding file. In my Linux server is server.cfg) for a parameter in the UTPURE section called TrackFOV

If it reads something different from TrackFOV=0 then change it to match the 0 value. (Most times it reads the value 2).

Restart your server, and that should be it.

Lordi
User avatar
Dare
Inhuman
Posts: 899
Joined: Tue Feb 05, 2008 4:26 pm
Personal rank: UT99 God
Location: England FTW
Contact:

Post by Dare »

Thanks for the info :wink: I am sure it will come in handy to many people with this problem.
Image
Image
User avatar
TheDane
Masterful
Posts: 660
Joined: Tue Feb 12, 2008 2:47 pm
Personal rank: Happy fool :-)

Post by TheDane »

STOP!!!!

setting it to 0 will allow FOV cheats.

the only way to fix it 100% is to recode the script and add a hudmutator that will make the rifle UTpure compatible, this is all you need to add to the rifle realy :
class AMLPClanRifle_HUDMutator expands Mutator;

var PlayerPawn HUDOwner;

simulated event PostRender( canvas Canvas )
{
if (HUDOwner != None && HUDOwner.Weapon != None)
{
// if (Owner.Weapon.IsA('ClanRifleAMLP')) // You may want to enable this.
HUDOwner.Weapon.PostRender(Canvas);
}
}

defaultproperties
{
}

then add in the rifle script :
simulated event PostNetBeginPlay()
{
local AMLPClanRifle_HUDMutator crosshair;
local PlayerPawn HUDOwner;

Super.PostNetBeginPlay();

// If owner is the local player, check that the HUD Mutator exists. Also check for the presense of a bbPlayer (UTPure enabled)
HUDOwner = PlayerPawn(Owner);
if (HUDOwner != None && HUDOwner.IsA('bbPlayer') && HUDOwner.myHUD != None)
{
ForEach AllActors(Class'AMLPClanRifle_HUDMutator', crosshair)
break;
if (crosshair == None)
{
crosshair = Spawn(Class'AMLPClanRifle_HUDMutator', Owner);
crosshair.RegisterHUDMutator();
crosshair.HUDOwner = HUDOwner;
}
}
}
now ofcause change the names of the packages to your rifles names.
Retired.
Myth
Inhuman
Posts: 988
Joined: Tue Feb 12, 2008 5:57 pm
Personal rank: Low Poly Freak

Post by Myth »

What Dane said is true.
When I first discovered that I could set any key on the keyboard to execute a command, then I thirst thought of... FOV
So on unreal (not UT) I actually made mouse wheel to zoom. That was ownage. I pwned every monster from distance whit a pistol.
User avatar
Dare
Inhuman
Posts: 899
Joined: Tue Feb 05, 2008 4:26 pm
Personal rank: UT99 God
Location: England FTW
Contact:

Post by Dare »

What is FOV?
Image
Image
Myth
Inhuman
Posts: 988
Joined: Tue Feb 12, 2008 5:57 pm
Personal rank: Low Poly Freak

Post by Myth »

FOV = field of view
Determines how much you see.
For example if you set FOV to 180, you can actually see sideways.
Having a low FOV zooms in.
[FsA]Lordinario
Novice
Posts: 20
Joined: Tue Feb 12, 2008 1:11 pm

Post by [FsA]Lordinario »

True with the FOV.

But, in my case, I have the code added, but the problem is still there.
Maybe the problem is in another part of my weapon.

Let's check
This is my RifleHUDMutator.uc file in the class folder of my weapon:
class RifleHUDMutator extends Mutator;

Code: Select all

var PlayerPawn HUDOwner;

simulated event PostRender( Canvas Canvas )
{
	if (HUDOwner != None && HUDOwner.Weapon != None)
	{
		if (HUDOwner.Weapon.IsA('Rifle'))	// You may want to enable this.
		HUDOwner.Weapon.PostRender(Canvas);
	}
}

defaultproperties
{
}
This is added to my weapon in the Rifle.uc file :

Code: Select all

simulated event PostNetBeginPlay()
{
	local RifleHUDMutator crosshair;
	local PlayerPawn HUDOwner;

	Super.PostNetBeginPlay();

	// If owner is the local player, check that the HUD Mutator exists. Also check for the presense of a bbPlayer (UTPure enabled)
	HUDOwner = PlayerPawn(Owner);
	if (HUDOwner != None && HUDOwner.IsA('bbPlayer') && HUDOwner.myHUD != None)
	{
		ForEach AllActors(Class'RifleHUDMutator', crosshair)
			break;
		if (crosshair == None)
		{
			crosshair = Spawn(Class'RifleHUDMutator', Owner);
			crosshair.RegisterHUDMutator();
			crosshair.HUDOwner = HUDOwner;
		}
	}
}
Don't see the problem, but still it does not work.

I'll continue to check, but, in case it does not work with the script, the first solution works... and yes, allowing players to exploit FOV. Your call.
User avatar
TheDane
Masterful
Posts: 660
Joined: Tue Feb 12, 2008 2:47 pm
Personal rank: Happy fool :-)

Post by TheDane »

hmm ... do you have anything else in your rifle script that adresses this and maybe cause a conflict?

Also what version of utpure do you run?

and setting utpure to : TrackFOV=1 should also stop FOV cheats, but not be as strict with your rifle. However my rifles works with TrackFOV=2 also.
Retired.
[FsA]Lordinario
Novice
Posts: 20
Joined: Tue Feb 12, 2008 1:11 pm

Post by [FsA]Lordinario »

DFon't know if something references it... damn shouldn't have quit the Unreal coder course!!! hehehe

I Use 7G.

I'm gonna check the code to see if there's anything strange...

Also, is there any rifle source code available? Like a template or something?
Maybe the problem is that my rifle does change the FOV to do the zooming... who Knows...
User avatar
Dare
Inhuman
Posts: 899
Joined: Tue Feb 05, 2008 4:26 pm
Personal rank: UT99 God
Location: England FTW
Contact:

Post by Dare »

Myth wrote:FOV = field of view
Determines how much you see.
For example if you set FOV to 180, you can actually see sideways.
Having a low FOV zooms in.
ah yeah now i remember, fov 180 is mental, totaly wierd
Image
Image
[FsA]Lordinario
Novice
Posts: 20
Joined: Tue Feb 12, 2008 1:11 pm

Post by [FsA]Lordinario »

Maybe i was right and the rifle does change the FOV to zoom... look a this code:

Code: Select all

state Zooming
{
	simulated function Tick(float DeltaTime)
	{
		if ( Pawn(Owner).bAltFire == 0 )
		{
			bZoom = false;
			SetTimer(0.0,False);
			GoToState('Idle');
		}
		else if ( bZoom )
		{
			if ( PlayerPawn(Owner).DesiredFOV > 3 )
			{
				PlayerPawn(Owner).DesiredFOV -= PlayerPawn(Owner).DesiredFOV*DeltaTime*4.5;
			}

			if ( PlayerPawn(Owner).DesiredFOV <=3 )
			{
				PlayerPawn(Owner).DesiredFOV = 3;
				bZoom = false;
				SetTimer(0.0,False);
				GoToState('Idle');
			}
		}
	}
User avatar
TheDane
Masterful
Posts: 660
Joined: Tue Feb 12, 2008 2:47 pm
Personal rank: Happy fool :-)

Post by TheDane »

that is very normal, and the only way to actualy do a proper zoom i think?

I honestly don't know why it shouldn't work for you? I run the same version of UTPure?

I build my rifle on the script from the default rifle, I have modified it a lot over the years, but i haven't changed the core of it. So you can just exctract that script and take it from there.
Retired.
[FsA]Lordinario
Novice
Posts: 20
Joined: Tue Feb 12, 2008 1:11 pm

Post by [FsA]Lordinario »

Yeah... Strange....

Well, in another time maybe I'll redo it from scratch. hehehe...

Thanks Dane.
Church
Posts: 2
Joined: Thu Mar 13, 2008 6:11 pm

Re: Custom rifle and UTPURE - Problem with scope.

Post by Church »

yea i have had to scpoe go out on me lol not that i need it :face:
look_of_hell
Posts: 2
Joined: Thu Mar 20, 2008 4:45 pm
Personal rank: unstoppleeeeeeee

Re: Custom rifle and UTPURE - Problem with scope.

Post by look_of_hell »

:tu:


goooddd
Post Reply