Coding Problem: How to change your Weight image depending on how much Damage has cut out your HP

I’m PISSED, I can’t figure this out and every attempt has continued to piss me off further. I am trying to do a simple Mirror event where the mirror should show you the Weight Stage the specified Character is at. And that Weight Stage being shown would be determined by how much the damage from just about anything has cut into your current Max HP Bar, with extra stages being locked away based on how much HP you actually got all together.
Please show images of your coding and the stuff that got it to work.
I work on RPGMaker MZ, only a weekend of experience mainly working with the map but will eventually need to work on the Weight Gain Mechanic so why not do it now to get it out of the way, and trying to do coding for a simple Mirror Weight Reflection is breaking my brain, and pissing me off.
For those who know how to do it correctly, PLEASE, HOW DO YOU DO IT!?

1 Like

Ask ChatGpt. Especially since you only have a weekend of experience. If you don’t want to copy from it, just get chatgpt to give you links to information that can show you how. Or just practice more I guess.

Ok, I’ll try it. (After seeing what pulled up) NOW THIS IS WHAT I’M WANTING, A STEP BY STEP GUIDE, thx for suggesting this, I thought it would be just like ai Google but no it’s actually a proper step by step guide of what I want. Imma try out as soon as I can and will return with a report. Either I’ll feel like I’m in heaven or Imma feel like ripping my hair out again. It even said the idea was creative, so sweet.

Please bear in mind ChatGPT is prone to making mistakes with even the simplest of code. Whatever it has given you may work, but if it doesn’t then there can be a lot of back and forth before it spits out the correct code. More troubling is if something does go wrong, or you want to adapt your system in the future, you don’t actually know how your code works so you’re constantly relying on an AI to make your game function.

I don’t have any experience with MZ, but the pseudo-code (written words that just look like code) should go something like this:

currentHealthLost = maxHP - currentHP

If currentHealthLost >= largest weight threshold
    Show largest weight sprite
Else if currentHealthLost >= 2nd largest weight threshold 
    Show 2nd largest weight sprite
...
Else
    Show smallest weight sprite

The formatting here may be a bit funky due to me being on mobile, but if you can figure out how to implement that pseudo-code into whatever programming language MZ uses then that should work.


I’m just confused with the wording now, how should I put it in?

How should I organize the Variables?

I FIGURED IT OUT!!! FINALLY!!!
Now Imma just copy this mirror to a Test Chamber to keep it safe and paste it to the other mirror places and once I figure out how to let the computer know who’s in front, I can copy the info and alter it for everyone else. FINALLY


I remembered what I was told before, figured out I needed to connect Variable to Game Data (not another variable) , and BOOM! problem solved.
Finally, it works

2 Likes