Making a Strange/Magical Pouch-type accessory

Disclaimer: I'm not extremely good with RPG Makers. Talking about scripts and/or variables may cause my head to asplode.

There's an accessory in the games Tales of Phantasia and Tales of Destiny where you equip it to a character, walk around a certain number of steps and a random item pops out, which is repeated for as long as you have the item equipped and stops if you unequip it. I want an accessory with this effect in the game I'm working on.

I'd really like to do this using a common event (I have Tsukihime's Equip Events installed) but I can't figure out how. I do know how to have Ace check for how many steps need to be taken (at least, I think I do) and how to set up the random pool of items for it to draw from, but my problem lies in figuring out if I can do all of that AND make it loop in a single common event since the method I'd come up with required a self switch after the step check (common events REALLY ought to have pages). I tried using Labels to jump back to the start of the event and putting the whole event in a Loop but those make my game freeze up upon equipping the accessory.

Other things I've tried (such as setting the Steps Taken variable back to zero after an item is produced) either:

-gives me an item every step

-gives me an item upon equipping and then never again

-works as intended ONCE and if I unequip and re-equip it goes haywire and only gives an item upon equipping

-just doesn't do anything at all.

I'm probably missing something extremely simple but like my disclaimer says I'm a derp with this program (and in general). And yeah, I know I can produce these effects by spamming parallel processes all over my maps, but I'm using Khas Awesome Light Effects and well, you know. Lag. Trying to keep extra processes on maps to a minimum if at all possible. I've considered Tsukihime's Scene Interpreter may be causing a problem, but I need it to make one of my other on-equip events to trigger in the menu so I don't wanna remove it if I don't have to.
Something like this?


jrmb.png



(common event set on parallel process, ignore the exit event processing command in there, it's a habit of mine when it comes to longer events running on parallel process)


I suggest going through the Variables Guide since you're still new to this to be able to understand what I did.
Well unless I did it wrong, that doesn't work. When I initially equip it and walk 20 steps nothing happens, but when I unequip and reequip it it gives me one of every item from the pool but only if I've walked 20 steps and that only seems to happen once o.0 Also I couldn't open up the project file for the variables guide for some reason.
Right, my mistake, I made it in a test project and simply did it from the beginning (where steps woulds start out with 0) and didn't take into account you'd do this later during the game where the player has already accumulated steps.


Try this instead (don't forget the labels, they're important):


uoqv.png



This is a parallel process common event, and you must turn on a switch to get it to run in the first place (preferably in the beginning of your game). I added the coin sound effect so the player knows they received something, though you can remove it if you want.


The Variables Guide is compressed in a rar file, please use WinRAR or 7zip to extract the files.
Oh I did extract everything fine (it seems I'm one of those rare people who know how to use WinZip and WinRar, lol), it just asks for the installation package for VX Ace when I try to open the project file. That's never happened with other projects I've downloaded so I thought it was weird.

Anyway I'll try this thing out and see what happens.

Edit: oh crap, now my own game is asking for the installation package. I don't think I have it around anymore...

Edit edit: I found the install package and used it when prompted, but now all of Ace's default tiles have gone poof in my project. Like, what the hey? I think I'd better just do a fresh reinstall.
Edit the third: the default tiles EVERYTHING are still gone after freshly reinstalling the RTP and Ace. I'm so confused 😳

Topic-relevant edit: your second suggestion worked, with some tweaking. Your way had it giving me all or most of the items from the random pool every 10 steps when I wanted a single one, so I used Else checks to narrow it down. Now would I just copy and paste all that into the same common event (with edits to the equipee) for when the other 5 characters were to equip the accessory?
I suggest making a new thread for your other problem.


No, you wouldn't copy and paste it in the same common event, as the event relies on labels to loop something, and this only works for one instance. You'd either have to edit the event the way you want it to work out, or create a common event for each of the 5 characters.
My problem sort of fixed itself so nevermind about it (just had to manually import the default resources that I was using - it'll bloat the filesize a bit but luckily my game's not that big anyway. And newly created projects don't seem to have the problem). It's just strange that it happened after I downloaded the variables guide. It's probably a coincidence though.

Can you give me an example on how I'd need to edit the event to work for all 6 characters?  I could probably figure it out on my own from there.
Bump because it's been a month.
You haven't figured it out in a month?


I would first create a common event that checks if any of the 6 characters is wearing the equipment, and set this to a parallel process. If true, make it call the common event that checks for the steps for each actor (so 6 conditional branches), and right below it add an exit event processing to prevent itself from calling the common event 6 times if all charactera are wearing it for example. So it will only check one and stop at that check.


The steps common event would just be what I have listed above, except remove the first conditional branch that checks if the actor has something equipped. Don't set it to parallel process.
You don't have to rub it in. But yes, this works, although it does mean more parallel processes on my maps (I try to keep the bare minimum because of the lighting script I use, but oh well). Thank you for your help, and I hope this helps anyone else trying to make this type of accessory for their own games.

Original thread: https://forums.rpgmakerweb.com/threads/making-a-strange-magical-pouch-type-accessory.15395/