Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / Display a HUD when examining an item

Author
Message
herbert west
16
Years of Service
User Offline
Joined: 30th Aug 2008
Location:
Posted: 21st Sep 2008 16:14
Hi any and all

I wanted the player to be able to press Use when close to an item (eg box), and get it to display a text image. Then, when the player walks away, the text image automatically disappears.

I managed to code it and it works (being a newbie it was a struggle!), but it only works perfectly ONCE. The second (and all subsequent)time the player presses Use, it does not display the popup. However, when the player walks away, the text image very briefly appears and then fades out. In other words, it is doing the 'fadeout' correctly! Any ideas? It's very annoying to be so close to working!

This is the code:
; Prepare the HUD
:state=0:hudreset,hudx=50,hudy=90,hudimagefine=videobank\hudpaul.jpg,hudname=paulmess,hudhide=1,hudmake=display,state=2

; If the player is close to the item, and pressing 'Use', display the HUD with a sound
:state=2,plrdistwithin=60,plrusingaction=1:plrsound=audiobank\misc\ping.wav,hudshow=paulmess,state=3

; If the player walks away from the item, fadeout the HUD and go back to State 0.
:state=3,plrdistfurther=100:plrsound=audiobank\misc\ping.wav,hudfadeout=paulmess,state=0

As a summary - it works perfectly.... but only the first time. The second and all subsequent times, it does not display the HUD, only fades it out.

Any help much appreciated!!
Minimovies Inc
16
Years of Service
User Offline
Joined: 22nd Feb 2008
Location: Reeedwwwaaallll!!!
Posted: 21st Sep 2008 23:23
This might work:

Set the last "state=0" action to "state=2".
You don't have to re-make the HUD.

A starting Games Designer. Need levels, characters and anything drawn and designed? Let me know...
herbert west
16
Years of Service
User Offline
Joined: 30th Aug 2008
Location:
Posted: 22nd Sep 2008 19:57
Thanks for that, unfortunately I already tried; it didn't make any difference.

However I'm now thinking it may be something to do with the TYPE of hud action at the end - because I've since discovered that if you use HUDUNHIDE instead of HUDFADEOUT - it works great every time!

It's a bit less cool because it just blinks out instead of fading out, but at least it cures the problem.

If anyone knows how to get the script working with the fadeout that would be useful but at least I can get the text image appearing and disappearing every time now!
Gamer X
16
Years of Service
User Offline
Joined: 1st Feb 2008
Location: Planet X
Posted: 28th Sep 2008 08:21 Edited at: 28th Sep 2008 08:22
You wanted the script to work with HUDFADEOUT and here it is.




Login to post a reply

Server time is: 2024-11-24 13:29:04
Your offset time is: 2024-11-24 13:29:04