Referencing AttackTimes+?

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,626
Reaction score
1,195
First Language
English
Primarily Uses
RMMV
Hi, I'm looking for the correct syntax for using AttackTimes+ in a conditional statement. Basically I want to say "if user's AttackTimes+ = 3, then stuff, else stuff". However, I don't know the correct js term for AttackTimes+. It would be akin to if (user.atk >= 3) or something, except I'm trying to reference AttackTimes+ instead.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,961
First Language
English
Primarily Uses
RMMV
user.attackTimesAdd()
 

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
1,076
Reaction score
856
First Language
English
Primarily Uses
RMMV
You can use the following :

Code:
a.attackTimesAdd()
EDIT: Dah, did not notice Trihan until I posted.
 

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,626
Reaction score
1,195
First Language
English
Primarily Uses
RMMV
Thanks guys! I thought that was it...idk why it doesn't work though... Must be something else wrong w/ my code then.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,961
First Language
English
Primarily Uses
RMMV
If you're using Battle Core it changes how that trait works.
 

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,626
Reaction score
1,195
First Language
English
Primarily Uses
RMMV
If you're using Battle Core it changes how that trait works.
How so? I just tried making a dummy passive state to see if it was working, and the passive state didn't show up after equipping a weapon that added AttackTimes+.
JavaScript:
<Custom Passive Condition>
if (user.attackTimesAdd() >= 2) {
  condition = true
} else {
  condition = false
}
</Custom Passive Condition>
I also tried that same thing w/ a.attackTimesAdd() and also tried changing "2" to "1". In all cases, the state didn't show. How would I access the unit's AttackTimes+ value if I'm using Yanfly's BattleCore?

Edit: I just did a search through YEP_BattleEngineCore.js for "attackTimes" and got no results...

Also, I know that this section of code rpg_objects.js is in effect since I've edited it to also affect physical attacks which works just fine.
JavaScript:
Game_Action.prototype.numRepeats = function() {
    var repeats = this.item().repeats;
    if (this.isAttack() || this.isPhysical()) {
        repeats += this.subject().attackTimesAdd();
    }
    return Math.floor(repeats);
};
Edit2: I also just tried both subject.attackTimesAdd() as well as this.subject.attackTimesAdd() to no avail...
 
Last edited:

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,961
First Language
English
Primarily Uses
RMMV
I can't remember exactly, I just remembered one of Yanfly's plugins changes how extra attacks work because I was trying to do something with it and kept only having one action.
 

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,626
Reaction score
1,195
First Language
English
Primarily Uses
RMMV
That's weird...you sure it's doing something to Attack Times+ and not Action Times+? Cuz I see Action Times+ in the plugin, but not Attack Times+...
 

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
1,076
Reaction score
856
First Language
English
Primarily Uses
RMMV
Does the passive state show up when you just put :

Code:
<Custom Passive Condition>
condition = true
</Custom Passive Condition>
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,961
First Language
English
Primarily Uses
RMMV
Sorry, yeah, I was thinking of Action Times+.
 

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,626
Reaction score
1,195
First Language
English
Primarily Uses
RMMV
Does the passive state show up when you just put :

Code:
<Custom Passive Condition>
condition = true
</Custom Passive Condition>
Yes, I just double-checked, it does show up.

Edit: Sigh, I'll just do this the long way I guess... by using conditional states to check if the actor's weapon slots are filled and also requiring certain weapon types to not be equipped. Such an inelegant solution, but oh wells, it's functional at least.
 

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
1,076
Reaction score
856
First Language
English
Primarily Uses
RMMV
Hmm, well, I am using the following in a new project :

Code:
<Custom Passive Condition>
if (user.attackTimesAdd() >= 2) {
  condition = true;
} else {
  condition = false;
}
</Custom Passive Condition>
And the state does show up.
 

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,626
Reaction score
1,195
First Language
English
Primarily Uses
RMMV
Hmm, well, I am using the following in a new project :

Code:
<Custom Passive Condition>
if (user.attackTimesAdd() >= 2) {
  condition = true;
} else {
  condition = false;
}
</Custom Passive Condition>
And the state does show up.
You're right, I just tried it on a new project and it does show up for me as well! Damn, I gotta figure out what's wrong w/ my project now...
 

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
1,076
Reaction score
856
First Language
English
Primarily Uses
RMMV
Do you have any other plugins that might tamper with states?
 

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,626
Reaction score
1,195
First Language
English
Primarily Uses
RMMV
Ok, I copy-pasted the actor I was using and set that actor as the one you start the game with, and now it works!! I have no idea where the anomaly was, but I'm so happy rn regardless lol. Thank you, guys!
 

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

Latest Threads

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,034
Messages
1,018,446
Members
137,820
Latest member
georg09byron
Top