logo
Main

Forums

Downloads

Unreal-Netiquette

Donate for Oldunreal:
Donate

borderline

Links to our wiki:
Wiki

Walkthrough

Links

Tutorials

Unreal Reference

Usermaps

borderline

Contact us:
Submit News
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Centered weapons not exactly centered (Read 226 times)
paralemptor
New Member
*
Offline


Oldunreal member

Posts: 3
Joined: May 26th, 2018
Centered weapons not exactly centered
May 26th, 2018 at 10:24am
Print Post  
There is one thing that annoys me with Unreal. I always preferred to play the game with centered weapons. I remember ages ago, when the game was still being patched by Epic, one of the updates moved the weapons from the center to be slightly to the right. And I hate it passionately!

Here is a comparison I made:


As you can see, the old version is centered, while the new one is off to the right side.

Is there a way to restore the centered-centered weapon position in ver 227i? I was sort of expecting the oldWeapons mutator to not only bring back the old sounds, which I love, but also restore the positioning, but it doesn't.

Please advise Smiley
  
Back to top
 
IP Logged
 
Masterkent
Developer Team
Offline



Posts: 1040
Location: Russia
Joined: Apr 5th, 2013
Gender: Male
Re: Centered weapons not exactly centered
Reply #1 - May 27th, 2018 at 10:49pm
Print Post  
paralemptor wrote on May 26th, 2018 at 10:24am:
I remember ages ago, when the game was still being patched by Epic, one of the updates moved the weapons from the center to be slightly to the right. And I hate it passionately!

I can't say that I don't like that offset too much, but I'd prefer truly centered weapons too. Obviously, the shifting was implemented intentionally, but I have no any idea why Epic decided to do so.

paralemptor wrote on May 26th, 2018 at 10:24am:
Is there a way to restore the centered-centered weapon position in ver 227i?

Theoretically, there are two ways to make most of the weapons (but not all) truly centered: by means of modifying Engine.u or by means of a mod.

The first method implies the following change in Engine.Weapon.SetHand:

Code
Select All
PlayerViewOffset.Y = -0.2 * Default.PlayerViewOffset.Y; 


should be replaced with

Code
Select All
PlayerViewOffset.Y = 0; 


Some weapons (e.g. UnrealShare.Automag and UPak.RocketLauncher) need special offsets to be centered properly.

Since this code is executed server-side, you may still get weapons shifted when joining a network game.

Alternatively, it's possible to modify Engine.Weapon.RenderOverlays instead:

Code
Select All
simulated event RenderOverlays( canvas Canvas )
{
....
	else
		bSetFlashTime = false;

+	if (int(PlayerViewOffset.Y) == int(-0.2 * default.PlayerViewOffset.Y * 100))
+		PlayerViewOffset.Y = 0;
	SetLocation( Owner.Location + CalcDrawOffset() );
	NewRot = Pawn(Owner).ViewRotation;

	if ( Hand == 0 )
		newRot.Roll = -2 * Default.Rotation.Roll;
	else
		newRot.Roll = Default.Rotation.Roll * Hand;

	setRotation(newRot);
	Canvas.DrawActor(self, false);
} 


This change would take effect client-side (so it could work in an online game if the server accepts clients with modified packages).

The second method implies that some mod (e.g., a mutator) would monitor weapon's PlayerViewOffset.Y for all PlayerPawns and if it's equal to -0.2 * default.PlayerViewOffset.Y * 100 for the given weapon, reset it to zero.
« Last Edit: May 28th, 2018 at 9:23am by Masterkent »  
Back to top
 
IP Logged
 
paralemptor
New Member
*
Offline


Oldunreal member

Posts: 3
Joined: May 26th, 2018
Re: Centered weapons not exactly centered
Reply #2 - May 28th, 2018 at 5:48am
Print Post  
Thank you very much for the detailed answer! I'm totally unfamiliar with the scripts and any inner workings of the Unreal engine (the only things I did do quite a bit back in the day was... Quake 1 and its QuakeC), but I'll try and catch up Smiley
  
Back to top
 
IP Logged
 
Masterkent
Developer Team
Offline



Posts: 1040
Location: Russia
Joined: Apr 5th, 2013
Gender: Male
Re: Centered weapons not exactly centered
Reply #3 - May 28th, 2018 at 9:27am
Print Post  
You can try to copy the files from this archive to the System subdirectory:
https://www.upload.ee/files/8491736/Unreal_227i_fix.7z.html

Back up the original Engine.u, UnrealShare.u, and UPak.u before replacing them.
  
Back to top
 
IP Logged
 
paralemptor
New Member
*
Offline


Oldunreal member

Posts: 3
Joined: May 26th, 2018
Re: Centered weapons not exactly centered
Reply #4 - May 28th, 2018 at 12:56pm
Print Post  
Thank you very much! Seems to be working fine Smiley

edit - I do think about experimenting with the unreal script anyway and doing some things on my own. Does any of it translate to UE4 by any chance, or have they changed the scripting method completely?
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint
Bookmarks: del.icio.us Digg Facebook Google Google+ Linked in reddit StumbleUpon Twitter Yahoo