Kafluffle

Villager
Member
Joined
Apr 22, 2022
Messages
6
Reaction score
0
First Language
English
Primarily Uses
VNM
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
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
37,621
Reaction score
10,342
First Language
German
Primarily Uses
RMMV
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.
 
  • Like
Reactions: Bex

Kafluffle

Villager
Member
Joined
Apr 22, 2022
Messages
6
Reaction score
0
First Language
English
Primarily Uses
VNM
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.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
37,621
Reaction score
10,342
First Language
German
Primarily Uses
RMMV
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
 

Kafluffle

Villager
Member
Joined
Apr 22, 2022
Messages
6
Reaction score
0
First Language
English
Primarily Uses
VNM
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.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
37,621
Reaction score
10,342
First Language
German
Primarily Uses
RMMV
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.
 
  • Like
Reactions: Bex

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
6,962
Reaction score
4,795
First Language
English
Primarily Uses
RMMV
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 :wink:
 

Latest Threads

Latest Profile Posts

That moment when I am listening to another instructor teach and I am thinking…I have been doing this for almost 30 years…I know this material…I teach this material…and you are confusing the crap out of me…let alone the students. What the actual $&@#! are you talking about? :eek:
Help me make a choice. Which one makes more sense?
A. Range style 1.pngDiamond shape
B.Range style 2.png Square shape
I created a skill that can only be used if there are enemies within the player's range. When the player's range is 2, which one do you think is more appropriate to describe the range area?
Just once I would like to see some innocent person stumble upon a body in a crime show and instead of scream they sigh and just say, "Found another one."
Can we get like a RPGM VXA Pro edition with all the limits gone!!
I drew @TheoAllen 's Cecilia~

yVLlTmK.png

Forum statistics

Threads
128,356
Messages
1,193,865
Members
168,851
Latest member
fireboy619
Top