MV Looking for feedback for battle mechanic idea - too complicated?

So I'm about to start working on battle system in my game and ... well programming / plugins are something I'm very inexperienced with. I'm wanting to get an idea of 1) just how difficult what I'm wanting to do is, or if it's possible at all in MV from a programming perspective.
2) From a user perspective, if what I'm trying to implement is too confusing for the player.

So here's the idea:

I'm looking for a mood based battle system. My game only has three playable characters. Each character has three default moods and a 4th mood that is unique to the character. The moods scale from 1 to 100 in intensity and things both inside and outside of battle can impact those values (items, storyline events, enemy attacks, etc.) Whatever mood has the highest score gives that character their current dominant mood, so they can only be in one mood at a time.

Based on the mood, the characters have access to different skills and abilities they can only use with that mood. They can also get different skill buffs or debuffs. If a character's mood gets to 100, bad stuff can happen, like for example if a character maxes out fear, there is a chance for them to have a heart attack in battle, or to go into shock, etc.

Finally, later on in the game, the characters get upgrades to their individual special moods which change the power level of skills that work with their mood, or provide other buffs.

The reason I'd like to have a mood based battle system is that I think it would really add to the storytelling aspect of the game, like if a character is mad at another character and so they aren't thinking clearly and now that's effecting this battle and they're already angry. Or I think it would be cool to do things like intentionally attacking your team member to anger them so you can fight and things like that.

As far as I know the only games I'm aware of that do stuff similar are Omari and well Miitopia sort of? But their mood battle systems are WAY simpler and I'm not sure if that's a good or a bad thing.

If I can pull it off, it would be ground breaking but I'm also considering the possibility that I'm biting off way more than I can chew here.

*Edit* also any ideas where to start on something like this from a coding / plugin perspective?
I think you can basically treat moods as states and use the state system to assign different effects to the actors.
I think you can basically treat moods as states and use the state system to assign different effects to the actors.
So I was thinking that for at least part of it. Some states are naturally designed for that. It's hard to think of "berserk" like states in any context other than anger, for example, but I'm wanting to take it further, like locking some skills to only be available in certain moods. Not sure if I can pull off something like that with just states.
Not sure if I can pull off something like that with just states.
Why not? States have the Add Skill and Seal Skill traits available, just like every other database object.

And that's without even looking at common plugins that can disable or hide skills from your list under any circumstance you want.
Probably start with a really simple prototype with like, one character and two moods and see if you can get it to work? Sounds doable anyway! 😍

From a player perspective, I kinda like it, but I wud have to see a prototype in action to really be sure? 😅 Like, how often do the moods swing, so to speak? And does a mood change alter all my skills? 'Cuz, say, if I'm forced into my "Fear" skillset and I don't like it, I kinda get the feelin' that cud get aggravating fast? Basically, as a player I'd appreciate strong, clear ways to influence my moods and guard against mood changes! 😍
Why not? States have the Add Skill and Seal Skill traits available, just like every other database object.

And that's without even looking at common plugins that can disable or hide skills from your list under any circumstance you want.
Oh. Good point. Yeah. I haven't really played around with states too much yet so I'm going to try digging into things there. I appreciate the tip. I'm also trying to figure out a way display the character's active mood in the menu or battle screen itself. Maybe some graphic display plugin of some kind.

Probably start with a really simple prototype with like, one character and two moods and see if you can get it to work? Sounds doable anyway! 😍

From a player perspective, I kinda like it, but I wud have to see a prototype in action to really be sure? 😅 Like, how often do the moods swing, so to speak? And does a mood change alter all my skills? 'Cuz, say, if I'm forced into my "Fear" skillset and I don't like it, I kinda get the feelin' that cud get aggravating fast? Basically, as a player I'd appreciate strong, clear ways to influence my moods and guard against mood changes! 😍
Yeah the frustration element is something I've taken into account a little. I'll probably allow basic abilities like attack etc for any mood at the minimum but the idea is to have the players be able to play the ball where it lands so they can't just move spam also.

In the case of the character Will, he starts the game as an alcoholic and his unique mood is "numb" which is kind of intentionally bad early game. I had the idea of having him have an item like whiskey that temporarily removed numb, but then adds the numb mood back with interest a few turns / battles later.

