Cross hairs here and there...

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

Dexter13

The Coding Machine
Dec 18, 2001
111
0
0
Visit site
I have created a new weapon, and I want it to have a cross hair. I have used the bOwnsCrossHair=True; but nothing happens! Can anyone please help me?
 

Jack oneill

New Member
Sep 4, 2001
81
0
0
42
France
atlantis.jolt.co.uk
what have you made ?

When you make a new weapon, you don't need to make anything : you should have a crosshair.

Have you made a new HUD ?? Or do you have written a new postrender function ?
 

Dexter13

The Coding Machine
Dec 18, 2001
111
0
0
Visit site
here it is:

Here:

simulated function PostRender( canvas Canvas )
{
Local Int C;

If (bHudAmmo)
{
bOwnsCrosshair=True;//this doesnt work!!!
If (AmmoType.AmmoAmount <= ReloadCount) C = AmmoType.AmmoAmount;
Else
C = Count;
Canvas.Style = ERenderStyle.STY_Translucent;
Canvas.Font = Canvas.SmallFont;
Canvas.SetPos(0.8 * Canvas.ClipX, 0.8 * Canvas.ClipY);
if(Count < (ReLoadCount * 0.25))
{
Canvas.DrawColor.R = 255;
Canvas.DrawColor.G = 0;
Canvas.DrawColor.B = 0;
}
else
{
Canvas.DrawColor.R = 0;
Canvas.DrawColor.G = 255;
Canvas.DrawColor.B = 0;
}

}

there you have it, but I have no cross hair
 

Blödsinn machen

cannon fodder
Dec 4, 2001
68
0
0
Switzerland
dwmade.stormpages.com
setting bOwnsCrossHair to True (which should be done in the defaultproperties) prompts the player's HUD to NOT draw a crosshair - it is the job of the weapon to render a crosshair of its own in its PostRender function. Check out the code in UT_Eightball, which uses a different cursor when a target lock is acquired...
 

Mychaeel

New Member
bOwnsCrosshair indeed hides the default crosshair when set to true. With bOwnsCrosshair set, you're responsible for drawing your own crosshair in the weapon's PostRender function.

Set bOwnsCrosshair in the weapon's "defaultproperties" section. I don't know what your bHudAmmo variable is supposed to contain, but I suspect that your "bOwnsCrosshair = True" line is never executed.
 

Jack oneill

New Member
Sep 4, 2001
81
0
0
42
France
atlantis.jolt.co.uk
I think the problem is bOwnsCrosshair, but if it isn't the case, i think there is another problem. You never call :

Super.PostRender(Canvas);

It might be the problem... Else i don't understand.
 

Mychaeel

New Member
I'm a bit confused. Does he want to have the default crosshair displayed in the middle of the screen, or does he want to exclusively render his own (like the Redeemer and the zoomed Sniper Rifle do)?

If he wants the default crosshair, he shouldn't touch bOwnsCrossHair at all and leave it "false." As said before, setting bOwnsCrossHair to "true" hides the default crosshair.

The code responsible for this is in ChallengeHUD, lines 1108f (PostRender).

i think there is another problem. You never call : Super.PostRender(Canvas);
Depends on which weapon he's subclassing. Most stock weapons don't implement PostRender, with the exception of the Rocket Launcher, the Redeemer and the Sniper Rifle. But all that hasn't anything to do with the default crosshair, anyway.