SRD's Timed Attack Core/Yanfly's Auto Passive States (syntax help)

PassiveState

Villager
Member
Joined
Jun 16, 2019
Messages
7
Reaction score
2
First Language
English
Primarily Uses
RMMV
Hi all,

I've created a passive state which I want to activate when the player performs poorly on SRD's Timed Attack Core mini, but I'm having some trouble with the syntax for checking the variable.

The Timed Attack variable stated in the help is
Code:
$gameTemp.tas_power
and the example given for linking damage to this variable is
Code:
(a.atk * 4 - b.def * 2) * ($gameTemp.tas_power)
I have applied a variation of that to my damage formula and it works fine.


Yanfly's stated syntax for basic state conditions is
Code:
<Passive Condition: Variable x Below y>

I want the state to be active only when Timed Attack returns 0.25 or less so I've tried both

Code:
<Passive Condition: Variable ($gameTemp.tas_power) Below 0.25>
and

Code:
<Passive Condition: Variable $gameTemp.tas_power Below 0.25>
on the state's note page, but can't get either to work.

Can anyone spot where I'm going wrong?


When I change to
Code:
<Passive Condition: HP Above 300>
Everything works as it should.


Any help you guys could offer re: the correct variable syntax would be greatly appreciated.

Thanks in advance!
 
Last edited:

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,093
Reaction score
1,509
First Language
EN
Primarily Uses
RMMZ
The "Variable x Below" tag expects x to be a fixed, positive integer (e.g. 1, 5, or 42), representing the ID of a game variable.

For a script condition, use the "Lunatic Mode" tag instead...maybe something like this:
Code:
<Custom Passive Condition>
condition = $gameTemp.tas_power < 0.25;
</Custom Passive Condition>
(Reference: Yanfly's Auto Passive States.)

Edit: that said, there may be a better approach, e.g. use an if statement in the action sequence and turn on/off a switch to enable/disable the passive state if appropriate. Not sure how SRD's Timed Attack plugins work... :kaoslp:
 

PassiveState

Villager
Member
Joined
Jun 16, 2019
Messages
7
Reaction score
2
First Language
English
Primarily Uses
RMMV
The "Variable x Below" tag expects x to be a fixed, positive integer (e.g. 1, 5, or 42), representing the ID of a game variable.

For a script condition, use the "Lunatic Mode" tag instead...maybe something like this:
Code:
<Custom Passive Condition>
condition = $gameTemp.tas_power < 0.25;
</Custom Passive Condition>
(Reference: Yanfly's Auto Passive States.)

Edit: that said, there may be a better approach, e.g. use an if statement in the action sequence and turn on/off a switch to enable/disable the passive state if appropriate. Not sure how SRD's Timed Attack plugins work... :kaoslp:
Thank you so much, your snippet appears to have worked right away :kaoluv:


Edit: Actually jumped the gun there - your snippet just stops the state from activating so it appeared to be working.

If I switch line
Code:
condition = $gameTemp.tas_power < 0.25;
for

Code:
condition = user.HP > 300;
The state activates/deactivates when either actor's HP crosses 300 as you'd expect ...


So we keep coming back to this darn $gameTemp.tas_power variable :kaosigh:
 
Last edited:

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,093
Reaction score
1,509
First Language
EN
Primarily Uses
RMMZ
Yes, I suspected that would be the case. After a closer look it seems tas_power is reset to 1 when the action ends, but I'm guessing you want the state to be active for longer than that? Not to mention it being used for every timed attack skill. :kaoswt:

You have an action sequence for this, right? Perhaps change the passive condition to a switch, then add something like this just after the Timed Attack bit:
Code:
if $gameTemp.tas_power < 0.25
  change switch 10: on
else
  change switch 10: off
end
Actually, unless you have some reason for using a passive state, this might be a better solution:
Code:
if $gameTemp.tas_power < 0.25
  add state 50: user
else
  remove state 50: user
end
Both of these suggestions require Action Sequence Pack 1 to work. Just change the switch/state ID to suit your game~ :kaopride:

Also, just an aside:
Code:
condition = user.HP > 300;
The state activates/deactivates when either actor's HP crosses 300 as you'd expect ...
That's surprising; user.HP doesn't exist in the default code, it's user.hp (lower-case). :kaoswt2:
 

PassiveState

Villager
Member
Joined
Jun 16, 2019
Messages
7
Reaction score
2
First Language
English
Primarily Uses
RMMV
Yes, I suspected that would be the case. After a closer look it seems tas_power is reset to 1 when the action ends, but I'm guessing you want the state to be active for longer than that? Not to mention it being used for every timed attack skill. :kaoswt:
Nah the state only lasting for the current attack is ideal - all I want is for the timed attack mini to affect both damage and the user's hit rate ie if the user doesn't input on the mini, their attack will miss; if they do well on the mini, their attack will hit (assuming enemy doesn't evade). I also plan on this affecting critical rate, as currently the user can get a critical even when they fail the mini which detracts from the whole affair.

My original solution was including tas_power in the actual ex.par formulas using Yanfly's plugin, but this approach did not work with SRDs Active Defense Core (which I also want to use), and despite working fine for attacks, it didn't seem best practice to have the mini affect these formulas at a global scope vs the required user.

Passive states seemed like the ideal way to go about it, though now ...

You have an action sequence for this, right?
This was on the cards as it would be a lot cooler for the mini to run just prior to striking the target, but plan was to get all the raw battle mechanics in order first. Now I'm thinking I could scrap the passive state and do everything I need via action sequence ... Is it possible to affect HIT and CRI with this method?

Also, just an aside:

That's surprising; user.HP doesn't exist in the default code, it's user.hp (lower-case). :kaoswt2:
You've got me there, my error transcribing :kaoswt:
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,093
Reaction score
1,509
First Language
EN
Primarily Uses
RMMZ
Now I'm thinking I could scrap the passive state and do everything I need via action sequence ... Is it possible to affect HIT and CRI with this method?
By default ex-params like HIT & CRI are determined exclusively via traits. One possible approach could be to make a state with the desired traits and add/remove that state before/after the "perform action" bit in the sequence as appropriate. :)
 

PassiveState

Villager
Member
Joined
Jun 16, 2019
Messages
7
Reaction score
2
First Language
English
Primarily Uses
RMMV
By default ex-params like HIT & CRI are determined exclusively via traits. One possible approach could be to make a state with the desired traits and add/remove that state before/after the "perform action" bit in the sequence as appropriate. :)
Alright and this was the easy part, I'm looking forward to doing Active Defense. Thanks for your help caethyril, you've been great :kaoluv:
 

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

Latest Threads

Latest Profile Posts

I should realize that error was produced by a outdated version of MZ so that's why it pop up like that
Ami
i can't wait to drink some ice after struggling with my illness in 9 days. 9 days is really bad for me,i can't focus with my shop and even can't do something with my project
How many hours have you got in mz so far?

A bit of a "sparkle" update to the lower portion of the world map. :LZSexcite:
attack on titan final season is airing tomorrow, I'm excited and scared at the same time!

Forum statistics

Threads
105,882
Messages
1,017,230
Members
137,607
Latest member
Maddo
Top