For direct access use https://forums.oldunreal.com
It's been quite a while since oldunreal had an overhaul, but we are moving to another server which require some updates and changes. The biggest change is the migration of our old reliable YaBB forum to phpBB. This system expects you to login with your username and old password known from YaBB.
If you experience any problems there is also the usual "password forgotten" function. Don't forget to clear your browser cache!
If you have any further concerns feel free to contact me: Smirftsch@oldunreal.com

Fading a Sprite in and out by distance? (solved)

The section related to UnrealScript and modding. This board is for coders to discuss and exchange experiences or ask questions.
User avatar
Krull0r
Global Moderator
Posts: 543
Joined: Sun Jul 01, 2007 4:07 pm

Fading a Sprite in and out by distance? (solved)

Post by Krull0r »

Hello :)


Is it possible to make a Sprite fading in and out depending on its VisibilityHeight, -Radius and ScaleGlow?


I'm using a small hand symbol that show the player ingame where he can use the grab key. The Sprite has a VisibilityHeight and Radius of 256.
Actually the Sprite appears and disappears instant after entering or leaving the "VisibiltyZone".


For example when the player is 256 units away from the sprite it should be invisible and if he comes closer to the sprite it should become more visible and maybe a max VisibiltyZone would be nice. ( 256 Units away, Invisible - Fade to 96 Units -> there it should be 100 % Visible )



Is there any possibility to achieve something like that?
Last edited by Krull0r on Sun Jul 02, 2017 12:37 pm, edited 1 time in total.
Image
User avatar
gopostal
OldUnreal Member
Posts: 1007
Joined: Thu Jul 31, 2008 9:29 pm

Re: Fading a Sprite in and out by distance?

Post by gopostal »

That's a pretty easy effect to pull off. Just change either the transparency or drawscale to be a factor of the distance to the player. Since you are drawing this on the player's HUD you'll have full control with no need of input from the server.

I'm not a big fan of altering it to be "see-through", I think the better effect is to make the hand larger as you get near and maybe add color when it's usable. There's just too many maps with fog, smoke, weird background alpha channels that could interfere with your effect, etc.
I don't want to give the end away
but we're all going to die one day
User avatar
Krull0r
Global Moderator
Posts: 543
Joined: Sun Jul 01, 2007 4:07 pm

Re: Fading a Sprite in and out by distance?

Post by Krull0r »

Oh okay. I don't really have any Idea how to do this :)


The "Hand" sprite is an actor placed above carcasses, consoles, buttons and levers.
And the sprite texture is a decent pulsing material sequence so the player will notice:"oh there is something blinking. I should check this out".

The Hand is only planed for my project. So there will be no trouble with other maps.
Image

Return to “UScript Board”