Trying to create a steal event, but having issues.

SciWriter

Villager
Member
Joined
Oct 19, 2020
Messages
20
Reaction score
0
First Language
English
Primarily Uses
RMMV
Okay so I want a character that can steal items. Pretty much a staple in RPG's that involve classes, which is why I don't
understand why MV doesn't have this function built in. That's besides the point though.

So I created an event, where my steal skill triggers a Common event. All that common event does is check if the enemy
has a state called "Can't Steal" and if it does it displays the message, "The Enemy has Nothing" The Else branch contains switch activators that correspond with the enemies in the fight, since I want different things to be stolen from each enemy. The ability
also adds a state called Targeted to the enemy.

For example: Enemy 1 will need switch 1 on to activate the event when you use steal on that enemy, Enemy 2 with need switch 2
to activate the event relating to that enemy.

If the switches are on the next part checks to see if the state "Targeted" is on which it will be because the steal ability itself applies this state 100% of the time. Once this condition is met. I use a randomized variable to decide which items can be stolen.

If Variable is Less than or Equal to 5 you get a common items, if the variable is 6, 7, or 8 you get a rare item, and if the variable is
9 or 10, you get one of two ultra rare items, depending on if the variable is 9 or 10.

After this I want the event to not trigger again. Which I can do by putting the state, "Can't Steal" on the enemy, so if the steal command is used again. The skill itself sees that the state, "Can't Steal" is present, and say "The Enemy has Nothing", I also set the Variable back to 0.

It works perfectly if I only have 1 enemy in the troop, the problem comes when I have more than 1 enemy. Having another enemy causes 1 of 2 problems. If I use the steal ability on enemy 2 first it doesn't do anything, however it still works on enemy 1 just fine. The other problem is that if I use it one enemy 1 first, it works just fine, but than if I try to use it on enemy 2. It just displays the, "The Enemy has Nothing" message, even though I haven't stolen from that enemy yet.

I don't turn the switches off after the event has run, because if I turn the switches off it crashes the game, and won't let me do anything

Any help that may allow me to make this work, would be greatly appreciated.

Thank You,
 

Animebryan

Need more resources!
Veteran
Joined
Jul 31, 2012
Messages
443
Reaction score
225
First Language
English
Primarily Uses
RMMZ
You know, Yanfly already made a plugin for this called Steal & Snatch. Sucks it's behind a paywall though ($10 for the Bundle it's included in or $30 for his whole collection).
YEP_StealSnatch.js
 

Tiamat-86

old jrpg gamer
Veteran
Joined
Dec 5, 2017
Messages
548
Reaction score
225
First Language
english
Primarily Uses
RMMV
the full yanfly collection is worth the 1 time buy. game changer in so many ways.
who says you can only steal items, steal the enemies buffs too. lol
then theres the whole issue of enemy thieves.
cant very well have the "good guys" be the only criminals in the whole world.
 

SciWriter

Villager
Member
Joined
Oct 19, 2020
Messages
20
Reaction score
0
First Language
English
Primarily Uses
RMMV
I know about the Yanfly Steal and Snatch plugin. I'm trying to avoid using other peoples scripts, even if I don't have to pay for it.

Currently I only use two plugins that were created by other people. I do use Yanfly's core engine, since I want the side view battle system, the other one I use is a plugin that makes all you character levels require the same amount of EXP and you get more or less EXP after defeating them depending on the level difference between you and the enemy. If you get 5 levels or more higher than the enemy you defeat you no longer get exp from them.

Besides those two plugins I'm trying to completely make the game from RPG Maker MV's resources, and options.

I would use scripts I make myself, but I don't know scripting/codeing. I do know of a way to make my steal skill work how I want it to, but it would have to be scripted which I don't know how to do.

If I could make the ability trigger a common event, that checked all enemy id's simultaneously for the state "Can't Steal", than the Else Branch would have no content. So if the enemy did not have "Can't Steal" the event didn't do anything besides add the "Targeted" State to the enemy.

Than figured out a way in the "Troop" screen, to make the event trigger with the condition "That the enemy is in a certain state." I could make the steal ability apply the state "Targeted" to that enemy, which in the moment would trigger the event to run than after the event has run, remove the state "Targeted" and add the state, "Can't Steal". That way if I use the steal command again against that enemy the conditional branch on the skill itself, will first check if "Can't Steal" State is active, and when the skill see's that it is, it will just display, "The Enemy has Nothing"

In theory this should work, I just need to know how to script it.

Thanks Again
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts



So I figured out how to put words and pictures in the screen transition. It even wipes away from both the top and bottom. The possibilities are endless! :LZSexcite: I'm going to devise secret messages now for them because I'm a terrible wonderful person like that. :kaopride:
December has arrived and with that, an ¡update for Aletoir Feast! a game made it for the One Map Challenge. I will use some of the remaining switches, variables, and events from the challenge limit to add more content but keep it within the requirements. ¡Have a nice day Everybody!
What I worked on today. :LZSjoy:

No stream today, make a game in MZ is continuing next week!
It seems MOG Weather only has a "clear" function to instantly erase a given weather effect. Probably works well if weather only changes at map transfer, etc, but looks very abrupt if weather effects are continuously changing. So my next challenge: script a "fade" function to gradually fade the sprites and wait to "clear" the current weather until the opacity of all its sprites hits zero... or something like that! XD

Forum statistics

Threads
105,758
Messages
1,016,212
Members
137,444
Latest member
NeoRetro
Top