A few extensions to Eventing and Battles

Preface
Okay I recently got MZ and combined some of my unreleased MV plugins into new MZ plugins and also wrote some new ones. Originally I've planned to have only one version of each of these plugins compatible with both MV and MZ, but ultimately I've splitted them apart as I didn't like all those if-statements to handle the maker differences.
I've noticed most of the extensions, that come with these plugins, have already been implemented by other programmers and their version are often more sophisticated, so I feel a little uncomfortable by uploading these. I've also tried to make a plugin demo project, but didn't have very good ideas for this so I guess I won't upload it, but it helped me identifying a few bugs/missing features already.

Description of plugins:
BoMZ_PluginBase/BoMV_PluginBase
The core plugin, which includes common functionality used by my other plugins, although I didn't want to name it core. It adds no new functionality to your game. If you really want to know what it provides, than please read the help file.

BoMZ_GameplaySettings/BoMV_GameplaySettings
This plugin provides a few plugin parameters to adjust some aspects of gameplay. But beware changing those will result in functions of the default engine being overwritten instead of aliased, which might cause compatibility issues with other plugins.

  1. Preemptive & Surprise:
    In default engine surprise can be switched off by party ability, but preemptive chance can only be raised, not switched off entirely. This plugin provides options to overwrite the formulas used to determine preemptive and surprise at the start of a battle.
  2. Escape from battle:
    The plugin provides the option to make escaping from battle always succeed and two options to set the individual formulas for determining the escape ratio in case the always succeed option is not set.
  3. Always revive after battle:
    In the default engine if the party loses a battle it is allowed to lose, then all members are revived with 1 HP left. In case of victory or escape fainted party members stay fainted. This option changes this to make fainted party members always revive with 1 HP left after battle.

  4. Party settings:
    The usual setting for maximum number of party members participating in battle. By setting this to 0 the settings from other plugins or the default engine will be applied.
    From v.1.2 onwards this setting can be changed mid game via plugin command SetMaxBattleMembers if the plugin parameter is unequal to 0.
    A setting to adjust the level of a newly added party member according to the levels of the rest of the party in case the initialize check box is ticked in "Change Party Member" event command.

  5. Level up settings:
    Different recovery options for HP/MP at level up:
    * All: Full recovery
    * Difference to maximum: e.g. before level up you have 10/100 HP left, after level up you will have 10/110 HP left, basically all the damage you've received stays the same.
    * Keep same ratio: e.g. before level up you have 10/100 HP left, after level up you will have have 11/110 HP left, basically the percentage of HP left will stay the same.
    * No: Don't recover any HP/MP

    Options to remove states upon level up.

    Option to make every level up require the same amount of expirience.
BoMZ_EnhancedEventPages/BoMV_EnhancedEventPages
Plugin Parameters:
The MZ version provides a plugin parameter to automatically show name box containing the name of the event, when the name box is kept empty in the "Show Text" event command.
Both versions provide a plugin parameter to automatically show a face image that has been assigned to an event page using these plugins (how to do that will be described below) in case it is kept empty in the "Show Text" event command.
Both version provide a plugin parameter, that can assign face images to enemies.

Some new message replacement codes:
\evn[id]: Will show the name of the event with the given id
\evn: Will show the name of the current event
\e[id]: Will show the name of the enemy with the given id
\tm[position] Will show the name of the enemy at the given position in the troop which the player party currently fights

Escape codes for name box:
\n[id] and \p[index] are enhanced to also automatically show the face image currently assigned to the appropriate actor if the "Automatic Face Image" plugin parameter is set to true.
\nn[id] and \pnn[index] will show the nickname of the appropriate actor instead.
\evn[id] Will show name and face image of the event with the given id.
\e[id] Will show name and face image of the enemy with the given id.

The MV version has similar escape codes to extend upon the namebox functionality of Yanfly's YEP_MessageCore plugin.

