I am making a "Solitarian" class that is made to be self-sufficient / better alone in battle. But I am having trouble making its skills reflect that. Is it possible to make a skill like in the title? What I was thinking is - skill runs a common even that sets var x to the number of alive party members there are currently in the battle, then the skill damage is divided by that number (so either 3, 2, or 1 - my game has 3 characters in battle). But Idk how to do that exactly. Especially since I am using Visustella's party change plugin that lets me swap allies mid battle.
Can you make a skill that does more damage the fewer party members there are in battle?
RPG Maker MZ SupportAmusingly, as you linked in the other thread, this can easily be done in the damage formula 😉
In fact, your idea of using a common event can't help because common events are run after the skill is completely performed...so nothing you do in there can impact the damage dealt.
Simply put:
In fact, your idea of using a common event can't help because common events are run after the skill is completely performed...so nothing you do in there can impact the damage dealt.
Simply put:
Code:
your damage formula / $gameParty.aliveMembers().length
You can use
Side note: "Game Mechanics" is mor for discussion like "What skills could a solitarian class have?". For "How do I omplement this?" the more appropriate sub-forum would be the maker's support forum.
$gameParty.battleMembers().length in the damage formula as the number of party members in battle.Side note: "Game Mechanics" is mor for discussion like "What skills could a solitarian class have?". For "How do I omplement this?" the more appropriate sub-forum would be the maker's support forum.
Lol, i have a stalker! Jk. Thats awesome, i had no idea of that specific .aliveMembers code. Maybe i should have read the page more thoroughly lol
Though... would that code you mentioned reference the total number of alive members, or just the ones currently in battle? I guess there might be no way to know aside from testing.
Well, the way to know might be to look up the list of script calls pinned in the JavaScript forum and see what it means 😉
But the answer to your question is that if you use it in battle, members and aliveMembers automatically refer to the battle party. So it doesn't hurt anything, but specifically referring to battleMembers is actually only useful outside of battle.
There is nothing wrong with testing and just trying things out. That is how I learned pretty much everything I know about RPG maker. 😛
The code ATT_Turan gave will only count the alive members currently in battle. So if you have 12 battlers, of which 3 in battle and of those 1 is KO, then it will divide by 2.
I want to suggest a slight alternative, though:
The way I did it:
the full party (of 3) will do normal damage,
a party of 1 will do 3× damage.
The way ATT did it:
the full party (of 3) will do 1/3 damage,
a party of 1 will do normal damage.
The effect is the same: Party of 1 does 3× as much damage as a full party. The difference is that I assume a full party is the default, while with ATT's code you might assume a party of 1 is the default.
The code ATT_Turan gave will only count the alive members currently in battle. So if you have 12 battlers, of which 3 in battle and of those 1 is KO, then it will divide by 2.
I want to suggest a slight alternative, though:
Code:
your damage formula / $gameParty.aliveMembers().length * 3
The way I did it:
the full party (of 3) will do normal damage,
a party of 1 will do 3× damage.
The way ATT did it:
the full party (of 3) will do 1/3 damage,
a party of 1 will do normal damage.
The effect is the same: Party of 1 does 3× as much damage as a full party. The difference is that I assume a full party is the default, while with ATT's code you might assume a party of 1 is the default.
To be fair, I assumed that because that's how the OP said they wanted the formula to work 😉 Which, yes, is opposite from how they worded the thread subject.
But I agree that working it the other way could be easier for sanity checks/troubleshooting. 🙂
I don't think your approach is wrong. In many modern RPG's a party of 1 is the default.
In Skyrim and Fallout. Where you roam the maps alone, but you can gather 1 follower and/or 1 pet, extending your party to 2 or 3. Your approach would work better in those games.
In other games, like Dragon Age and Final Fantasy X, you play pretty much all the time with a full party. The only way you play with a party of 1 then, is when the rest of your party is KO. My approach would work better in those games.
Which of the 2 approaches is better for @FarOutFighter depends on the party system of their game. Is a party of 1 the default like skyrim, or is a full party the default like FFX?
Presumably if this is the design of the class, the use of the party system suggests that there isn't really a *default* per se, and that as soon as you have Solitarian as an option, you're basically faced with a trade-off between better damage while being solo, or having allies but dealing less. I would posit that the *most likely* intent from this is the "3 members deals normal damage, 1 member deals triple" that John suggested since doing it the other way wouldn't really make soloing more powerful, it would just make a bigger party less so.
If I look at fallout, there is a "Lone Wanderer" perk, which makes you more powerful and your inventory a lot bigger if you travel alone, even though a party of 1 is the default if those games. And I think that is kind of the fallout equivalent of a solitarian class.
Just saying: Bonuses for playing alone can work in games that focus on 1 character parties.
I just wouldn't rely ALL skills on that perk, though. If all skills would work like that, then your character is either useless in a full party like you say, or over powerful in a single-character party.
Moved to: MZ Support
Thanks! i was looking for this too as well.
Original thread: https://forums.rpgmakerweb.com/threads/can-you-make-a-skill-that-does-more-damage-the-fewer-party-members-there-are-in-battle.151737/