Trying to create a steal event, but having issues.

SciWriter

Villager
Member
Joined
Oct 19, 2020
Messages
24
Reaction score
3
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
449
Reaction score
231
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
598
Reaction score
249
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
24
Reaction score
3
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

Made a surprising amount of progress in these past two days. Really helps when parallax mapping breaks limitation and allowing me to be creative and make maps that match my vision.
Let's promote our amazing artists in RPG Maker community! I posted right now about my game Phil Alone on Twitter and I decided to thanks Lime Zu, the amazing artist that did all the pixel assets for my game!
I just realised that the reason behind me not being able to make a game may be the lack of my original resources. I just dont like the look of MV faces and sprites, lol. Guess I will have make my own art.
I'm posting a commission art soon! :kaoswt2:
So here's a fun/tragic fact about me: I have an awful memory. But to be correct, I have memory "leaks". My memory is actually amazing, my issue is I can't keep memories for long, in fact, I once forgot my name. :kaoswt2:

Forum statistics

Threads
107,452
Messages
1,029,805
Members
139,583
Latest member
KenanPal
Top