New options for event pages:
This plugin can change the name, hue, opacity of an event page as well as assign a face image to an event page. It can also make it use a conditional name/character image/charcter graphic or use the graphics of an actor all through a single plugin command. MV version uses comments for this. It is required, that the plugin commands of this plugin are placed at the top of the event page before everything, that is not a comment. The comments in the MV version should also be placed on top of everything, that is not a comment.

Spoiler: Event Pictures
MZ Version (Plugin command)
1641460672721.png


MV Version comments:
1641460756304.png

Further page conditions:
The MZ plugin provides two further plugin commands, that provide additional page conditions, while one of them is meant for map events and the other one for troop events. The one for map events only provides conditions based on the default map refresh logic, while the one for troop events provides the same options aswell as an option to evaluate javascript, which seems to be possible as the conditions for troop events are checked quite frequently by the default engine. The troop conditions are also checked if the troop event page is set to "Don't run" in the default engine.
Yet again the MV version uses comments. The following options are provided:

* Check further switches if they are on or off
* Check further variables using various comparison methods (==,!=,<=,>=,>,<,in, not in, between, not between, etc.)
* Check further self switches and self switches of other events
* Check further party members and party members based on variables
* Check further items aswell as armor/weapons if they are in the inventory of the party

BoMZ_FollowControl/BoMV_FollowControl
This is not just a follower control plugin, but also provides functionality to make events follow the player or the player follow events. While developing this, I've noticed, that my previous MV plugin BO_FollowLinks has a lot of issues so I would appreciate if users of this plugin would switch to BoMV_FollowControl instead.

In short terms this plugin provides the following options:
  1. Let event and movement route commands target a follower via plugin commands "ControlFollower" and "ControlFollowerByVariable". All commands, that would target either the player or the current event will then target the follower instead. Targeting the follower instead of the current event was implemented so that the "Set Event Location" command can target the follower, because "Transfer Player" wasn't possible to be abused with this functionality.

  2. Add and remove party members by variables, e.g. if variable 9 is 2 then Priscilla will be added to the party by using the following plugin comand:
    1641462135266.png
  3. Make events follow other characters such as the player or events on their movement routes. Make the player follow events on their movement routes through various plugin command aswell as comment tags on the event page described in the help file. These comment tags must be placed at the top of the event page even before the plugin commands provided with BoMZ_EnhancedEventPages.
The MV version provides the same plugin commands.

BoMZ_BattleAtmosphere/BoMV_BattleAtmosphere
I was looking for a name, that fits enhancing visual and acoustic stuff at the same time and came up with atmosphere.
First of all a plugin command for showing balloon icons in battle: Hooray!
Also a plugin command tho change battle background mid battle.

Did you know, that in the default engine overworld maps have a special logic for battle backgrounds based on the auto tile you stand on, e.g. this one will automatically display a poison swamp background:
1641462702153.png

However this logic cannot be transferred over to regular maps as the auto tile at the same location of the outside tile
set will still show a poison swamp even though it is a water and snow tile.
So I came up with plugin parameters to set not only troop specific battle backgrounds, background music and even background sounds, but also region specific and also settings based on tileset and terrain tag.

The logic which one is chosen is the following:
- Troop overrules everything
- Region overrules tileset/terrain tag
- Tileset/Terrain tags overrule engine default logic
- Engine default logic is taken.

but, if a troop has e.g. a battle background image, but no music assigned, the music will be taken from the next setting in the hirachy.

Terms of use:
1. These plugins may be used and redistributed with both free and commercial games.
2. These plugins may be redistributed only for free otherwise, but I would appreciate linking back to the this thread instead.
3. You may take code from these plugins for your own free plugins, but not for commercial plugins.
4. You may edit these plugin, but BurningOrca has still to be mentioned in the author section. You may not rename these plugin. You may redistribute your edits for free.

Edit:
Get the plugins here:
BurningOrca Plugins (Google Drive)
I've noticed most of the extensions, that come with these plugins, have already been implemented by other programmers and their version are often more sophisticated, so I feel a little uncomfortable by uploading these.
I'm here to say, as long as you don't take their code as-is (only the idea), don't mind it. More options are always welcomed for a lot of reasons.