At a later point in the story he gives up drinking and the "numb" mood becomes "grit" and it's actually not crappy to use his special mood anymore.

If anything, giving someone rage as a mood by attacking your own guys is just a hilarious idea that I totally want to implement. And "fear isn't bad necessarily in game. It helps with things like battle turn priority and agility unless it gets too high.

While I'm on the topic, I'm also trying to figure out if gamifying the alcoholism would just anger people. I'm wanting to use it to tell the story I want to tell but I worry by putting it in an RPG this way if people will think I'm treating the subject flippantly. Hopefully they don't. Not what I'm going for anyway.
Yeah so I've played around with some stuff and it's surprising what I can accomplish with states actually. But there's definitely some things to work out.

I keep finding myself hindered by the whole not being able to run parallel processes in battle thing. I can use troop events as a work around but it means copying the same event code in every single troop. It also means if there's special code for a given boss battle it can create problems.

I tried to find a plugin that would get common events to run parallel in battle but didn't have much success.
I keep finding myself hindered by the whole not being able to run parallel processes in battle thing. I can use troop events as a work around but it means copying the same event code in every single troop. It also means if there's special code for a given boss battle it can create problems.
take a step back first. Why do you need to run this common event in a battle? what are you looking to get done? can it really be done only through a common event?

many times, what you think can be done with some huge common event thatll consider every possibility can actually be done with just some plugin and a few lines of code in a notetag

I can use troop events as a work around but it means copying the same event code in every single troop
also theres a plugin for that, but it doesnt allow for making exceptions doe specific fights like bosses as far as i know
take a step back first. Why do you need to run this common event in a battle? what are you looking to get done? can it really be done only through a common event?

many times, what you think can be done with some huge common event thatll consider every possibility can actually be done with just some plugin and a few lines of code in a notetag


also theres a plugin for that, but it doesnt allow for making exceptions doe specific fights like bosses as far as i know
I can't believe I missed that plugin. The Yanfly is a huge help. And it works for what I was looking for there. Solves at least the time saving problem.

One thing I was looking to try was to have an item the player can use that temporarily improves or changes their mood but after a set time the mood gets worse than before. I was able to achieve the first part by doing a common event upon item usage, but the problem is if I use the timer and the player is in a battle, when the timer runs out it kicks the player out of the battle. Plus I would need a parallel process to check in battle if the timer has ended. I've worked around this by making it an "x many turns" kind of effect but I was hoping to have the item work on a time basis so it can cover the span of multiple battles etc.
an item the player can use that temporarily improves or changes their mood but after a set time the mood gets worse than before.
if youre using yanfly's plugins, thats easily doable with the state notetags. the gist of how it could work it would be:

making a drunk state that drinking adds.
giving it an apply effect to "improve the mood" and then in that same apply effect, also set some variable on the user to track time.
give it a turn end effect to increase that same variable every turn
In that same turn end effect, add some conditional statement thatll decrease the mood if the timer is over a certain value.
from there, you can have the state remove itself

as long as your state isnt set to be removed after battle, that should work out to keep tracking time between fights
Sounds doable and is not too complex. The bigger problem is how to introduce this system to players.
So I am actually making really great progress on the mechanic so far. On the non battle side of things, I've created a common event for each character that checks their current highest emotion stat using a series of nested of/then statements. Then whenever something on the map or events lets say makes a character angry, I just run the common event and their state updates.

I got the drinking item to work thanks to the Yanfly plugin, and though I was originally going for an actual timer versus the number of turns in battle, it actually functions better this way.

Next, I want to have things like attacking characters and skills change a character's mood as well. I could probably have a troop event and use the Yanfly plugin like I did before, but I know eventing in battles is limited and I don't know how much stuff I can fit into a single troop event, so I guess I'll need to play around with that part of things.
how did you set up the emotions? did you make game variables out of them or did you by chance make them js properties on each actor? youre already using yanfly plugins, so what youre looking to do is doable without common events

If you did the latter, then itd be easy to add a post damage eval on every emotion skill to modify the emotions of the target if theyre an actor.

