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 / How to make "press enter to use" not appear?

Author
Message
Cyborg ART
17
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden - Sthlm
Posted: 20th Oct 2007 17:15
I would like to know if there is a way to make the hud showing "Press enter to use" not appear because i think its kind of disturbing.
I tried to change the hud to totaly black but it didnt work.
If someone knows, please tell me.

Thanks, BVG

Visit our new website! www.bigvikinggames.tk !New Forum is up!
Follow the progress of Lost Treasures
Avid
17
Years of Service
User Offline
Joined: 24th Jun 2007
Location:
Posted: 20th Oct 2007 17:18
You tried altering the alpha channel to being just black aswell?
Cyborg ART
17
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden - Sthlm
Posted: 20th Oct 2007 17:49
And how do I do that?

Visit our new website! www.bigvikinggames.tk !New Forum is up!
Follow the progress of Lost Treasures
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 20th Oct 2007 17:52 Edited at: 20th Oct 2007 17:54
Yes, this is very simple to do.

I'll use the "Door Use" entity as an example.

You'll see in it's properties that the Main AI used for it is the "dooruse.fpi" script.

Let's go into that script and take a look at WHY that hud is being shown...

When we open it up we see the following code:



I'm gonna break it down to you very simply so you can have an easier understanding of what's going on:

First line where state=0 basically loads the hud image under the name "usedoorprompt" and then hides it for later use.

Second line where state=10 basically checks to see if the player is within 60 units of the door entity. If the player is, then it will run these two commands which I will elaborate on:

hudshow=usedoorprompt
This command will force the hud image named "usedoorprompt" to be shown at the screen coordinates that it was loaded to. (In this case the hud is at 50% of screen width and 90% of screen height) Take note that the hud will REMAIN shown until told to fade away or be hidden.

hudfadeout=usedoorprompt
This command will cause the hud image to fade out and THEN be hidden. It is being used on the same line as the show command which can be a little confusing to some people. Let me explain. This line will always be run constantly while the player is within the distance being checked for (60 units) and as such will constantly be shown then faded out. But why don't we see it being faded all the time? The answer is: We do! But the fadeout counts down the alpha value every loop, and every loop the show command renews that alpha value back to 100%!!! And so, the fadeout command does not have enough time to completely fade it out before it's being shown again! However, once the player steps out of the distance being checked for (60 units), the fadeout command will then continue to run and fade it out completely, as intended.


So how do we stop this? Simple... delete the second line that shows and hides the hud then change the first line to this:



Save it, then test your game! The hud should not be shown as normal.


Please keep in mind that you just replaced the default dooruse.fpi, so all usable doors will act like this. If that's what you want, then great! It sure does save time having to go into the properties for every usable door you want to make, but I would make a habit out of backing up the original for later use, just in case.


Hope that mini tutorial helped you and others out!


The one and only,
~PlystirE~

Dammit, Jim! I'm a programmer not a graphic designer!!!

(P)suedo code (L)inguist, (Y)ou (Sti)ll (R)eap (E)verything
Cyborg ART
17
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden - Sthlm
Posted: 20th Oct 2007 21:01
Thanks! That worked great for me!

Visit our new website! www.bigvikinggames.tk !New Forum is up!
Follow the progress of Lost Treasures
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 20th Oct 2007 22:05
You are most welcome, I wrote a tutorial for people who want to get into scripting. Just now finished Tut #2, so check it out. I covered this exact section of script in that tutorial, so it may be worth your while.


The one and only,
~PlystirE~

Dammit, Jim! I'm a programmer not a graphic designer!!!

(P)suedo code (L)inguist, (Y)ou (Sti)ll (R)eap (E)verything

Login to post a reply

Server time is: 2024-11-23 23:58:39
Your offset time is: 2024-11-23 23:58:39