Great collection, keep it up! 😀
This is a great collection. Thank you for this. Also, I second what TheoAllen said; as long as you're not taking the as-is code, don't mind it. 🙂
I did use the FollowLinks with low problems, but I dont mind switching
either, if it has more control or work better =).

nice job, specially the page conditions 🙂
I'm here to say, as long as you don't take their code as-is (only the idea), don't mind it. More options are always welcomed for a lot of reasons.

Great collection, keep it up! 😀
No I didn't take any body's code as it is. My plugins where basically already finished when I had a look into other creators plugins and your page conditions was one of them. I've used comments for my page conditions first (like still done in the MV version), but switched to plugin commands after seeing your version. I've still implemented it in my own way, not copying any code, just the idea.
I did use the FollowLinks with low problems, but I dont mind switching
either, if it has more control or work better =).

nice job, specially the page conditions 🙂
If it didn't make any problem I would say stay with it. Maybe it was just me using my own plugin which started out as a copy of FollowLinks in ways that where just not suited for it.
I checked both version of BO_FollowLinks and BO_MV_FollowControl.
there are some intresting things in it which is not in FollowLinks.

while it is in a mechanic Project test, I also had a plugin for free before
paidWall for the walking mirrored or random.

yours have the reversed in it, but not random, while that one is not
used in my mechanic, but while it works, I can see how it goes, if it
works well, than I got 2 in 1, (1 less plugin).

while I got a mirror plugin already, it can work in some other area's.
but I got 1 question of the BoMV_EnhanceEventPages, which has
a huge list of ss, !ss, in between etc.

which is v[x] in between 5 and 7 (if readed correctly) that variable x
must be true if the number is 6 to be true or 5, 6, 7?

the other one related question ot it, is it similair to HIMES PageConditions?
that is readed before a text shows up if it's true or not?

if it does, it is even better than HIMES (no offense to him/her though),
but yours have more checks which comes usefull in the long run.

I can even probably adjust some mechanics a bit more complexer and userfriendly
with those checks 🙂

Keep up the nice work.
which is v[x] in between 5 and 7 (if readed correctly) that variable x
must be true if the number is 6 to be true or 5, 6, 7?
5,6,7
the other one related question ot it, is it similair to HIMES PageConditions?
that is readed before a text shows up if it's true or not?

if it does, it is even better than HIMES (no offense to him/her though),
but yours have more checks which comes usefull in the long run.
it is readed after map file has successfully been loaded and is checked when map is refreshed before any text shows up.
I personally don't think that one or the other plugin is surperior as the one of HIME uses the conditional branch event command and thus can basically evaluate more than my plugin could. I mean her plugin could potentially evaluate the timer or run a script check, but this would require to trigger a map refresh every single frame and she does not do that. However she does some additional map refreshes, e.g. when the gold amount of the party changes. My plugin in contrast limits itself to basically the conditions which the default engine already provides, but in various enhanced ways, which seem to be of more use for you. I've already decided to limit myself to the default map refresh logic before I've had a look into other creator's plugins out of the curiousity to see how they came up with a solution for the same problem. I think the two plugins aren't even incompatible and can be used together if one does not provide every check somebody needs.
intresting, I can see if some can be combined in the checks,
but checking some stuff when map is loaded/refreshed in other area's
i also a huges help, specially the v[x] "string" in order to happen something
which I use a variable check, it might be the same, but easier to control.

I play around later with it, I dont need everything on that list, but most
of the mechanic can make things easier.

thank you for the explaination though =)
Forgot to talk about compatibility in original post. For the MV version I honestly don't know, but I don't expect my plugins to give much trouble.
For MZ I've tested the Visustella Core Plugins for just a little time, but didn't find any errors, which does not mean that there might be other incompatibility issues. These where also the plugins where by just reading through the help files I realized, that like 80 to 90% of what I've implemented has already been done in some way or another. Visustella users probably won't need my plugins at all and if that assumption is not true and I found some niece use cases for them then I will feel happy. I should just stop worrying about comparying myself to other developers (especially those with years of expirience with the engine) and desperately trying to find something, that has not been done before, also because people told me multiple times that more options are always welcomed.

