Loop Variable Switch Issue

I want to make a virtual pet sort of aspect to my game, and while I have figured out how to interact with them, I can't get them to visibly regain health. Which is sort of the point of a game. Basically, I have set the health variable to 100 and after a 120 frame wait time I have it lose health and change the heart image to reflect that. I can get it to automatically lower the health to the point where it dies, and incremental images reflect that but doing things that improve health do not change the image despite it being a loop based on the health variable.

I have no plugins, and this is being run as a parallel common event. I do not define health in the common event for fear of it replacing the already set value and not counting down.

Basically, my question is, where in this code / how do I communicate a health increase so that the image changes? I have nothing regarding healing in this code as this is the dying part that works. I have tried a lot of things already (different loops, placements, switches, ect) but at this point would like to know how somebody better at this than me would go about it.

So, disregarding the actual 'call to heal' which is located in other events that do change the health variable how do I get this code to reflect the new health images?

From my point of view, the loop figures out what number range the health is and returns an image and since it is a loop it should recheck every time it runs, but that is not the case. Instead, it can never return a higher image value that what it went to so it can go from 100 -> 80's image but not 80's image to 100's. So there has to be something in here that is not allowing that right? I thought by turning off all the other options with switches I would be able to change the image, but that is not the case.

Basically, I just want the loop to be able to change the image in reverse, it can already change images 100 -> 0 but not 0 -> 100 and I would like to know why. It seems with the annoying off switches or not nothing changes, but that was my best guess.

Thank you, I'm hoping it is something obvious I missed. I'm sorry for rambling I'm bad at explaining things.

codeHealth.png
most likely the cause of your problem is outside the content.
an event is more than just its content, and the setting and properties determine how that content is handled. So I suggest you give a full screenshot of the event window, as well as a screenshot of whatever is supposed to react to those switches.
Then we can check what went wrong.
most likely the cause of your problem is outside the content.
an event is more than just its content, and the setting and properties determine how that content is handled. So I suggest you give a full screenshot of the event window, as well as a screenshot of whatever is supposed to react to those switches.
Then we can check what went wrong.
Above was the full common event code, it runs in parallel.

This is the first event of the game that calls the common event, it is also in parallel
starter.png

At this point everything works, it lowers the health variable by the ding within the common event loop.

This is an example of a health increase; this one is also parallel.
kitchen.png

This specific one happens outside of the main room but seems to impact the health correctly as there is a longer delay between image switches for lowering health. The transfer works so I know the event is being called.

I have tried other ways to increase health, but I figured as long as I directly modify the variable health it should have the same result. I have also tried making it a switch within the common event loop, but that did not work to change the image either.

Regardless, no matter how I edit things or move them around, I cannot get a higher health image to appear once I have already showed a lower one, which makes me think it is an issue with the common event code which is posted in its entirety on my original post.
first, parallel processes automatically loop, having a second loop inside a parallel loop is always bad.

second, the properties are more than just the trigger, so please provide full screenshots.

third, NEVER CALL A PARALLEL COMMON EVENT!!!!!

if you have a common event on parallel, activate its switch.
only call a common event that has trigger=none
first, parallel processes automatically loop, having a second loop inside a parallel loop is always bad.

second, the properties are more than just the trigger, so please provide full screenshots.

third, NEVER CALL A PARALLEL COMMON EVENT!!!!!

if you have a common event on parallel, activate its switch.
only call a common event that has trigger=none
Ah okay thanks. I never see anybody use parallel processes for a good reason, I guess.

So, I changed the common event to autorun and called it with a switch inside an event that was parallel and got rid of some of my loops and it seems to work now, so thank you. Though I still have no idea what exactly was broken, I am not going to look a gift horse in the mouth.

Anyway, thank you I suppose this is resolved.
I never see anybody use parallel processes for a good reason, I guess.
ironically your reason for using a parallel process was a good one here, it just needs to be done correctly. and turning it into an autorun should have created more problems.

parallels can be tricky, but they have their place in the engine - it's just that many users don't understand their limits that causes problems.

if it works now OK, but next time please provide full screenshots especially of the page numbering, because that is important for disabling parallels and autoruns on the map.
next time please provide full screenshots especially of the page numbering, because that is important for disabling parallels and autoruns on the map.
This is very important - I looked at this thread last night and didn't see any clear error in your event.

If you hadn't cropped your screenshot, I would've seen it was parallel with a loop inside and told you that was a problem right off 😉

Original thread: https://forums.rpgmakerweb.com/threads/loop-variable-switch-issue.153134/