Using Notetag to Activate Switch or Conditional Branch

EpicFILE

Epic Member
Veteran
Joined
Sep 27, 2017
Messages
439
Reaction score
1,392
First Language
Indonesia
Primarily Uses
RMMV
Hello!
So I have a battle that allows player to evade manually, using SRDude plugin called Active Defense Charge.
It's done by modifying the "Attack" skill notetag.

I want to automatically activate a counterattack whenever the player successfully evade.
To achieve that effect, I think that requires some kind of switch activation or conditional branch from notetag.
Is it possible to activate switch or conditional branch via notetag?

For more information, I also use Yanfly Action Sequence and Counter Control.
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,125
Reaction score
10,639
First Language
Czech
Primarily Uses
RMMV
<notetag: dgutdf>
What is notetag? It's something in this shape. MV by default parses notetags and then whatever is in front of the : is considered the metatag name and whatever is on the right is passed to it as a string (including spaces and stuff, which is why you often need to maintain proper spacing). Btw. If we input this notetag to actor 1's note field, this is how we would work with it if we cared about the exact value:
Code:
if ($gameActors.actor(1).meta["notetag"] ==" dgutdf") {
//code}
So it's impossible to trigger a conditional branch only via a notetag. You would probably need to edit the SRD's evasion plugin (in particular when the player successfully evaded) to contain this code after that: determine the notetag's existence and trigger Yanfly counterattack function.
 

Isabella Ava

Veteran
Veteran
Joined
Sep 13, 2016
Messages
635
Reaction score
756
First Language
English
<Target Action>
enemy sequence attack go here
if (!target.result().i****())
actor counter attack go here
end
</Target Action>
 

EpicFILE

Epic Member
Veteran
Joined
Sep 27, 2017
Messages
439
Reaction score
1,392
First Language
Indonesia
Primarily Uses
RMMV
Thanks!
Anyway, here's the code I put in attack notetag:

<setup action>
display action
immortal: targets, true
</setup action>

<target action>
if user.attackMotion() !== 'missile'
move user: targets, front, 20
else
perform start
end
wait for movement
motion attack: user
wait: 10
attack animation: target
wait for animation
action effect
<Active Defense: charge>
<End Active Defense>
if (!target.result().i****())
<Timed Attack: clock>
Target 1: 45, 180, rgba(200, 170, 0, 1), 1
Target 2: 200, 270, rgba(220, 150, 0, 1), 2
Target 3: 290, 330, rgba(240, 130, 0, 1), 3
<End Timed Attack>

</target action>

The timed attack is the counterattack.
But it activated straight away after I select attack command, not after I can evade enemy attack.

Do I have to add this code first?
if ($gameActors.actor(1).meta["notetag"] ==" dgutdf") {
//code}
 

Isabella Ava

Veteran
Veteran
Joined
Sep 13, 2016
Messages
635
Reaction score
756
First Language
English
Code:
<setup action>
display action
immortal: targets, true
</setup action>

<target action>
if user.attackMotion() !== 'missile'
move user: targets, front, 20
else
perform start
end
wait for movement
motion attack: user
wait: 10
attack animation: target
wait for animation
action effect: target
<Active Defense: charge>
<End Active Defense>
if (!target.result().i****())
motion attack: target
wait: 10
attack animation: user
wait for animation
action effect: user
end
</target action>
You cannot active time attack here
 

EpicFILE

Epic Member
Veteran
Joined
Sep 27, 2017
Messages
439
Reaction score
1,392
First Language
Indonesia
Primarily Uses
RMMV
@Isabella Ava
Thanks!
I tried the code, but apparently the actor/enemy will counterattack no matter it's a hit or miss.
Also, the counterattack damage is 0. Perhaps I am missing something?
 

Isabella Ava

Veteran
Veteran
Joined
Sep 13, 2016
Messages
635
Reaction score
756
First Language
English
Code:
<setup action>
display action
immortal: targets, true
</setup action>

<target action>
if user.attackMotion() !== 'missile'
move user: targets, front, 20
else
perform start
end
wait for movement
motion attack: user
wait: 10
attack animation: target
wait for animation
action effect: target
<Active Defense: charge>
<End Active Defense>
if target.result().i****() == false
motion attack: target
wait: 10
attack animation: user
wait for animation
action effect: user
end
</target action>
maybe this will work? :) i am not on my computer so i can't test the skill @EpicFILE
 

EpicFILE

Epic Member
Veteran
Joined
Sep 27, 2017
Messages
439
Reaction score
1,392
First Language
Indonesia
Primarily Uses
RMMV
Thanks!
I'm messing around and found a code that truly make it work.
But the no damage problem is still there.

<setup action>
display action
immortal: targets, true
</setup action>

<target action>
if user.attackMotion() !== 'missile'
move user: targets, front, 20
else
perform start
end
wait for movement
motion attack: user
wait: 10
attack animation: target
wait for animation
action effect: target
<Active Defense: charge>
<End Active Defense>
if $ActiveDefense.power <= 0
wait: 10
else
motion attack: target
wait: 10
attack animation: user
wait for animation
action effect: user
end
</target action>

The bolded part is the one that checks whether the player successfully dodge or not.
With that code, I successfully make the actor counter only when they dodged enemy attack.
But that's the problem, there's no damage on the counterattack.

Is there a way to call another skill instead if the actor successfully dodge? (like calling common event)
Something like this:

if $ActiveDefense.power <= 0
wait: 10
else
call counterattack skill
 

LeeAceSan

Veteran
Veteran
Joined
Jan 8, 2018
Messages
54
Reaction score
31
First Language
French
Primarily Uses
RMMV
I want to do this as well, I'm trying to find a way.

I think it's just the damage formula to change :dizzy:
 

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

Latest Threads

Latest Posts

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
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.

Forum statistics

Threads
105,868
Messages
1,017,096
Members
137,587
Latest member
Usagiis
Top