In MZ I've also tested Galv's Message Busts with my Enhanced Event Pages plugin. They seem to work nicely together no matter in which order they are used. The busts with the same name as the face images assigned to events via my plugin are automatically displayed if my plugin parameter to automatically display face images is active for the event page. If no bust image exists, then no error is caused, but also no face image is shown instead.
Found a small bug in BoMZ_BattleAtmosphere and BoMV_BattleAtmosphere. The newly added battle bgs didn't stop after battle at least if used together with another new plugin I'm currently testing, so I've replaced the ZIP files with new versions.
Impressive !!
Updated the GamePlaySettings Plugin to v1.1:
1. Added option to set the direction the player faces at the start of a new game. I think it's a shame that the editor is fixing the player to always face down at start of a new game, but i assume most people let their player start transparent and use an autorun event on propably an empty map to setup everything and won't need such a option. I'll provide it anyway.
2. Added a factor to multiply the experience rate for reserve members. By the default if the option is ticked in the editor they get full experience. My factor can be set between 1.0 for full experience down to 0.01 for 1/100th experience.
is there a way for the EnhanceEventPages to read from a conditional branch?
or only event comments?
is there a way for the EnhanceEventPages to read from a conditional branch?
or only event comments?

Only event comments.
Supporting conditional branches like other developers did would require me to implement more map refreshes, because if the condition is true, but the map isn't refreshed then the active event page won't change.
Map refresh in base engine is only triggered if anything supported by the editor event page conditions is changed and therefore I've limited myself to also only support these conditions in enhanced versions via the comments and to not support the conditional branch.
If somebody for example requires full support of the conditional branch for event condition checking then a map refresh is basically required every single frame, because of the timer condition and that could be a huge performance problem.
Even tough I can't read it, because of the obfuscation, I'm pretty sure triggering a map refresh every single frame is what Visustella did in their MZ Event Core plugin as the timer works as an event condition using their plugin. So it might not be as a much of a performance issue as I thought, but still I stand by my decision and will continue to not support the conditional branch. Sorry for that!
I uses MV =)

but I hope to get an array working on a mechanic.
which uses $gameVariables.value(12)[0] === x && v(12)[1] === y etc
as array of [x,y,z] doesn't read and always returned false.

but it seems not, but multiple checks probably wont work with with
the comment to activate them correctly.

but it's okay, I try to find a way to make that array reader shorter somehow.

thank you for the explanation 🙂
I uses MV =)
but I hope to get an array working on a mechanic.
which uses $gameVariables.value(12)[0] === x && v(12)[1] === y etc
as array of [x,y,z] doesn't read and always returned false.

but it seems not, but multiple checks probably wont work with with
the comment to activate them correctly.

but it's okay, I try to find a way to make that array reader shorter somehow.

thank you for the explanation 🙂
I know you are using MV. I just mentioned the VisuMZ plugin as an example of a plugin that does allow to check conditional branch event command and seems to fully work with every option of that command.
But to include variable array checks is not much of problem, so i just uploaded a new version that allows e.g. the comment: v[12] === [5,2,1], which checks if elements 0 - 2 of variable 12 are equal to 5, 2 and 1 respectively. Only === is allowed in this case as an operator.
For MZ users if you get the new version you might need to check and actualize all your BoMZ_EnhancedEventPages plugin command calls, because the new option has been added to the existing command.

Edit:
Quick mention. The new comment only checks the given amount of array elements on the variable for equality. To not cause any confusion, if your variables array looks like this [x,y,z] then
v[12] === [x,y] will still trigger the event page, while
v[12] === [x,z] won't trigger it, unless z === y
So you don't need to check all three positions if you for example only want to check two, the page should also activate if the two values match with the first two values in the array variable.
the reason for the condiional branch is because of the following:

if event is triggered, it checks after the following:

