Kaine_Kalos

Villager
Member
Joined
Jul 10, 2021
Messages
29
Reaction score
13
First Language
English
Primarily Uses
RMMZ
This seems like a concept that should have been included with RPG Maker MZ because it is almost a necessity in most games, but I am unable to find any way to insert it, even though it seems like it would be simple.

I've been searching on the forum for discussions on this, or people who have made plugins, but I only found one entry, and that was from someone who made one for MV, but it does not appear to work with MZ.

The fact that there is little discussion on it seems to me like it might be a simple matter, and I might just be a bit stupid and cannot figure it out. Has anyone done any editing on this, or created a plugin that works for MZ?

I use Visustella, but I don't know that there are any options for that in any of the plugins. Maybe I missed it? Could be. If I did, let me know.

Any help to point me in the right direction on that would be greatly appreciated. Thanks. :smile:
 

NPP6

Villager
Member
Joined
Jun 25, 2020
Messages
19
Reaction score
18
First Language
English
Primarily Uses
RMMZ
I know you can do it with scripted encounters by eventing whatever it is under "if escape," but I'm not sure how to do it for random ones...
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,647
Reaction score
15,742
First Language
English
Primarily Uses
RMMV

I've moved this thread to Plugin Support. Thank you.

 

VegaKotes

Veteran
Veteran
Joined
Jun 25, 2013
Messages
217
Reaction score
153
First Language
English
Primarily Uses
RMMV
I don't know if this is exactly what you're looking for but...

Give this thread a look see and see if any of the solutions proposed here work for you.
 

Kaine_Kalos

Villager
Member
Joined
Jul 10, 2021
Messages
29
Reaction score
13
First Language
English
Primarily Uses
RMMZ
Maybe check the Mechanics Settings -> Common Events plugin parameters of VisuStella MZ Battle Core.
THAT is why there aren't hardly any threads about this. Caethryil, you sneaky genius! It was so simple. THANKS! :wink:

For anyone who is using Visustella, you just have to set an event to the "Successful Escape" slot in the Battle Core plugin. It seems that you'll have to setup a script to calculate a percentage of gold, experience, or hp, depending on what you want to be a penalty. I'm not sure how to script an equation like that yet, but I'm going to look it up and see if I can work that out.

[move]Plugin Support[/move]
Sorry about that Shaz. I'm still new here, and it was kind of a question that was open ended to many different potential topics, so I wasn't sure what thread to post it in. Thanks for all your hard work. :wink:
 

Kaine_Kalos

Villager
Member
Joined
Jul 10, 2021
Messages
29
Reaction score
13
First Language
English
Primarily Uses
RMMZ
Okay, so let me explain it for newer people just in case someone reads this. This is the first time I've tried very simple scripting, and it took me about 15 minutes to figure it out with the help of a intro to scripting YouTube video, so it's not that hard.

However, you need the Visustella Battle Core plugin. I'd recommend it, it's fantastic, and will save you LOADS of time if you are (like me) not an experienced script kiddie.

Create a common event and name it something like "Escape Penalty"
Open up Plugins -> VisuMZ_1_BattleCore
Mechanics Settings -> Escape Success Event
Set the common event to "Escape Penalty"

Create two variables. We'll name them PartyGold (Variable #001) and EscapeLoss(Variable #002) for this example.
In my common event, I set the gold penalty for the party to lose 15% of their remaining gold when they run from battle.

