Home › Forums › Puzzles › Morph Factors – dynamic Health/HP limiting health restored to health bar frame
- This topic has 14 replies, 2 voices, and was last updated 2 days, 18 hours ago by c4cc.
-
AuthorPosts
-
2024-12-31 at 10:06 am #79607c4ccParticipant
I’m trying to create an object’s Morph Factor (B) which value is limited by that of another object’s morph factor (A). Both A and B values can change depending whether they’re near certain objects. I need to get the difference between A and B to determine the limits of B’s morph factor.
My puzzle’s not working:
- This topic was modified 2 days, 18 hours ago by c4cc.
2024-12-31 at 1:42 pm #79608c4ccParticipant2024-12-31 at 6:38 pm #79611xeonCustomerYou will need to validate that the conditions of your logic are actually occurring?
I suggest adding some simple print to console statements for each condition so you can validate if the conditions you are testing are firing as expected.
Values from the getmorph puzzle is a “number” so you can do what ever math you want to it and stick it back into a setmorph puzzle.
Xeon
Route 66 Digital
Interactive Solutions - https://www.r66d.com
Tutorials - https://www.xeons3dlab.com2024-12-31 at 7:07 pm #79612c4ccParticipant2024-12-31 at 7:20 pm #79613xeonCustomerYou may want to try using the Clamp puzzle. If you have two morph values A and B and B is to always be less than A and assuming they have the same morph value ranges (0 to 1) then you can just use the clamp puzzle to ensure the B morph value is less than the A value minus. 0.1 but will allow it to be any value between 0 and .9.
Xeon
Route 66 Digital
Interactive Solutions - https://www.r66d.com
Tutorials - https://www.xeons3dlab.com2025-01-01 at 3:27 am #79615c4ccParticipantCould you tell me where I got clamp wrong? What I’m trying to do is an upgradeable life bar, like in the Megaman (X) games
- This reply was modified 1 week, 6 days ago by c4cc.
2025-01-01 at 9:12 am #79620c4ccParticipant2025-01-10 at 3:32 am #79753c4ccParticipantMorph Factors – dynamic Health/HP limiting health restored to health bar frame
I’m trying to create an HP bar upgradable up to 5 times, and restoring health 20% of health bar per healing item. How do I use morph factor to capture/store the latest health frame value after upgraded to prevent the health from extending past it?
HealthBar Frame has 0 value at default morph factor, and 1 at max.
HealthBar has 0.5 value at default morph factor, 0 at minimum and 1 at max.
Think of video games like Megaman X where the health bar is upgradeable, but the health restored cannot exceed the upgraded health bar frame size.
Problem is, after the 2nd health upgrade, I cannot get the health restored to be within the limits of the upgraded health frame. As per below, when I tried to apply [0.6] and above for the healthbar morph factor as indicated, the health bar cannot get healed.
Is there a more “economical” way for me to simplify this health upgrading process, like javascript looping function? Obviously it’s inefficient to repeat same code for different value.
verge3d app attached
https://drive.google.com/file/d/1yO4sZ6mjgWa25o0SUMtOfXib9DEO4T4Q/view
2025-01-10 at 6:22 am #79757xeonCustomerHere is a simple example of a health bar using Shape Keys.
https://cdn.soft8soft.com/AROAJSY2GOEHMOFUVPIOE:f2f27a4091/x3l_healthbar.zip
Blend file included.There are two cubes – left and right. Clicking on the left cube simulates something that would deduct from health…..the right cube simulates and input that would add to the health.
Hope this helps.
Xeon
Route 66 Digital
Interactive Solutions - https://www.r66d.com
Tutorials - https://www.xeons3dlab.com2025-01-10 at 8:29 am #79759c4ccParticipantThanks for the effort but unfortunately that’s not what I need. What I really need is a healthbar that is restored up to a limit when healed. Only time the healthbar’s limit gets bigger after getting into contact with upgrades.
Here at 0.30 – 0.33, the yellow healthbar on the top left of screen is at max, even though it comes into contact with health items. At 2:15, the yellow healthbar is upgraded. At 2:27 – 2:30, the healing items do not exceed the health bar frames
2025-01-10 at 8:38 am #79761xeonCustomerPerhaps if you have a storyboard that explains what you need. Health bars in most games have a set size and the thing that changes is the range amount. As an example at level 1 the health bar might be 0-100 while at level two the bar values might be 0-200 but the bars dimensions do not change only the values. Is this what you are wanting? Do you have a storyboard you can share ?
Xeon
Route 66 Digital
Interactive Solutions - https://www.r66d.com
Tutorials - https://www.xeons3dlab.com2025-01-10 at 9:10 am #79763c4ccParticipantNo story for my game. It’s just that the health bars’ dimensions I use would increase with health upgrades. Even in the megaman game I shared just now, the physical dimension of the health bar did increase after upgrades
Only in the pokemon games, the health bars’ dimensions did not increase physically
- This reply was modified 4 days, 3 hours ago by c4cc.
2025-01-11 at 5:06 am #79770xeonCustomerWell…after re-reading this thread I believe our communication is more the issue than the problem you “might” be having. So let me see if I can try a different form of communication to get us on tract.
Let start by defining the “The Health Bar” – this would be the white frame, the black background, the grayed out “leds” and the colored leds.
Lets further define the request as a method of doing this via “shape keys” and math functions that change the values from shape keys to drive the animation of the “Health Bar”.
I dont believe this is the best approach based on the example you provided. I would suggest using textures to create the “Health Bar” and its animation. I would not recommend using shape keys for this at all.
However…if your project requires you to use shape keys as you have stated, then the example I provided will work. Note: the health bar does not change shape, it does not grow in dimension at any time in the video you provided. The only activity you see is the health bar led bar indicator increasing and decreasing based on inputs.
In the sample file, as soon as you max out your health…even if you keep clicking the right cube the health bar doesn’t get any bigger. It will be up to you to take this example and extrapolate to your use case.
I have updated the example to include a frame and a division so you can see one approach. Again…this would be best achieved with a texture not a mesh.
I hope this is helpful, if not, I may not be understanding the request…but try this latest version and see if this is the effect.
Xeon
Route 66 Digital
Interactive Solutions - https://www.r66d.com
Tutorials - https://www.xeons3dlab.com2025-01-11 at 9:21 am #79771c4ccParticipantThanks for your time and effort, unfortunately, I need the health bar frame to increase, after getting health upgrades, and health bar does not go beyond the limit. I only want health bar to have max level depending on the health bar frame:
How does textures work in the case of increasing dimensions?
Example of what I want:
Here at 2:46-2:48, player health is upgraded. At 3:02, health items do not go more beyond the healthbar frame- This reply was modified 3 days, 3 hours ago by c4cc.
2025-01-11 at 6:18 pm #79777c4ccParticipantOk, actually I think I’ve figured out the problem – change the shape key from 0 to 0.5:
Updated puzzles
New updated puzzles and Blend file:
https://drive.google.com/file/d/1yO4sZ6mjgWa25o0SUMtOfXib9DEO4T4Q/view
Now my only problem is that the shape key in verge3d is black at 0.5, yet when it increases, it switches to its intended color. Why?
HealthBar Frame’s shape key at 0.5:
After increasing shape key:
- This reply was modified 2 days, 17 hours ago by c4cc.
-
AuthorPosts
- You must be logged in to reply to this topic.