Hello again!
I've made a small casino mini game in one of my towns. By playing the games, the player can win Yellow Casino Chips. These can be upgraded to Green, then Blue, then Red when the player holds 99 (current item MAX) of the lower tier Chip. The chips can be cashed in for a number of prizes from their respective tiers.
I was moving right along, getting the first game to play flawlessly, when I discovered the maximum of 99 items despite throwing money at the game NPC. In order to prevent players from losing money from winning with no reward, I tried to implement a counter of sorts where the game keeps track of the number of Chips you hold with a variable. Basically the relevent Event code looks like this
You Win!
Change Items: Yellow Casino Chip +10
Control Variables: [0003: Yellow Casino Chip] +=10
You Lose
Nothing happens, Event ends.
At the very top of the event, I have it check the [0003 Yellow Casino Chip] variable to see if it's 99, and if so, prevent the player from playing the mini-game. The NPC seems to ignore this check. To debug, I made a Treasure Chest give 99 Yellow Chips, Add 99 (+=99, same as the Game NPC) to the variable and a Debug NPC to tell me how many I had. That seems to work. The Game NPC then correctly prevents the player from playing the casino game.
The problem seems to come from the counter not building from the Casino NPC. Might it possible that the game only displays 99, but the counter itself exceeds 99 and that maybe why the game isn't catching it... BRB testing...
Final Edit: Yep, that's exactly what was happening. The Variables can exceed the Max Carry Item limit, so when my NPC was rewarding 10 each, the counter skipped right over the 99 check. Once I told it to check >= (greater than or equal to) instead of simply == (exactly equal to), the NPC started blocking the player from playing.
Mods, I read the part where you don't was us 'mini-modding', so uh, consider this help topic closed as I seemed to have solved it myself.
Thanks for your help!
