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 / Make popup image fadeout by pressing key

Author
Message
blauweogen
14
Years of Service
User Offline
Joined: 20th Nov 2010
Location: Florida
Posted: 13th Dec 2010 17:45
I am not to good on scripting yet. I am trying to figure out how I can make the popup image I have, go away by pressing a key, Say "H" key.

I have tried things, but I must be doing it wrong. Here is the script without the key part.
:state=0:hudreset,hudx=50,hudy=60,hudimagefine=gamecore\text\message1.png,hudname=message1,hudhide=1,hudmake=display,state=1
:state=1,plrdistwithin=60:hudshow=message1,hudfadeout=message1

I tried adding some code for scancodekeypressed=35, but no luck. Anyone know how?

I figure it would be nice to have it popup automatically, then go away by key press. (instead of walking away with this big image in the way)
Gencheff
14
Years of Service
User Offline
Joined: 12th Jun 2010
Location: UK by way of USSR
Posted: 13th Dec 2010 17:53
Quote: "Anyone know how?"

The correct question was is anyone willing to help lol.

Correct version :

:state=0:hudreset,hudx=50,hudy=60,hudimagefine=gamecore\text\message1.png,hudname=message1,hudhide=1,hudmake=display,state=1
:state=1,plrdistwithin=60:hudshow=message1,state=2
:state=2,scancodekeypressed=35:hudfadeout=message1,state=3

So that's pretty much it.The hud appears when the player is within 60 units and if he presses H , it fades out.

blauweogen
14
Years of Service
User Offline
Joined: 20th Nov 2010
Location: Florida
Posted: 13th Dec 2010 19:04
Fantastic! I was close. Thanks for being willing to help, I'll go try it.
Seth Black
FPSC Reloaded TGC Backer
19
Years of Service
User Offline
Joined: 22nd Feb 2005
Location: Pittsburgh, PA
Posted: 13th Dec 2010 19:04 Edited at: 13th Dec 2010 19:06
EDIT: Beat me to it.

blauweogen
14
Years of Service
User Offline
Joined: 20th Nov 2010
Location: Florida
Posted: 17th Jan 2011 14:49
Just a note: I added ,destroy after state=3 because when I got to the next popup, it would show the first one fading away and then the second one when i pressed the key. This seems to fix it.

http://XtremeFPSgames.com
Starship Down Now Released!

Login to post a reply

Server time is: 2024-11-24 14:07:47
Your offset time is: 2024-11-24 14:07:47