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.

Author
Message
2S!K
12
Years of Service
User Offline
Joined: 21st Jul 2012
Playing: Working on "This Is Home" an FPSc project
Posted: 20th Jul 2013 10:25
Ok I have been working on a script for my game and I cannot seem to get it to work properly. I want this script to display a note (hud) as I hold the action key and fade away when I release the key. My script works great the first time around however the next time you wish to view the note it appears as you release the action key and fades out.

[:state=0:hudreset,hudx=50,hudy=50,hudsizex=400,hudsizey=700,hudimagefine=languagebank\english\gamecore\huds\user\Note1.DDS,hudname=Note 1,hudhide=1,hudmake=display,state=1
:state=1,plrusingaction=1:hudshow=Note 1,state=2
:state=2,plrusingaction=0:hudfadeout=Note 1,state=0]

Now I have tried many different variations of this and none have seemed to work the way intended to. I have searched the forums for an answer but I haven't found anything similar to an action key detector script as I want mine to be. Any help?
Tomahawk
11
Years of Service
User Offline
Joined: 16th Dec 2012
Location: Where do you think I live?
Posted: 20th Jul 2013 16:39
Just a quick thought would be to loop it to state=1 so the last line would look like this: :state=2,plrusingaction=0:hudfadeout=Note 1,state=1

that may work just the first thing i thought of.

[url=http://forum.thegamecreators.com/?m=forum_view&t=204113&b=25]
2S!K
12
Years of Service
User Offline
Joined: 21st Jul 2012
Playing: Working on "This Is Home" an FPSc project
Posted: 21st Jul 2013 05:39 Edited at: 2nd Aug 2013 08:17
Double Post!

2S!K Productions
2S!K
12
Years of Service
User Offline
Joined: 21st Jul 2012
Playing: Working on "This Is Home" an FPSc project
Posted: 21st Jul 2013 05:39
Thanks for the help I figured out the problem 5 minutes after posting that is what I did after viewing a simple door script and realizing it was being looped to check if the player was in distance.

Here is my script free for the taking goes great in horror games adds a touch of mystery!

Please note that you must change the directory to locate your hud. If you wish to use more than one note then you must name huds differently (hudname=example1). Just use this script as entities main script and make sure it is dynamic.

;Artificial Intelligence Script

;Header

desc = Note Hud

;Triggers

:state=0:hudreset,hudx=50,hudy=50,hudimagefine=languagebank\english\gamecore\huds\user\Note.DDS,hudname=Note,hudhide=1,hudmake=display,state=1
:state=1,plrdistwithin=60:fpgcrawtextsize=38,fpgcrawtextfont=Chiller,fpgcrawtextr=225,fpgcrawtextg=255,fpgcrawtextb=255,fpgcrawtextx=50,fpgcrawtexty=85,fpgcrawtext=Press ENTER to read.
:state=1,plrdistwithin=60,plrusingaction=1:state=2
:state=2,plrusingaction=1:fpgcrawtextoff,hudshow=Note,hudfadeout=Note,etimerstart
:state=2,etimergreater=1500:state=1

;End of Script
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 21st Jul 2013 16:20 Edited at: 21st Jul 2013 18:59
I had that problem in the past using hudfadeout
I can't remember the details now, but I think I could get it to work by calling the hudshow twice in separate states, but it was flakey
In the end, I just used hudunshow instead

Tomahawk is right about the returning to state 1 instead of 0
You only need to create the HUD once, so state=0 would not be in the loop

if that doesn't work , then try this...



That simplifies it a bit and should give you the effect you want

Login to post a reply

Server time is: 2024-11-23 14:11:36
Your offset time is: 2024-11-23 14:11:36