In the Common Event, set the following:
Set Control Variable PartyGold = Gold (it's under Game Data -> Gold)
Set Control Variable EscapeLoss = Script -> Math.min($gameVariables.value(2)*0.15)
Set (Gold - EscapeLoss)
Display Text: "Lost \v[2] Gold!"

Test it and make sure it works. If you run from battle, and the party had, let's say 500 gold, it will pop up a text saying that the party lost 75 gold. If you want to change how much they lost, just change the 15 in "0.15" to whatever percentage you want. Hope that helps. Thanks everyone.
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
3,064
Reaction score
2,376
First Language
EN
Primarily Uses
RMMZ
Set Control Variable EscapeLoss = Script -> Math.min($gameVariables.value(2)*0.15)
Just for the record: Math.min is used to get the minimum value from a list of values. Here, you're asking for the minimum from a list of precisely one value, i.e. it will always just return that value. :kaoswt:

You could alternatively do this with no scripting, e.g.

◆Comment:Get current gold ◆Control Variables:#0001 Temporary Variable 1 = Gold ◆Comment:Only calculate penalty if gold is more than zero ◆If:Temporary Variable 1 > 0 ◆Comment:Multiply by 3/20 (0.15) ◆Control Variables:#0001 Temporary Variable 1 *= 3 ◆Control Variables:#0001 Temporary Variable 1 /= 20 ◆Comment:Lose that much gold ◆Change Gold:- {Temporary Variable 1} ◆Text:None, None, Window, Bottom : :Lost \v[1] gold! ◆ :End
Also, in future try to avoid double-posting; you can use the Edit button to add information to your post if needed. A link to the forum rules can be found in the Help section:
If you'd like this thread closed, you can report your post with a reason like "Solved". Happy RPG Making! :kaohi:
 

Kaine_Kalos

Villager
Member
Joined
Jul 10, 2021
Messages
29
Reaction score
13
First Language
English
Primarily Uses
RMMZ
Just for the record: Math.min is used to get the minimum value from a list of values. Here, you're asking for the minimum from a list of precisely one value, i.e. it will always just return that value. :kaoswt:

You could alternatively do this with no scripting, e.g.

◆Comment:Get current gold ◆Control Variables:#0001 Temporary Variable 1 = Gold ◆Comment:Only calculate penalty if gold is more than zero ◆If:Temporary Variable 1 > 0 ◆Comment:Multiply by 3/20 (0.15) ◆Control Variables:#0001 Temporary Variable 1 *= 3 ◆Control Variables:#0001 Temporary Variable 1 /= 20 ◆Comment:Lose that much gold ◆Change Gold:- {Temporary Variable 1} ◆Text:None, None, Window, Bottom : :Lost \v[1] gold! ◆ :End

Also, in future try to avoid double-posting; you can use the Edit button to add information to your post if needed. A link to the forum rules can be found in the Help section:
If you'd like this thread closed, you can report your post with a reason like "Solved". Happy RPG Making! :kaohi:
Double posting? I don't know what you mean. Where did I do that? I wanted to know so, whatever it is I did, I don't do it again.
 

VegaKotes

Veteran
Veteran
Joined
Jun 25, 2013
Messages
217
Reaction score
153
First Language
English
Primarily Uses
RMMV
Double posting just means posting twice in a row in a thread. Like for post 6 and 7 of this thread. Since no one else had posted after 6 normally you'd just edit post 6 to add the additional information instead of making post 7.

If you're unsure of what I'm talking about here my post right here for instance is Post 10 of this thread. And the one right before it, yours, is post 9.
 

Kaine_Kalos

Villager
Member
Joined
Jul 10, 2021
Messages
29
Reaction score
13
First Language
English
Primarily Uses
RMMZ
Okay, I get it. I'll try to remember that in the future, thanks. :smile:
 

Latest Threads

Latest Profile Posts

Okay so, I'm using this script, right? And it works. If you press :Y a menu should come up allowing you to choose an item to use. Nothing happens. You press :A to open the event options menu and choose "Use an Item"? The item selection menu appears. I have no idea how I set this up or why it works the way it does. Absolutely bizarre.
A woman gave me her number without me even asking for it. Then she left because she had other patients to see.
oh, hey, I forgot about all this!

my old project got abandoned after I started working too much on stuff I'd already worked on - plus, starting to hate the story I wrote for it. Then, well, a lot of serious life **** went down. I ended up moving across the country, cutting off some people, etc. - **** was rough.

So, uh, I guess I'm back for now? Funny how things work.
I'm glad I'm sticking to my guns on having fighting game mechanics in my game, from what I've read, it's not for everyone. but for the most part, I've made it so you don't have to use them motion inputs for attacks if you don't want to.
And my project's just entered the Lunar New Year Sale 2022... Let's see if it reaches it's goal of $ 7,77.

Forum statistics

Threads
118,729
Messages
1,118,285
Members
155,881
Latest member
falsekithe
Top