Situational skills

TriceratopsX

Veteran
Veteran
Joined
May 2, 2016
Messages
264
Reaction score
404
First Language
English
Primarily Uses
RMMV
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  :rswt:  help please?
 

KayZaman

Brother-Veteran
Veteran
Joined
Jun 26, 2016
Messages
769
Reaction score
1,751
First Language
English & Malay
Primarily Uses
RMMV
I don't understand. What kind of skill?
 

TriceratopsX

Veteran
Veteran
Joined
May 2, 2016
Messages
264
Reaction score
404
First Language
English
Primarily Uses
RMMV
I 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?
 

_Shadow_

Tech Magician Level:
Moderator
Joined
Mar 2, 2014
Messages
4,078
Reaction score
2,654
First Language
Greek
Primarily Uses
RMMZ
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. :)
 
Last edited by a moderator:

_Shadow_

Tech Magician Level:
Moderator
Joined
Mar 2, 2014
Messages
4,078
Reaction score
2,654
First Language
Greek
Primarily Uses
RMMZ
Ummm... sorry for double posting here, but hey, @TriceratopsX, is your case solved?  I would like to know if that worked for you. :)
 

TriceratopsX

Veteran
Veteran
Joined
May 2, 2016
Messages
264
Reaction score
404
First Language
English
Primarily Uses
RMMV
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?
 
Last edited by a moderator:

lolshtar

Master of Magic thatknow nospell
Veteran
Joined
Apr 13, 2013
Messages
694
Reaction score
101
First Language
French
Primarily Uses
RMMV
<Damage Formula>


if (target.isEnemy) {


value = X }


if (target.isActor) {


value = X }


</Damage Formula>
 

lolshtar

Master of Magic thatknow nospell
Veteran
Joined
Apr 13, 2013
Messages
694
Reaction score
101
First Language
French
Primarily Uses
RMMV
In the skill notetag using Yanfly's Damage formula plugin
 

TriceratopsX

Veteran
Veteran
Joined
May 2, 2016
Messages
264
Reaction score
404
First Language
English
Primarily Uses
RMMV
@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.
 

lolshtar

Master of Magic thatknow nospell
Veteran
Joined
Apr 13, 2013
Messages
694
Reaction score
101
First Language
French
Primarily Uses
RMMV
<Damage Formula>


if (target.isEnemy) {


value = 500 }


if (target.isActor) {


value = -500 }


</Damage Formula>


if what you wrote at the top is damage hp
 

TriceratopsX

Veteran
Veteran
Joined
May 2, 2016
Messages
264
Reaction score
404
First Language
English
Primarily Uses
RMMV
@lolshtar Thanks a bunch!


Edit: Sigh, no matter what I target (Ally or enemy) it deals zero damage what did I do wrong?  :rswt:


Screenshot (70).png


Sorry for the continued annoyance  :p
 
Last edited by a moderator:

TriceratopsX

Veteran
Veteran
Joined
May 2, 2016
Messages
264
Reaction score
404
First Language
English
Primarily Uses
RMMV
@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.


Screenshot (71).png
 
Last edited by a moderator:

lolshtar

Master of Magic thatknow nospell
Veteran
Joined
Apr 13, 2013
Messages
694
Reaction score
101
First Language
French
Primarily Uses
RMMV
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.
 
Last edited by a moderator:

TriceratopsX

Veteran
Veteran
Joined
May 2, 2016
Messages
264
Reaction score
404
First Language
English
Primarily Uses
RMMV
Wow! Thanks so much for the continued help! It really means a lot ro me  :D
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,977
Members
137,563
Latest member
cexojow
Top