So I came up with a skill for my game (don't know if anyone has something similar) where depending on the target it would either heal them (if used on an ally) or damage them (if used on an enemy) and I'm unsure how to go about making this, so 😅: help please?
Situational skills
RPG Maker MV SupportI don't understand. What kind of skill?
Sorry half asleep. Basically it would be able to target anyone that's in the battle, and if the target is an enemy the skill would inflict damage to it, however if the target is an ally then the skill would heal them. Did that clarify things at all?
Go to Common Events.
Make a common event named SUPERSKILL
Go to Skills.
Select your skill
Effect:
Common Event and select SUPERSKILL
Create a State: IsEnemy
Set all Enemies to this state permanently
Back on common Events choose again SUPERSKILL.
Conditional branch.
IF Enemy has state IsEnemy THEN
inflict Damage
or ELSE
Heal
Try if this solves your issue, I am not sure if the Enemy on events conditionaly branch check means Target. It is worth trying or else you need a small script condition. 🙂
Make a common event named SUPERSKILL
Go to Skills.
Select your skill
Effect:
Common Event and select SUPERSKILL
Create a State: IsEnemy
Set all Enemies to this state permanently
Back on common Events choose again SUPERSKILL.
Conditional branch.
IF Enemy has state IsEnemy THEN
inflict Damage
or ELSE
Heal
Try if this solves your issue, I am not sure if the Enemy on events conditionaly branch check means Target. It is worth trying or else you need a small script condition. 🙂
Ummm... sorry for double posting here, but hey, @TriceratopsX, is your case solved? I would like to know if that worked for you. 🙂
Ah, Sorry! I had gone to test that, but I realized that I cannot have the skill as I originally intended, as there is no "anybody" when selecting a target, so I decided I'd have to use Yanfly's targeting plugin at least with that I could have the skill use "random everybody except caster" and then just check to see if the target's an enemy etc, however I was trying to work on other parts of my game (with about as much luck XP) I'll probably devote tomorrow to figuring this out!
Edit: @lolshtar Stupid question, does that go in the damage formula? Or do I copy/paste that into the notes?
Edit: @lolshtar Stupid question, does that go in the damage formula? Or do I copy/paste that into the notes?
<Damage Formula>
if (target.isEnemy) {
value = X }
if (target.isActor) {
value = X }
</Damage Formula>
if (target.isEnemy) {
value = X }
if (target.isActor) {
value = X }
</Damage Formula>
In the skill notetag using Yanfly's Damage formula plugin
@lolshtar Ah okay, um sorry to keep bothering you -_- but um... How do I set the one to deal damage and the other to heal? I'm a little unsure of how to set up the values.
<Damage Formula>
if (target.isEnemy) {
value = 500 }
if (target.isActor) {
value = -500 }
</Damage Formula>
if what you wrote at the top is damage hp
if (target.isEnemy) {
value = 500 }
if (target.isActor) {
value = -500 }
</Damage Formula>
if what you wrote at the top is damage hp
@lolshtar Thanks a bunch!
Edit: Sigh, no matter what I target (Ally or enemy) it deals zero damage what did I do wrong? 😅:

Sorry for the continued annoyance 😛
Edit: Sigh, no matter what I target (Ally or enemy) it deals zero damage what did I do wrong? 😅:

Sorry for the continued annoyance 😛
The only thing l can see is that you don't have the plugin l mentioned http://yanfly.moe/2015/11/07/yep-25-damage-core/
@lolshtar No, I have the plugin installed. >_> Though, with that being said I might not have my plugins arranged very well, I know some conflict with each other/don't work properly depending on what's below what.


Yeah, l don't know. Arrange your plugins correctly would be the only thing l have in mind
Took a bit more time looking and testing and from what l saw it seems that isActor/isEnemy needs () at the end of it which wasn't written when l looked through objects
Damage formula doesn't work for negative numbers, l was pretty shocked myself when l saw a result 0 when l tested but don't worry, l got another solution for you and it doesn't even shows the 0.
Your new formula would look similar to this:
<damage formula>
if (target.isEnemy()) {
value = 500 }
</damage formula>
<Post-Damage Eval>
if (target.isActor()) {
target.gainHp(500) }
</Post-Damage Eval>
You can put the formula inside the gainhp or you could just scrap the damage formula and insert both inside the post-damage eval.
Took a bit more time looking and testing and from what l saw it seems that isActor/isEnemy needs () at the end of it which wasn't written when l looked through objects
Damage formula doesn't work for negative numbers, l was pretty shocked myself when l saw a result 0 when l tested but don't worry, l got another solution for you and it doesn't even shows the 0.
Your new formula would look similar to this:
<damage formula>
if (target.isEnemy()) {
value = 500 }
</damage formula>
<Post-Damage Eval>
if (target.isActor()) {
target.gainHp(500) }
</Post-Damage Eval>
You can put the formula inside the gainhp or you could just scrap the damage formula and insert both inside the post-damage eval.
Wow! Thanks so much for the continued help! It really means a lot ro me 😀
Original thread: https://forums.rpgmakerweb.com/threads/situational-skills.72455/