How does currentAction work?

Hiya!


I was editing a script and I was wondering what means what in regards to actor.currentAction() under Window_Base?


I wanted do an if statement where it basically means If current action is attack


Basically I want to know what the value of actor.currentAction() is when attacking.


If you want an example of what actor.currentAction() is used for, in YEP_ATB and YEP_Battle_Status, it is used to show which icon should be shown while the action is charging ( the little icon which represents whatever the current action is at that time )


Thank you, and please tell me if I made no sence whatsoever...
I was actually just messing with this haha, the way I found to check if it's an attack is like so.

 


//basically just checking if the current action is a skill, and then check if it's ID is 1(basic attack).
if (actor.currentAction()._item._dataClass === 'skill' && actor.currentAction()._item._itemId === 1) {

}


this was the way I found to check for basic attack. :|  hope it helps.
Thank you!!! That is exactly what I needed!


Hmm... It's actually pretty interesting too, I didn't know about _item._itemId
Npnp glad I could help n.n

Original thread: https://forums.rpgmakerweb.com/threads/how-does-currentaction-work.59447/