if you did the former then you could have each skill have a post damage eval too, but youd have to check for the target and adjust the corresponding game variables for each actor
I used game variables. So far I've pretty much done everything with mostly null JavaScript knowledge.

I don't know how to do the post damage eval yet so if it's a Yanfly plugin, looks like I'll need to dig deeper there.

Thanks for the help by the way. The way I have it is pretty cool. I can do things like dialogue that changes based on the character's mood. Heck I could have Easter egg events that only trigger at x location I'd character y is in z mood. There's a lot of fun possibilities with this.
So as I'm working on things I'm discovering that what I'm working on is less a single mechanic and more like a group of mechanics. Not sure if it's better to keep things in one thread but don't want to create multiple threads for this either?

Anyway, I got the drinking item to work both in battle and out using a Yanfly plugin and a hime plugin to give me better control of the targeting, so only Will can use it (in or out of battle) and only if he's at the starting class. (Later in the game he gives up drinking and his "special mood" upgrades with it.)

The next problem I'm trying to work out is how to make enemy and ally skills change a character's mood. The problem is that each character has a variable for each mood and my common event checks the values of each mood to determine their state, so if the rage variable is the highest then they switch to rage mood etc.

The reason this is a problem is that I can use an enemy skill that runs a common event that lowers a character's individual mood variable, then run my other common event that checks mood variables and updates states accordingly, but I don't have a way to change the skill so that it changes the appropriate variable based on which character is targeted.

This means the way I have it now, I would have to create 3 duplicate skills with three common events each time I want to create an ability in battle that changes a character's mood! I figure there's probably a better way to approach this problem but I haven't figured out how yet. If one of the in game options for if/then flow was "if character I'd x is targeted" that's the kind of thing I'm wishing I could do

There's one other problem I'm working on related to this set of mechanics but it's character specific, so focusing on this one first.

*Edit* just realized I asked about this earlier and @Robro33 said a post damage eval to check, but I'm not sure how to implement that or how to check for targeting. I know Yanfly has a targeting core plugin, but I'm not sure if that's helpful here?

**Edit 2 looks like I might be able to do eval post damage using Yanfly skill core but I think I need to put in custom scripting. Probably where I'm going to get stuck because I don't know any actual JS, lol.
looks like I might be able to do eval post damage using Yanfly skill core but I think I need to put in custom scripting. Probably where I'm going to get stuck because I don't know any actual JS, lol.
you will, but it doesnt have to be anything complex. I suggest first looking at a beginner JS guide, then look at the MZ script call list and look at some of the functions you can use, then look at yanfly's tips and tricks sections for some usage examples within yanfly's plugins. If you get stuck, theres sections on this forums to get extra help for that. i dont know about your circumstances, but let it take as much time as needed

I'm not sure how to implement that or how to check for targeting
you dont have to do anything special for it. when you use a post damage eval tag, a variable called "target" that points to the target of the skill is already made automatically. so if you wanted to just check if a skill targeted an actor and do stuff from there if it did, it skill could look like this
Code:
<Post-Damage Eval>
if (target.isActor()){
//do stuff
}
</Post-Damage Eval>
you will, but it doesnt have to be anything complex. I suggest first looking at a beginner JS guide, then look at the MZ script call list and look at some of the functions you can use, then look at yanfly's tips and tricks sections for some usage examples within yanfly's plugins. If you get stuck, theres sections on this forums to get extra help for that. i dont know about your circumstances, but let it take as much time as needed


you dont have to do anything special for it. when you use a post damage eval tag, a variable called "target" that points to the target of the skill is already made automatically. so if you wanted to just check if a skill targeted an actor and do stuff from there if it did, it skill could look like this
Code:
<Post-Damage Eval>
if (target.isActor()){
//do stuff
}
</Post-Damage Eval>
So I've played around but still struggling. My Javascript knowledge is limited but have tried looking at the code a little. Would this go in the skill notetag then? And does this look right for the "Do stuff" part?
If so, I tried looking in the MV script calls spreadsheet. Let me know if this is correct.

Code:
<Post-Damage Eval>
if (target.isActor(1)){
$gameVariables.setValue(1,
  $gameVariables.value(1) + 20);
}
</Post-Damage Eval>

