Page 1 of 2

Custom rifle and UTPURE - Problem with scope.

Posted: Tue Feb 12, 2008 6:12 pm
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

Posted: Tue Feb 12, 2008 6:24 pm
by Dare
Thanks for the info :wink: I am sure it will come in handy to many people with this problem.

Posted: Tue Feb 12, 2008 8:07 pm
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.

Posted: Tue Feb 12, 2008 8:11 pm
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.

Posted: Tue Feb 12, 2008 8:25 pm
by Dare
What is FOV?

Posted: Tue Feb 12, 2008 8:31 pm
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.

Posted: Tue Feb 12, 2008 8:45 pm
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.

Posted: Tue Feb 12, 2008 9:38 pm
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.

Posted: Tue Feb 12, 2008 10:12 pm
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...

Posted: Tue Feb 12, 2008 11:04 pm
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

Posted: Wed Feb 13, 2008 12:16 am
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');
			}
		}
	}

Posted: Wed Feb 13, 2008 5:59 am
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.

Posted: Wed Feb 13, 2008 1:20 pm
by [FsA]Lordinario
Yeah... Strange....

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

Thanks Dane.

Re: Custom rifle and UTPURE - Problem with scope.

Posted: Thu Mar 13, 2008 6:18 pm
by Church
yea i have had to scpoe go out on me lol not that i need it :face:

Re: Custom rifle and UTPURE - Problem with scope.

Posted: Fri Mar 21, 2008 1:10 pm
by look_of_hell
:tu:


goooddd