if: script: v(12) === [x,y,z] && v(12).length === 3 // max number
do stuff
else
if: script: v(12) === [y,z,x] && "" // shortcut max number
do other stuff
else
if: script: v(12) === [z,x,y] && ""
do something else
etc etc
end
end
end


this because each order is correct, but different output depending on order
you activate the event.

so it's all 3 event checks in 1 sweep, 2 triggered = incorrect or I need
to check < than 3 (some parts can have 5 parts (any order) as this must
contain all 5 triggers.

but I have some mechanic that the order doesn't matter, as event trigger
than read the comment will work too, just not before.

I dont know if it trigger automatically or by action trigger as I couldn't
read that in the help file.

but I will play around on the switches/variables as some item check
can come in handy if the player has it. (not equiped) as some part
require it to be equiped.

because some complex mechanic, some need to be made, need to check
if the player has equiped 2 items in the specific slot to be activate.

like item x and y in slot 1 and 2 wont work, but y, x does work for an effect.
I dont know if you comment can read multiple line of checks?

or I need to find a way for those easy checks in the conditional branches.
I don't really get what you mean!
For me this reads not really like a trigger condition for events, but a normal conditional branch once the event has already been triggered.

What I've meant is, e.g.1654453549534.pngwhere page 2 triggers by "Action Button" when variable 9 contains at least the elements 5,2 and 1 in exactly that order, because of the following comment:1654453629317.pngand it will also trigger, if you just check [5,2], but won't trigger if you would check [5,1].

I interprete your description as if you want something like this:
1654454002623.png
where the trigger condition for the event should be something else, but not actually the array variable. Am I wrong with this assumption?
I got 3 events ( so all 3 events must be activated). so array of [x,y,z]
must allways be 3 in any order, but 4 triggers will fail.

so 1,2,3,4 in an array = false where 1,2,3 is true, 2,1,3 = true, 1,3 = false
as you didn't have the 3rd event checks.

if I understand your page condition correction.

BoMV: PageConditions
v[12] === [1,2,3] will activate and variable 1,2 in v[12] === [1,2,3] does not?
if so, as I dont see any triggers besides action button, I need this check
on different pages (each combination), so it always trigger the correct page.

I might need a small modification to my mechanic to trigger it seperately
if the conditional branch doesn't work, but different event trigger does.

than I do it that way, extra event for different combination doesn't matter much,
as long as it does work nicely 🙂

I let you know how it went.

EDIT:

I check and works, when you changed maps, so I need something that refreshes
the map somehow, or it by passes the length of 3 as failed (I might be able
to set in the comment v[12] === [1,2,3] && v[12].length === 3
if that works.

if I can somehow force to events to refresh (refresh event[ID]) it can works nicely.
changing maps is alternatively if I make a specific event in the main room after
activating all 3 events.

However, my plugin DR, TRI, Olivia_MetaControls and probably more
is throwing this error (if below or above)
errorPosition1.png
as the JSON.parse(code) is my plugin and Olivia's and who else is using
parse will throw that error.

is there a work around on that part?

EDIT 2:
to make the pages work without moving between maps, I use a scriptcall,
" $gameMap.requestRefresh(); " which refreshes the current map.

here is the setup + safety I got it to work on the page refresh instantly
in case it matches.
setupMechanic.png

I believe, if people use the EnhancedEventPages with comments and has multiple
pages, this tiny scriptcall can be perfect if the trigger is somewhere on the same map.
as this does work, I can finish my mechanic fully ^^

I just need some help on the SyntaxError, because it break my plugin and others
using JSON.parse function.
I was wondering why you've needed a script call to $gameMap.requestRefresh(), but it makes sense as you push something into the array instead of calling $gameVariables.setValue, so the variable doesn't know it's changed and doesn't trigger the refresh automatically.

What needs to be done to reproduce the JSON.parse error? I cannot really see from your screenshots where the parse will happen!

Original thread: https://forums.rpgmakerweb.com/threads/a-few-extensions-to-eventing-and-battles.143663/