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 / Overlapping huds

Author
Message
MTC Music
19
Years of Service
User Offline
Joined: 11th Sep 2005
Location: Montreal
Posted: 17th Aug 2012 18:57
Is it possible to have 2 huds overlay. I am making an educational game which displays a question on a hud. When the player presses a key corresponding to on eof the answers, another hud with a highlight of the given answer should appear directly over the question hud. Unfortunately, it doesn't. If I set the hudx to different values for the question hud and answer/highlight hud, it displays (but not overlapping).
I tried changing the hudz values, thinking that this might set the hierarchy arrangement of the huds, but no success.

Does anyone have a suggestion on how I could get 2 huds to overlap and display simultaneously?

Thanks in advance for any help!

www.mtcmusic.ca
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 17th Aug 2012 19:33 Edited at: 17th Aug 2012 19:47
You can have multiple huds overlapping. The key to getting them to appear properly is where they are defined in the script. In other words, it all has to do with where "in the list" you define the huds.

For example... I will use a map we are currently working on in our Egyptian development. We have a hud with image of a desert, and at the bottom of the map is an X and the letter A indicating a location the player will journey to.



The player can view some information about the location by pressing A. The second hud image appears over-top the first. Note: the second hud contains no writing on it yet, but is part of the map.



At a further point in the game, the map will have multiple locations (A-L) and the player will be able to view the location huds over-top the first map hud by the letter they select. As you can see, it is a similar idea to your process.

The key to getting it to work as it should is how the huds are defined in your script (or laid out for overlapping). Using my example, I defined the huds like this:



The first line is the hud for the map, the second line is the red X, and the third line is the second hud that looks like a stone tablet. If I add another hud, it would be defined in the fourth line, and will appear above all the others.

If I switch the last two huds around, like the following in my script...



...then I end up with this when the player presses A:



The red X appears over-top the tablet hud, even though the second hud is not called until the player presses A to display it. If I define the tablet hud first then the map hud second, the tablet would appear behind the map hud. It is all about the position it is defined in the script.

This is how you need to "layer" your huds in your script for ideas like this. The background one is first, then the one you want next, and so on. Hopefully this helps to get you in the right direction.


Twitter: @NFoxMedia
Pirate Myke
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, Ca
Posted: 18th Aug 2012 05:56
Very useful tip Blackfox. Thanks for the info.

King Cobra
13
Years of Service
User Offline
Joined: 4th Apr 2011
Location: California
Posted: 18th Aug 2012 09:15
Awesome stuff BlackFox!! Thank you for this wonderful tip!

Cheers and beers ,

King Cobra
King Cobra
13
Years of Service
User Offline
Joined: 4th Apr 2011
Location: California
Posted: 18th Aug 2012 09:18
PIRATE MIKE:

Just noticed you're in Van Nuys, CA. I'm in Long Beach...about 45 minutes south of you...

Great seeing other "Angelenos" on the forum...

Cheers and beers ,

King Cobra
Pirate Myke
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, Ca
Posted: 18th Aug 2012 09:24
MTC Music
19
Years of Service
User Offline
Joined: 11th Sep 2005
Location: Montreal
Posted: 18th Aug 2012 15:25
Wow! Thank you so much BlackFOx. That was not only very clear but also very interesting! I really appreciate the time you took to explain it so clearly.

This will make my whole hud layout much more elegant.

Thank you

www.mtcmusic.ca
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 18th Aug 2012 15:36
Glad to be of help and pass on "some of the knowledge". It is little things like this that tend to drive developers nuts. Good thing I keep notes on all these techniques.


Twitter: @NFoxMedia
The Storyteller 01
15
Years of Service
User Offline
Joined: 11th May 2009
Location: On a silent hill in dead space
Posted: 18th Aug 2012 20:54 Edited at: 18th Aug 2012 20:57
Thanks for explaining it so graphically @BF - I have bookmarked this thread in my "tutorial" folder

On a sidenote, I assume I can define the layer of a hud independent from the sequence in the script (or even change it with a later script) with the HUDLAYER =X Y command.

And on another sidenote, RAWTEXT seems to always sit on top of other huds although it technically is a hud itself.

In case you find my grammar and spelling weird ---> native German speaker ^^
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 18th Aug 2012 22:38
Quote: "On a sidenote, I assume I can define the layer of a hud independent from the sequence in the script (or even change it with a later script) with the HUDLAYER =X Y command."


Since we are working in our v1.17 source, we do not have that command. HUDLAYER was brought into the source in v1.18 and around the same time the GUI-X9 was integrated. I had assumed it was tied to that, but again since we don't have it we could not be certain to its actual usage.

Quote: "And on another sidenote, RAWTEXT seems to always sit on top of other huds although it technically is a hud itself."


RAWTEXT does sit on the top each time. I had RAWTEXT displaying in between two huds showing and it always sat on the very top of the two huds. No matter where I call it in a script with huds, it is always on top. The behavior is like a "print string" command, or "echo" command.


Twitter: @NFoxMedia
Liquid Blaze
12
Years of Service
User Offline
Joined: 3rd Aug 2012
Location:
Posted: 19th Aug 2012 13:31
Which key is the command to open the map?
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 19th Aug 2012 15:48
Quote: "Which key is the command to open the map?"


It would depend on how you code your script. Most times I use the M key, so I would use a script like the following as an example:



I usually attach this to a trigger and have the trigger spawn when the player picks up a map entity. This way they can then press M at any point in the game (if they pick up the map first that is) to view the map.


Twitter: @NFoxMedia

Login to post a reply

Server time is: 2024-11-23 23:01:48
Your offset time is: 2024-11-23 23:01:48