States cause forced actions to occur (or skills/states)

oToToToToTo

Veteran
Veteran
Joined
Jul 13, 2015
Messages
46
Reaction score
9
First Language
English
Primarily Uses
I'm trying to do something I was hoping to be simple but its turning into a mess for me, maybe a new pair of eyes and a new brain can help me figure this out:

  1. An actor uses a skill on an enemy, if they enemy has a certain state on them when they are attacked, the actor (same actor) will perform another attack on them.
  2. An actor uses a skill on an enemy, if they enemy has a certain state on them when they are attacked, another state will be put on the target.
  3. An enemy attacks an actor with a certain state applied, the actor performs an attack (skill) on them. The goal is to have a "rebound" type skill that is cast on an ally, when ever that ally is attacked by a spell the spell would be cast back at the attacking enemy. Not just a flat damage reflect but the exact skill being used against them.
  4. An enemy attacks an actor with a certain state applied, the enemy has a state put on them.



I'm using all of Yanfly's scripts which have moved me closer to making skills like the above, and I saw a video where someone made an Overwatch skill that would cause an Actor to counter attack when an ally is attacked by an enemy, so the above should be able to be done! Right? ;^;


Here is a link to that Overwatch skill!


Please and thank you for any help/directions you can give.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
I have moved this post to the JS Plugin Support forum.  Please be careful to post in the correct forum.  Thank you.
 

oToToToToTo

Veteran
Veteran
Joined
Jul 13, 2015
Messages
46
Reaction score
9
First Language
English
Primarily Uses
I have moved this post to the JS Plugin Support forum.  Please be careful to post in the correct forum.  Thank you.
Ooops! Sorry, I wasn't sure if this could be done without JS or not. I wanted to see if I could get it done through eventing or through regular RPG MV but I've only seen any really interesting skills done with JS so far.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Some of them can be done just through the damage formula.  But I suspect a plugin will be needed for the ones where you want to invoke a second attack or a counter attack.  I'm not sure.  Plus you said you were using plugins to try and achieve them, so kind of assumed it would be something to do with setting up notes on the skills or states to use the plugin.
 

theolis-wolfpaw

Villager
Member
Joined
Jan 4, 2016
Messages
22
Reaction score
4
First Language
English
The first two are easy enough to do with Yanfly's Action Sequences. For #1 put something like this under the Target Action whenever you want the second skill to activate in the sequence:


if target.isStateAffected(x) == true && target.result().i****() == true
eval: user.forceAction(y, -2);
eval: BattleManager.forceAction(user);
End


Just replace x with the state ID and y with the skill ID. The -2 makes it hit the last target, targeted. You can omit the && and the result if you don't want the skill activation to be dependent on if the first attack is a hit. If you do include that, you do need to make sure this happens after the original skill is activated.


#2 Follows a similar pattern, but it's much simpler and again you place it in the Target Action whenever you want the effect to occur:


if target.isStateAffected(x) == true && target.result().i****() == true
add state y: target
End


Again x is the stat ID of the state you're testing for, with y being the state you want to add. As in the first example, the result part is optional but if kept in you need to make sure it happens after the action effect. Of course, both of these only work for the skills you place the action sequence in, so if you wanted this to be a global effect with a skill you'd probably have to do something with Lunatic Mode on Yanfly's Buffs & States Core, which is also how you would do #3 and #4.


I'm not really sure how you would do #3, I know it would again involve forced actions with the same lines of code from the first example (without the eval: ), but you would have to obtain the ID of the enemy that attacked and the ID of the skill they used to make them use the same spell while targeting the same enemy, and I'm not 100% sure how to do that.


For #4 you would place something like this in the state's notetag:


<Custom React Effect>
target.addState(x);
</Custom React Effect>


Again x is the state ID of the state you want to apply in retaliation. These should all work, but it is possible I may have gotten something wrong, so bear that in mind.
 
Last edited by a moderator:

oToToToToTo

Veteran
Veteran
Joined
Jul 13, 2015
Messages
46
Reaction score
9
First Language
English
Primarily Uses
if target.isStateAffected(x) == true eval: user.forceAction(y, -2); eval: BattleManager.forceAction(user); End


Thank you for all of this. I had completely forgotten about the Action Sequence Pack, here this whole time I was trying to use common events and all this mess. Thank you so much haha. I got it working :)
 

theolis-wolfpaw

Villager
Member
Joined
Jan 4, 2016
Messages
22
Reaction score
4
First Language
English
No problem, and yeah don't ever forget action sequences, they are amazing and can allow for some crazy skills that would be a huge pain to get working with a common event.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,867
Messages
1,017,061
Members
137,575
Latest member
akekaphol101
Top