Is it possible to activate a switch when using an item? I thought perhaps I could do it by placing $gameSwitches.setValue(#, true); in the formula line, but it doesn't seem to be working. I know I could do it by calling a common event to activate the switch, but I'd prefer to skip the middle man. Thanks!
Using an item and activating a switch
RPG Maker MV SupportYes.
You can call a Common Event as an Effect. Just saying. 😉
You can call a Common Event as an Effect. Just saying. 😉
Doing it the way you mentioned work for me in a playtest. Could you post a screen shot of the formula?
@Orichalcum+ I thought it should. I may have to dig deeper.
@Dreadshadow Yes, but I specifically need a switch turned on. Since I will need multiples then I would need multiple common events to match the switches. It's a bit of redundancy that I am hoping to bypass.
Here is my test item:
And here is the debugger showing that the switch is not turned on:
@Dreadshadow Yes, but I specifically need a switch turned on. Since I will need multiples then I would need multiple common events to match the switches. It's a bit of redundancy that I am hoping to bypass.
Here is my test item:
And here is the debugger showing that the switch is not turned on:
Try changing the scope, I was using the default potion as my test item. When I set the scope to none it stopped turning the switch on.
That seems to be the kicker. Sometimes it's the simple things. Thanks, @Orichalcum+!
Scope none means there is no target, and with both items and skills the damage formula is only processed if there is a hit/target, because without there is no need for numbers.
The code processing is originally only a sideeffect of the programming but not an intended use (which is why the damage is always the last processed number and a few other quirks of it).
The code processing is originally only a sideeffect of the programming but not an intended use (which is why the damage is always the last processed number and a few other quirks of it).
Good to know. Thanks, Andar!
Original thread: https://forums.rpgmakerweb.com/threads/using-an-item-and-activating-a-switch.93600/