This would make the first variable id I have listed gain 20 if it's targeting the first actor, correct?

*Edit* prior it wasn't working at all because I didn't give the enemy mp and skill used mp. Doh. fixed that.
Now it's sort of working. I can get it to target and the variable is going through but its supposed to run a common event after the skill is used to update their states based on the variables. (for the moods in question) It works for the first character targeted but subsequent used it only changes the variable. It's liek teh common event only triggers the first time the skill is used. And I'm trying it with Pre damage eval too.
This would make the first variable id I have listed gain 20 if it's targeting the first actor, correct?
almost.
isActor() doesnt take any parameters to run. all it does is check if the target is an actor. it wont check if the target is actor 1 like that. to make sure the target is actor 1, you could try checking the target's actor ID once youve determined that the target is an actor.
Code:
if (target.isActor() && target.actorId()===1)

It just skips the turn altogether.
your enemy is capable of performing any of the actions it knows after using the skill, right? it has enough MP to be able to be able to act? that skill by itself shouldnt be interacting with the enemy in a way to cause them to be unable to act unless they just ran out of mp using the skill.
okay, got it to work I think, actually! It was the MP as part of it. It seemed to only do the variable change when I did script to == instead of ===.

The reason the state change wasn't working after the variable changed is that the common event in the skills, it only seems to run the bottom one and ignores the others. So I combined all three common events into a single big one and presto it works.
Okay, once again I find myself reaching out for help, though I've made INCREDIBLE headway in this battle system I'm building.

What I have so far:

- Moods based on variables that can be altered via events, skills in battle, and items.
- I have it so if the characters attack each other, it increases the "rage" mood and the player gets a little angry remark from the character (randomized for fun).
- Special moods that are unique to characters and update with class changes.
- Aska's special mood is delusion. It uses TP (renamed to DP for delusion points) and I have it hidden using Yanfly plugin so it only shows on him. TP only regenerates 15 every turn, and any other normal source of TP regeneration is disabled using same Yanfly plugins.

What I'm still trying to figure out:

How to get TP to properly sync up with the Delusion variable. What I want is to have it so if TP increases or decreases, the delusion variable increases with it, or vice versa. If I use a skill, I'm able to accomplish this through a couple of tricks I worked out in the forums, reading Yanfly etc.

To sync up the TP with skills, I use

<Pre-Damage Eval>
if (target.isEnemy()){$gameVariables.setValue(86, $gameVariables.value(86) - 1);}
</Pre-Damage Eval>

Variable 86 is the delusion variable. In this case, the skill only costs 1 TP since it's a test skill. Then I run my mood update common event which 1) makes sure none of the moods are over their caps and then 2) compares each of the mood variables to switch their states accordingly. So for example if Aska's delusion mood was higher than the other moods, it would switch over to the delusion state.

Outside of battle, during in game events etc. I'm able to accomplish this by, so let's say I have an event that changes his Delusion value to 200:

1704594595805.png


Basically doing this. I can't do it as a common event so I had to rewrite that whole little section to update TP with even since game only gives you the option to add or subtract a variable, it doesn't let you set the TP to a variable. If anybody happens to know a better way, let m know.

But the bigger problem is that I have TP set to regenerate 15 at the end of the turn, and I can't figure out how to update the variable to go along with it. I tried using this forum using Custom Battle effect and custom regenerate effect but I just couldn't quite figure out how to get it to work or if I was doing it right. I don't know how to really write code. I can mimic it fairly well though. I tried using this too, but that's only helpful if you know how to format what you're doing correctly.

What I tried in my state to get to work was this in my state notetag:

<Custom battle effect>

var <<Aska>>\i[320]\c[30]Delusion\c[0] = user.tp;

</Custom battle effect>

<custom regenerate effect>

var <<Aska>>\i[320]\c[30]Delusion\c[0] = user.tp;

</custom regenerate effect>

Let me know where I went wrong.

1704595280445.png

Oh, also if it's relevant, this is set as a passive state on the actor Aska.

Original thread: https://forums.rpgmakerweb.com/threads/looking-for-feedback-for-battle-mechanic-idea-too-complicated.164073/