I looked through the Script Call file, but couldn't find a script that would help me.
What I'm trying to do is during a battle turn, I want to get the skill IDs for all selected skills, so If I have three actors I want to store info on what skill is selected by which actor.
An important thing to note is that I need the ID before the skills execute.
I am hoping this can be achieved via script call without the need for a plugin!
Script Call to Return Selected Skill ID per Actor ID
● ARCHIVED · READ-ONLY
-
-
I think it is the actor's variable _actionInputIndex.
So for an actor it'd be $gameactors.actor(id)._actionInputIndex, but I can't be sure...
I'll keep looking -
sorry, that won't be possible without a plugin, because there is not even a way to place that script call without a plugin - the skill's damage formula is only executed after the skill hits, and the troop events are also activated either as the result of a skill or after the turns.
Please give a better description of what you want to do with that info and when in the battlesequence you want to process it - then we might be able to help -
@Andar My intent is to create a combo system. If for example two specific skill IDs are selected, they have a chance of forming a "Dual Combo". In this instance, I force an action where a third skill (essentially the Level 2 Combo) will hit, and the originally selected skills get cancelled (haven't figured out how to do the cancellation yet). Both actors who had selected the original skills lose their turns.
So the collection of the skill IDs happens as the skills are selected, and the processing of this info and initiating a combo (if applicable) happens after the last actor's action is selected.
Writing this down makes me realize it sounded way simpler in my head!
@Waterguy I will try that once I get access to my RMMV laptop :) -
Hi!
After fiddling in the console a bit, the info you seek is possible to get, technically: Let's say harold (actor 1) chooses to cast heal (skill n*8), you could access it with the following script calls:
$gameActors.actor(1)._actions[0]._item._dataClass // "skill" in my example, It would be "item" for an item.
$gameActors.actor(1)._actions[0]._item._itemId // 8 in my example
SpoilerAfter the action is chosen but before using it.
The tricky part is just as Andar said: You can't place that script call without a plugin.
Furthermore, the "_actions" array is emptied after the action has taken place, so you'd probably need to record every action at the beginning of the turn and refer to that instead of the "_actions" arrays..
If you had a way to execute a script call before any action occurs, you could do it with some script calls, but AFAIK it's not possible in vanilla MV.
If you wanted to do a plugin for this, I don't think it would be too complicated. You'd just have to find the function for the beginning of turn processing, alias it and have it write down the info somewhere you can access, even after the actions have ended.
Anyway: if you don't want a plugin for this, please elaborate on what you want to do so we can help find an alternate way of doing it.
Edit: Spoiler'd initial response part above because it was wrong.
The spoiler below contains a plugin free example:
SpoilerBattle event:

The above event runs a loop that sets variables 2 to 2+ the size of the party to the corresponding actor's action, then triggers the common event.
Common event:

The example above will make actor 3 cast spark and actor 2 wait if both of them chooses to attack and you choose to trigger the combo.
How to generalize this is left as an exercise to the reader. (It requires quite a lot of script call, if you don't want to lose yourself in conditionnals). -
try this (haven't tried it myself, but should do something like you want)
Because cancelling the original skills is not possible without a plugin either
http://mvplugins.com/plugin/DoubleX/DoubleX%20RMMV%20Unison%20Item -
Thank you. I will test this plugin and post back here with the outcome.
-
I've tested out the options suggested. The _actionInputIndex kept returning 0, but the itemId script call @Astfgl66 suggested worked. I was able to store the itemId for each actor's skill in a variable, and placed those in a common event that is checked every turn in battle. I also created Unison skills using the Unison Item plugin and using conditional branches and the Force Action command was able to accomplish what I was looking for.
What it looks like now: After I input all my skills, if the skills fit a specific pattern I get a prompt saying that I've triggered a combo and asking if I want to unleash it. Selecting "yes" will force the Unison skill, and force waits on invokees, selecting 'No' will resume the battle as is.
I couldn't have accomplished this without you guys' help. Thank you!! -
It seems I overlooked some battle event functionnality, and it was right under my eyes as well. I wasn't sure of when the event would occur if you didn't check turn end, as it turns out, it's before any action occurs... That's what I get for not using them much I guess.
I've actually managed to make your system without any plugin thanks to that info, but anyway: glad you have a working solution!
(I'll edit the first post with the solution for posterity.) -
Thank you again, @Astfgl66.
I am still new to RMMV, but I'm keen to learn more about the engine. Aside from the script call document, do you know of any resources that would help me learn how the Engine defines the different classes, functions, data structures etc? Knowing how to access the different components (like the actions array for example) would be immensely helpful i think. -
Well there isn't any document that will get you introduced sadly. You'll have to piece everything together by yourself I'm afraid.
Firsr, you should probably grab the split js files from zalerinian's thread here:
Using that you'll learn as much as you want from the game engine in a more orderly and focused fashion than just browsing the complete js files.
Then, one thing that helped me a lot is just going into the console (press F8 if you didn't know) and just type "window" (without the quotes).
You'll then have the complete view of everything in your game and how it is organized, it won't tell you how the data structures are made or what method are available in what context (use the split files for that) but searching will allow you to see how to access anything.
That's exactly what I did in your case. I typed window, searched inside game actors and found something suspiciously named "_actions".
Another example is: I wanted to dynamically control sound (moving closer or away from a campfire changes the sound volume), it only took a bit of searching and inside audio manager I quickly found my answer on how to make it possible. Now with a simple parallel process I can do just that, no need for a plugin!
My advice is simply to try and do things by yourself as much as possible and to not be afraid to go looking into the console and the js files. You'll probably spend a lot more time doing things that way and break a few things at first, but you'll learn a lot more ^^.
My second and most important piece of advice is: when you are a bit more familiar with the engine, roam the mv support forum, read every question and try to think of how you would do it, before reading the answer preferably. You'd be surprised how much I learned by doing that ^^. And I ended up helping people too, which is a nice bonus :p . -
I didn't know about the window command... I tried to find out how to see it by reading the core files and trying to reverse-engineer the command-making process.