|
Post by WarDragon on Oct 20, 2004 16:53:27 GMT -5
Can some one help me on my HUD display
|
|
|
Post by Doan the Nado on Oct 20, 2004 17:29:07 GMT -5
I can probably help you, but I need to know what you need to display, and where. Also, Jugem may be an asset in this area, because as you may have seen on his demo video, he had an HP display in the upper left when he was in the cave at the end of the video. The key will be to use VFX along with action scripts and a Sort command.
I'll help you out,
Doan the Nado
|
|
|
Post by WarDragon on Oct 20, 2004 17:59:37 GMT -5
I want to display the Health and the Magic. Also I want it to take the health away when the character is attacked
|
|
|
Post by Doan the Nado on Oct 21, 2004 10:16:24 GMT -5
I have a pretty good idea of how I would suggest doing it, but I still need a few more bits of information. Do you want them to display as a number (CHP/MHP), or do you want it to display like a life bar? Jugem used colored boxes to show his health, and it looked pretty good (similar to LoZ's heart system). Also, how high is your max health and max MP going to be? If you have bars, do you want them to stay the same "full" size, or do you want the bars to get bigger as the maximum health and mp get bigger?
If you're curious what would be the easiest, in my opinion, the easiest thing would be to have life and magic bars that are always the same size. An action script would then multiply current HP (or MP) by 10 and then divide by max HP. If the answer came to 0, no life would be displayed. If 1, 1/10 life would be displayed, and so on. Depending on how many different divisions you wanted, you could multiply by numbers other than 10.
At any rate, let me know what you want, and I'll tell you how to make it,
Doan the Nado
|
|
|
Post by WarDragon on Oct 21, 2004 13:44:19 GMT -5
|
|
|
Post by Doan the Nado on Oct 21, 2004 14:02:32 GMT -5
I can't see the pic.
I tried going to the site, but it says "Forbidden" to me.
|
|
|
Post by WarDragon on Oct 21, 2004 14:43:08 GMT -5
|
|
|
Post by Doan the Nado on Oct 22, 2004 2:18:18 GMT -5
Okay... sorry for all the questions, but there's one more thing. How high is your max life and max money going to be? I ask because it will affect how the script will be written. Specifically, I need to know how many digits it will be. The less digits, the easier it will be, but don't limit your game because of this; I just want to alert you to that fact.
By the way, since that screenshot is from Crimson Knight's game, I sent him an ezInbox message to see if he'd be interested in coming here and helping you out with this.
He may be able to do it better than I could,
Doan the Nado
|
|
|
Post by WarDragon on Oct 22, 2004 11:52:03 GMT -5
The max Hp is 200 and the max money is 300
|
|
|
Post by Jugem on Oct 22, 2004 17:10:39 GMT -5
Since your max HP and money is so high, I would guess that you want them displayed as numbers. So I'll tell you how I made the money HUD element in my game. First off, create a 2D VFX for symbol you want to represent HP/Money/Magic/etc. Whether it is text (ie. "HP") or a small picture is up to you. Now create a seperate 2D VFX for each digit in the display. And make sure they are positioned correctly so that the second digit VFX will be displayed to the right of the first digit VFX. Do this for each digit (0-9), so that you have 30 VFX with all the possible 3 digits combined. Now create a single event for each digit (so 3 events for a 3-digit number), and another event for the symbol. Create action scripts for each event's motion slot. In the symbol event's script, use the Apply Together command followed by a command calling the VFX on that event. Similarly, create scripts for the three digit events. Now comes the slightly tricky part. You'll need to look at only one digit of the number for each script. So for the first digit, assign some variable the value of (Current_HP / 100). This will assign the first digit of a three digit number (Current_HP) to the variable. Then use a sort command to display the correct first digit VFX to this event. Don't forget to use Apply Together before displaying the VFX. Create scripts for the other two digits in a similar fasion. The calculations for the 2nd and 3rd digits are as follows: 2nd Digit = ((HP / 10) % 10) 3rd Digit = (HP % 10) Now duplicate these events in your "enter map" script, and you should have a HUD up and running. Notice that it will be a static HUD, as you haven't done anything that will allow it to change yet. To get it to change when you take damage (for example), you'll need to create another script that will be called immediately after the HP variable is decreased. In this new script, you should remove each of the events for the three digits, and then duplicate them again. This will erase the old display, and update it with the new values. This is one way of getting a HUD to work. There may be simpler ways of doing this, but hopefully this will help you. And if you need any further help/clarification, feel free to ask.
|
|
|
Post by Doan the Nado on Oct 22, 2004 17:18:11 GMT -5
Nice explanation, Jugem, that's precisely the method I was going to have him use.
Thanks for helping me out,
Doan the Nado
|
|
|
Post by WarDragon on Oct 25, 2004 18:05:57 GMT -5
I have my system up and running thanks Jugem
|
|
|
Post by BloodKnight on Oct 28, 2004 18:18:16 GMT -5
Since I saw this topic, I wanted to get the stuff needed to help you with the HUD I use, but I guess I took too long since you already got help, so I'm glad you can use a good one now.
|
|
|
Post by WarDragon on Oct 30, 2004 10:00:16 GMT -5
you could still explain your HUD system. i'm willing to try new ideas
|
|
|
Post by Jugem on Oct 30, 2004 14:53:30 GMT -5
Yeah, I'm curious as to how any others implemented their HUDs.
In fact, I'm having one small problem myself. When the game is paused, I want to display some parts of the HUD that don't usually appear, except briefly when an item is aquired. For example, my money counter. Whenever a coin (silver) is acquired in my game, the coin display appears for a second or two. But I want it to appear when the game is paused.
To try and get it to display, I'm duplicating the event (which displays the VFX). However, the VFX doesn't appear until after the script finishes executing (when the player unpauses the game). The only other thing I can think of doing is displaying the VFX directly on the screen, and not duplicating an event to do this. However, then I'd have to use the clear all VFX command to get rid of them when the game is unpaused. And I assume that would also get rid of all other VFX being displayed (including any enemies, background VFX, etc.), which is undesirable.
Anyone have any ideas? I've tried a number of things (using the event to display the VFX), but just can't seem to figure this out. This is actually an old problem; I've sinced moved on to other aspects of my game, thinking I'll get around to this later. So I haven't given it my full attention yet. But seeing as how we're discussing HUD displays now...
|
|
|
Post by vespuleth on Oct 31, 2004 1:32:33 GMT -5
yeah, when you duplicate an event, the graphic shows up after the script its duplicated from is completed.
|
|
|
Post by Jugem on Oct 31, 2004 15:26:44 GMT -5
Just had an idea come to me this morning, but I haven't had a chance to try it out yet. Instead of having the pause menu "stuff" happen in the square button script, I could just duplicate another event in this script. This event's auto (content-type) script could then display the HUD VFX and then execute all the pause menu stuff in that script. Either that, or duplicate the HUD events in the square button script before duplicating the new pause menu event. That way, the HUD should show up while the pause menu is displayed. I sure hope this will work.
|
|
|
Post by Jugem on Nov 1, 2004 15:52:55 GMT -5
Figured out a solution to my problem. I actually feel stupid for not thinking of this earlier. Instead of trying to get the VFX to display in the VFX event (when it is duplicated), I duplicated the event and displayed the VFX on that event from a seperate script using the Event Control Change command. Works like a charm.
|
|
|
Post by Tacticalman on Nov 16, 2004 14:16:24 GMT -5
Question: ur huds wont work if the player can rotate the camera, right? Im just wondering, and i havent tried to work on it too much.
|
|
|
Post by Jugem on Nov 16, 2004 14:23:50 GMT -5
Question: ur huds wont work if the player can rotate the camera, right? Im just wondering, and i havent tried to work on it too much. Actually, they will work. The 2D setup for VFX will display the VFX at a set location on the screen at all times, regardless of where the camera is facing (or any other factors).
|
|
|
Post by Tacticalman on Nov 16, 2004 15:41:37 GMT -5
Thanx Jugem!
|
|
|
Post by WarDragon on Dec 15, 2004 13:29:06 GMT -5
Here is how you make a Heal Guage display make an action script with this in it.
sbc repeat 0 fixed off sbc variable: Health<0 sbc end sbc variable: Health=1 apply together event effect [health1] apply inorder sbc end sbc variable: Health=2 apply together event effect [health1] event effect [health2] apply inorder sbc end
and so on now to make it max out at a certain number use
sbc variable health>11 apply together event effect [health11] apply inorder sbc end sbc repeat end
|
|