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 / Need help with the objectives hud...

Author
Message
Mr Love
19
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 20th May 2017 11:11
So, what I want to do with scripting is to show a warning-text that shows there are new objectives, and press "O" to see the hudimage. I want the warning-text to disappear when press "O". I have tried hudtext and fpgcrawtext but nothing seems to work?
I also want to update the objectives by going to a new triggerzone.. The player shourld be able to press "O" and see the Objectives anywhere/anytime...
Here is the script:

desc = Display Objectives while O key pressed
;Triggers
:state=0,plrwithinzone=1:plrsound=audiobank\misc\ping.ogg,fpgcrawtext=NEW OBJECTIVES,state=1
:state=1:hudreset,hudx=50,hudy=50,hudimagefine=languagebank\english\gamecore\huds\objectives2.png,hudname=objectives2,hudhide=1,hudmake=display,state=2
:state=2,scancodekeypressed=24:fpgcrawtextoff,state=3
:state=2:hudunshow=objectives2
:state=3:hudshow=objectives2,state=2

;End of Script
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 20th May 2017 13:00
Mr Love
Try this, tested and works well. Add your "ping" sound to the triggerzone's sound$0.

You can also add these commands to the script (fpgcrawtextfont=CHOOSE STYLE FONT fpgcrawtextg= fpgcrawtextr= fpgcrawtextb= Amount of Green Red or Blue)
Quote: "I also want to update the objectives by going to a new triggerzone.. "

This script is the easiest way to do this. Each new triggerzone will reset the "hud"
A better way is to list all your "Objective" huds in one script and use variables to update which hud
displays as player moves along.
See how this works for you and let me know..
best
My games never have bugs. They just develop random features..
Lots and lots of random features...
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 20th May 2017 17:27 Edited at: 20th May 2017 17:30
Mr Love
Had some time to play a little with this script. Here's one that will update "Objective's Hud" as player moves
through level.
Place this in a triggerzone anywhere in level. It is the Main Hud script for Objectives.
Replace my image names for yours, as many as needed. I used 3 for testing. Update script as you go along

Use this script with a trigger or entity and place/attach where needed. All it does is display Text and add 1 to variable to change
"Objectives" Hud.

I tested several times and works perfect. If you attach to an entity instead of using a triggerzone
you will have to change "plrwithinzone" to "plrdiswithin" of course.
best
My games never have bugs. They just develop random features..
Lots and lots of random features...
Mr Love
19
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 20th May 2017 19:57
AWESOME!! Great work man! I really like when that ping pings, then You know that You have new exciting missions to play... Just one little issue (small one) The NEW OBJECTIVES popup only stay when standing inside the triggerzone. Is it possible to make it stay also outside the triggerzone???
Anyways. Fantastic job as usual....
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 20th May 2017 22:30
Mr Love
Quote: "Is it possible to make it stay also outside the triggerzone???"

Of course, very easy...but do you really want that? Right now when the player enters zone, the "update_objective" script
pops-up text, even when you leave & re-enter it, until player hits the "O" key.
But, here is an updated script so the fpsgcrawtext STAYS on screen until player hits the "O" key, but.....
it will not reactivate once used Just so you know.

My games never have bugs. They just develop random features..
Lots and lots of random features...
Mr Love
19
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 21st May 2017 15:24
Thanks, thats exactly what I wanted. Just changed the hudtext a bit and moved it to the left-upper corner. Looks good...

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-11-21 13:35:34
Your offset time is: 2024-11-21 13:35:34