How to draw something lower on the screen without affecting the Y value?

Discussions about Coding and Scripting
Zerofinity
Novice
Posts: 15
Joined: Sat Jun 07, 2025 8:24 pm

How to draw something lower on the screen without affecting the Y value?

Post by Zerofinity »

I know that title probably sounds really weird, so let me explain: I'm trying to modify a mutator for personal use and am mostly succesful, but 1 problem is that the rotating arrows it draws on the screen are placed too high. Moving them to the left and right is no problem, but up and down is.

The arrows are controlled by a vector with 3 values controlling some combination of size and x-axis for the first value, x-axis only for the second value, and space between the arrows for the third value.

The part that controls height is this line: DrawOffset += PawnOwner.EyeHeight*vect(0.0, 0.0, 1.0);

I find that if I replace "PawnOwner.EyeHeight" with about 18.0 it initially seems to give me a good height (before further tweaking), but moving the camera up and down causes the arrows to change position with the same pattern as a swing moving towards and away from the screen, and my very limited knowledge on code is not enough to fix that. I've tried (PawnOwner.EyeHeight + or - a value) and also DrawOffset.y (in both cases keeping the other lines original of course) but neither changed that behavior.

So, since the Y value is apparantly a direct part of how the arrows work, is there any way to shift their position on the screen without changing the Y value?
JackGriffin
Godlike
Posts: 3829
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: How to draw something lower on the screen without affecting the Y value?

Post by JackGriffin »

Is this something you are drawing on the HUD or is seen in the world? If you are talking about something like a floating health on each character I had a seriously hard time getting that correct. As soon as your view angle got more than 30 degrees or so off it would cause the number to slide away like you are talking about. If you want you can email me and I'll help you fix this code: agutgopostal at gmail or hotmail, I use both. I don't check in so often so I may not reply if you still need help.
This is a really old demo video of how the problem got fixed: Sorry for the quality but I made this in maybe 2008 lol.
So long, and thanks for all the fish
Zerofinity
Novice
Posts: 15
Joined: Sat Jun 07, 2025 8:24 pm

Re: How to draw something lower on the screen without affecting the Y value?

Post by Zerofinity »

Thanks for the reply. With some changes the X-Ray Glasses solution you posted in my topic where I was looking for a mutator to see Domination points would work better for me than getting this to work instead, but just in case that won't work out, I'll send you that e-mail.
JackGriffin
Godlike
Posts: 3829
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: How to draw something lower on the screen without affecting the Y value?

Post by JackGriffin »

It all depends on what your vision is for what you are wanting to create. The idea of a little floating arrow works and it's very clean. However here's how I look at it: You want to let the player know they need to move in a certain direction to a selected spot (say a porch on a random house). I can give you a compass that you look down at and see where it's pointing then orient yourself so that you head in that direction. You can also just turn on a porch light at the house and work your way towards that light. To me it's just easier to have a beacon existing in your vision that overlays the spot you need to head towards.
That being said design the thing YOU want to play the way you want to play it. The most joy in developing lies in moving the thing you thought up out into the play space and making it do what you intended.
So long, and thanks for all the fish