Having Trouble Eventing a NPC Affection System in RPG Maker MV

So just to preface, I'm back into RPG Maker after only using 2003 and XP. I have only been using MV for about a week and I'm very rusty! But I have a basic understanding of events / variables and things like that.

In my game I have a npc named "Tessa" who will sell armors. I am trying to create a system where you can talk to this NPC, and depending on the amount of items you own that Tessa sells, her affection or friendship level with you will increase, changing her dialogue when you speak to her at different affection levels.

So first I set the NPC event and it looks like this:
0j8fBj2.png


I also have another NPC to talk to that will just display to you what her rating is for debug purposes.
dSZOlUn.png


I made a Common Event to play out the conditions that would increase her rating level:
qRtS5Pj.png


And I made a switch start on the first opening map to turn on the recording of Tessa's rating level increase conditions:
nCB2e0c.png


Before I purchase any items, the debug NPC tells me:
"Tessa's Rating is 0". So I know its checking and that it works.

I talk to Tessa and she responds with the appropriate Level 0 dialogue:
"you dont have any clothes!", so that works.

Then I purchase one of the items. And this is where it gets confusing for me.
When I go talk to Tessa again with 1 item purchased, no dialogue plays at all. The window just closes.
When I go talk to the debug NPC, it says "Tessa's Rating is (somewhere in the 100s)".
When I talk to the debug NPC again, it says Tessa's Rating is (even higher number).

So this is telling me that the Variable is rapidly increasing by 1 now that I own the item and its going infinitely and I don't have anything to stop it. Is there anything I can do about this? And is it because I have these events set to parallel or other certain settings?

Basically TLDR: any tips to make the Control Variable increase by 1 but then stop adding to it?

Thanks everyone for your time and help!
parallel events run over and over and over again, which means that it keeps counting the same item repeatedly.

I'd suggest just running the calculation at the start of each conversation with Tessa, and using a temporary AffectionPlaceholder variable, which starts from 0 each time, and overwrites the existing real Affection if it's higher (so your affection doesn't go down if you sell an outfit or something)
parallel events run over and over and over again, which means that it keeps counting the same item repeatedly.

I'd suggest just running the calculation at the start of each conversation with Tessa, and using a temporary AffectionPlaceholder variable, which starts from 0 each time, and overwrites the existing real Affection if it's higher (so your affection doesn't go down if you sell an outfit or something)
OH! Okay I got it working by putting the (equipment checks = increased rating) events in her Event before Tessa's dialogue appears with the Talk or Shop options.

This got it to properly display the correct dialogue options based on how many equipments were owned.

I guess I was over-complicating it. I thought I might be doing that haha...
If your query is fully resolved, please Report your post and ask for the thread to be closed. Mods might not see a post, but they will see a Report.
If your query is fully resolved, please Report your post and ask for the thread to be closed. Mods might not see a post, but they will see a Report.
Oh, okay. Thanks for letting me know! I was going to see if others had any more suggestions but no one ever posted. I guess its fine to close it!
Thread closed IgnoreMe

Original thread: https://forums.rpgmakerweb.com/threads/having-trouble-eventing-a-npc-affection-system-in-rpg-maker-mv.112346/