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 Message in HUD

Author
Message
Game Guru 345
16
Years of Service
User Offline
Joined: 30th Dec 2007
Location:
Posted: 3rd Jan 2009 06:55
Hey All

How can i display a simple command or message in the HUD?

hope you can help!
SikaSina Games
16
Years of Service
User Offline
Joined: 5th Dec 2007
Location: Reading, UK
Posted: 3rd Jan 2009 13:14 Edited at: 3rd Jan 2009 13:16


I think that might work. I'm a kinda n00b to scripting now as I just started lol.

Oh, and read this link: This is NOT a request board

-FCV

Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 3rd Jan 2009 16:03
FCV your getting their a little more practice but try this




]
Dar13
16
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 4th Jan 2009 03:42
Why put hudsizey=786 at all? Why not let the user make their image what ever size they want? Just asking as ive never used that command in a HUD script before.

I know not with what weapons WWIII will be fought but WWIV will be fought with sticks and stones-Albert Einstein
Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 4th Jan 2009 03:47
good point he can take that out. I didn't notice that i put that in.

]
Game Guru 345
16
Years of Service
User Offline
Joined: 30th Dec 2007
Location:
Posted: 4th Jan 2009 07:34
Ok this is gonna sound REALLY N00000BY but ive tried and i really dont know how to use this?

Can anyone care to explain?Once i know i will be able to do it foreva!

Soz
SikaSina Games
16
Years of Service
User Offline
Joined: 5th Dec 2007
Location: Reading, UK
Posted: 4th Jan 2009 12:47
Quote: "Why put hudsizey=786 at all?"


Oops, forgot to take that out .


Quote: "Ok this is gonna sound REALLY N00000BY but ive tried and i really dont know how to use this?"


Copy your HUD into FPS gamecore\huds and name it message1.dds or something. Then in the code saying 'hudimagefine=X' put gamecore\huds\message1.dds into it. Also, best if you create an entity with this script in the MAIN option .

-FCV

Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 4th Jan 2009 16:52 Edited at: 4th Jan 2009 17:11
Quote: "

:state=0:plrdistwithin=40,hudreset,hudx=50,hudy=50,hudsizey=786,hudimagefine=[huddirectory],hudname=hud,hudmake=display,hudshsow=hud,state=1

:plrdistfurther=40:hudunshow=hud,state=0

"


You shouldn't loop the state that creates the hud.
You only need to create it once.

Also...

:state=0:plrdistwithin=40,
That condition is on the wrong side of the colon.

First Company Veteran used much cleaner code.
But his state=2 has an error...

:state=0:hudreset,hudx=50,hudy=50,hudsizey=786,hudimagefine=[huddirectory],hudname=hud,hudmake=display,hudhide=hud,state=1
:state=1,plrdistwithin=40,state=2
:state=2,hudshow=hud,state=3
:state=3,plrdistfurther=40,hudhide=hud,state=0


...that semicolon should be a colon.
And even though he created the hud in a separate state he still looped it.

Here is a script that will do it, which you can find in the Official FPSC Guide by Nickydude...


You would supply your own image for objectives.tga
The script above uses the Tab key to display your message.
The script below is modified to work with zones...



I haven't tested the last one yet but it should work.

SikaSina Games
16
Years of Service
User Offline
Joined: 5th Dec 2007
Location: Reading, UK
Posted: 4th Jan 2009 17:05
Woohoo! I'm trying to add a sound in aswell, but all it does is play the sound in the game even when I'm 600 meters away from the entity or something.I put the code before the HUD initialization fyi.

-FCV

Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 4th Jan 2009 17:20 Edited at: 4th Jan 2009 17:49
Quote: "Oh, and read this link: This is NOT a request board"

He did not request a script.
He simply asked HOW to do something.
The forums are for support and learning.
How can he learn if he can't ask how to do something?

Here is your answer and
...

You need to create a HUD that has your mesage to be displayed.
This is a two step process with the first step of actually creating the image. (we used objectives.tga in example)
The second part is to create the HUD itself, which is done in state=0
I create all HUDs in state=0 as to avoid looping that state. (you only need to create the HUD once)

State=1 checks to see the if player is within the zone and if so we make the sound (plrsound) and display the HUD. (hudshow)
As you can see, the sounds are located in your audiobank.
After displaying the image and making the sound we move on to state=2.

State=2 checks to see when we leave the zone, so it can then remove the HUD. (hudunshow)
Then we go back to state=1 to wait for the next time the player enters the zone.

Have Fun!

And don't forget to read the manual and the fspcguide that came with FPSC. (in the DOCS folder)
The stickies at the top of the forums have a lot of good info too.
Also, take note of the Thread Subject Search box at the lower left of this page.
Most of your questions have already been answered and you can find the answers there.

Welcome to the FPSC Scripts forum.

SikaSina Games
16
Years of Service
User Offline
Joined: 5th Dec 2007
Location: Reading, UK
Posted: 5th Jan 2009 18:24
Sorry, I kinda thought it was a request...D'oh...

@CE,

Thank you for the script, the only thing is, plrwithinzone doesn't exist, so it would plrdistwithin and plrdistfurther wouldn't it?

-FCV

Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 5th Jan 2009 22:46 Edited at: 5th Jan 2009 23:06
Quote: "the only thing is, plrwithinzone doesn't exist"

It doesn't exist?
Well, I guess that I have been imagining myself using it for the last 3 years then.

To quote the Official FPSC Guide... (its in the FPSC manual too (always has been))

Quote: "
PLRWITHINZONE
is true when player is within the trigger zone
"


Here is a side note for that too.

Not only do triggers have zones but every entity does. (Not many people realize this at first)
So, any entity can use plrwithinzone, not just trigger zones.
I personally have a habit of using the plrwithinzone condition alot.
That started right after I found out that it wasn't just for triggers.

Quote: "so it would plrdistwithin and plrdistfurther wouldn't it?
"

Yeah, but for simple functions like this the plrwithinzone works fine.
They do allow for better control of distances though should you need something more specific.

Game Guru 345
16
Years of Service
User Offline
Joined: 30th Dec 2007
Location:
Posted: 5th Jan 2009 22:53
Hey all

Thanks for the help, i will now go and try and do all this! THANKS!

SikaSina Games
16
Years of Service
User Offline
Joined: 5th Dec 2007
Location: Reading, UK
Posted: 6th Jan 2009 16:42
Quote: "It doesn't exist?
Well, I guess that I have been imagining myself using it for the last 3 years then."


I thought it never existed as it was never highlighted on FPI Editor (I use that sometimes)

-FCV

Login to post a reply

Server time is: 2024-11-24 16:28:14
Your offset time is: 2024-11-24 16:28:14