Kaine_Kalos

Veteran
Veteran
Joined
Jul 10, 2021
Messages
57
Reaction score
27
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
19
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
45,478
Reaction score
16,396
First Language
English
Primarily Uses
RMMV

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

 

VegaKotes

Veteran
Veteran
Joined
Jun 25, 2013
Messages
212
Reaction score
155
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

Veteran
Veteran
Joined
Jul 10, 2021
Messages
57
Reaction score
27
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

Veteran
Veteran
Joined
Jul 10, 2021
Messages
57
Reaction score
27
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
4,485
Reaction score
3,514
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

Veteran
Veteran
Joined
Jul 10, 2021
Messages
57
Reaction score
27
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
212
Reaction score
155
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

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

Latest Threads

Latest Posts

Latest Profile Posts

9 days left for Harold Jam... hope it's not too late to start gam mak
i think this girl has to be my favorite though :)
62702017_JJKXazrs2LInoZh.png
Wouldn't you know it? Every woman that is interested in me on FB is a bot. Maybe I should respond with 000100100011. If u r willing to date women on FB something has definitely went wrong with your life.
Hello world !! I've created a logo design for my game, I'm calling it "Soup Quest" (It was honestly the best I could come up with <:]) !!
[IMG]https://media.discordapp.net/attachments/866542330286178344/1076307540528332830/Soup_Quest_Game_Logo.png?width=473&height=473[/IMG]
P.S. ty to the person who told me about the "purple text not mixing well with dark mode". I'll be careful on using colored text in the future !!

Forum statistics

Threads
129,747
Messages
1,204,803
Members
170,835
Latest member
KathleenL42
Top