MV problems trying to switch an item when performing action

hey everyone. i've been trying to look for an answer for a while and haven't come up with anything, so hopefully you'll be able to help me.

i'm trying out systems for a game and i wanted to make a sharpening stone that will buff your attack and you can use only once a day, and that wears off by next morning. my game doesn't count days in time but rather whenever an action is performed (going to sleep) and it has quite a simple night/day cycle system.

so what i did with this was:
-create two items, usable sharpening stone item that calls into a common event when used, and "fake" used sharpening stone item that cannot be used
-common event switches "sharpen" on, activates another common event running in parallel that sets a +attack state on the character if the switch is on, and turns it off if it's not
-my night trigger event checks when it becomes the next day, and switches off "sharpen" switch, effectively deactivating the +attack state (although it might not work as intended as i haven't tested battles yet)

this is the one step that's giving me problems:
-i have another common event running in parallel that checks if "sharpen" is on or off. if it's on, it takes the sharpening stone from player inventory and adds another the fake one in its place that cannot be used. but it instead adds 99 of that item even tho i've only increased it by 1. i think this is me being dumb and since it's running on parallel, it adds items constantly.

so i tried this other thing:
-the sharpen stone event that triggers the switch on also switches the item with the fake one.
-i created another event for when it is turned off that switches the item back to normal, called on by my night trigger event, so when day is on, it is supposed to activate the other event and put the stone back in place.
so like... sharpen stone on > switches items > buff on. day triggers > switches sharpen stone off > calls on another common event > puts item back into place.

for some reason this does not work, but i can't really find a why... perhaps i should use variables for some stuff but i'm very new to rpg maker and been bashing my head against the desk for a bit now... also i'm sure this has a better cleaner way to be done, so if you have any tips they're welcome!
1760190968527.png

1760191109700.png

1760191120112.png

1760191129171.png
I think it being parallel is the issue- Parallel constantly runs an event (iirc, be kind i just woke up) so with it being parallel, it's just constantly running the event behind the scenes, bringing it to 99 stones.

Have you tried turning off the parallel trigger? I feel like this is a stupid question but sometimes troubleshooting stuff like that has some really "Ohhhh..." answers ^_^"

Especially if the event is only made to run once when the stone is used, there's no need to have it parallel if that's the case! 😀
Leaving everything else aside, why would turn on a switch to then immediately check if said switch was on? What's that supposed to accomplish?
You're over-complicating it for sure. Your day/night system is not dynamic, so utilizing a parallel event isn't needed.

Have the item swap happen in two instances:
1. When you use the item, have the items swap. Make sure the 'fake' sharpening stone has 'never' in it's occasion.
2. When you sleep in a bed, or in any other situation that would swap the day/night status, swap them back to the usable sharpening stone.

You can still utilize a common event, just call the common event manually in instances where you want to swap items. You can even do ONE common event.


◆Comment:Calling this event via the usable sharpening stone will attach the state and swap items.
:Comment:Calling this event again will swap items back. Additional sanity check removes the state.
◆If:Party has Sharpening Stone
◆Comment:If real, activate the state and switch to cooldown stone.
◆Change State:Main Character, + Sharpened Blade
◆Change Items:Sharpening Stone + 1
◆Change Items:Sharpening Stone - 1
◆
:Else
◆Comment:If fake, remove the state and return sharpening stone.
◆Change State:Main Character, - Sharpened Blade
◆Change Items:Sharpening Stone - 1
◆Change Items:Sharpening Stone + 1
◆
:End
Leaving everything else aside, why would turn on a switch to then immediately check if said switch was on? What's that supposed to accomplish?

like i said i'm new to rpg maker, been watching some tutorials on youtube, and this is as good as i could come up with. i still don't fully grasp how switches, variables and events as a whole work, so i'm probably taking extra unnecessary steps lol. my other systems would probably be able to be simplified a lot but i'll get there with time 🙂
I think it being parallel is the issue- Parallel constantly runs an event (iirc, be kind i just woke up) so with it being parallel, it's just constantly running the event behind the scenes, bringing it to 99 stones.

Have you tried turning off the parallel trigger? I feel like this is a stupid question but sometimes troubleshooting stuff like that has some really "Ohhhh..." answers ^_^"

Especially if the event is only made to run once when the stone is used, there's no need to have it parallel if that's the case! 😀
that's me still not understanding how parallel works fully lol i deleted it and tried something else and voila, no more infinite stones! sometimes stupid questions get the best answers for sure

You're over-complicating it for sure. Your day/night system is not dynamic, so utilizing a parallel event isn't needed.

Have the item swap happen in two instances:
1. When you use the item, have the items swap. Make sure the 'fake' sharpening stone has 'never' in it's occasion.
2. When you sleep in a bed, or in any other situation that would swap the day/night status, swap them back to the usable sharpening stone.

You can still utilize a common event, just call the common event manually in instances where you want to swap items. You can even do ONE common event.


◆Comment:Calling this event via the usable sharpening stone will attach the state and swap items.
:Comment:Calling this event again will swap items back. Additional sanity check removes the state.
◆If:Party has Sharpening Stone
◆Comment:If real, activate the state and switch to cooldown stone.
◆Change State:Main Character, + Sharpened Blade
◆Change Items:Sharpening Stone + 1
◆Change Items:Sharpening Stone - 1
◆
:Else
◆Comment:If fake, remove the state and return sharpening stone.
◆Change State:Main Character, - Sharpened Blade
◆Change Items:Sharpening Stone - 1
◆Change Items:Sharpening Stone + 1
◆
:End
that's a very good idea, i didn't think of it... i wanted to have the events organized and separated as well so i don't clutter the pages, but this is a lot simpler than what i came up with (which was several events >>). i also did not realize i could attach an "if" to an item >> so much easier. thank you lots!! i will try it out 🙂
like i said i'm new to rpg maker, been watching some tutorials on youtube, and this is as good as i could come up with. i still don't fully grasp how switches, variables and events as a whole work, so i'm probably taking extra unnecessary steps lol. my other systems would probably be able to be simplified a lot but i'll get there with time 🙂

that's me still not understanding how parallel works fully lol i deleted it and tried something else and voila, no more infinite stones! sometimes stupid questions get the best answers for sure


that's a very good idea, i didn't think of it... i wanted to have the events organized and separated as well so i don't clutter the pages, but this is a lot simpler than what i came up with (which was several events >>). i also did not realize i could attach an "if" to an item >> so much easier. thank you lots!! i will try it out 🙂
Happy to help.

Original thread: https://forums.rpgmakerweb.com/threads/problems-trying-to-switch-an-item-when-performing-action.180515/