'Last' Functions for 'Control Variable'

Description of the Feature:
  • On the 'Control Variable' event command window, under operand, add the following functions for pulling a variable from.
  • Last Item Used
  • Last Member To Use An Item
  • Last Member Target Of An Item (0 means All)
  • Last Enemy Target Of An Item (0 means All)
  • Last Skill Used
  • Last Member To Use An Skill
  • Last Member Target Of A Skill (0 means All)
  • Last Enemy Target Of An Skill (0 means All)
  • Last Member Selected
  • Last Enemy Selected (Position)
  • Last Enemy Type Selected (Monster Id)
  • Last Member To Act In Battle
  • Last Enemy To Act In Battle
    .... to be honest the list could be quite huge. So the ones I've listed are the most important ones.

Code for Implementation:
Any time an action is taken in the code that has a user and/or a target, simply save the pertinent info to a new global variable so that local variables can pull them on a "basic" level without eval codes or scripting for us "simpler" users.
Many of these will need to default to 0 until the action actually happens so that if they are called, they won't toss an error.

Mockups:
mockup2.png

Why is this feature good?
This feature is great because of the following:
  • If I for example, want to make a battle event that fires if a party member casted Fire, and then have something happen to THAT caster, like have the enemy target them specifically, there is no current way to do that... you only have "last target" or random as an option on the Force Action event. There is no way (that I can see) for me to find out who that actor was specifically in my event and target him with my event functions. You can only select conditional branches based on specific named actors and not variable ones. Heck you can't even conditionalize what skill was used, only what is learned. I'm actually noticing now while writing this that the conditional branch window provided in battle has all the same options the map version does... which seems odd, as there are no battle specific conditions for branches in the BATTLE eventing system (only the one to START the event, and those are limited). Makes me kind of want to suggest a separate set of conditionals for that now...
  • While there are plugins that add 1 or two of these, the rest are hard to do, or impossible as far as I can see.
  • Having these in as a default function make life a lot easier when trying to have something take effect based on something that just happened.

Possible issues with this feature?
Issues that might arise from this feature:
  • May be possible with a plugin?
  • May be possible with 'script' inside the variable window. But these functions are definitely not only for "advanced" users and are basic functions you could need a lot. And example is StarCraft 2s trigger editor. It lets you call every "last" function available under the sun and it makes you able to pull off a lot of basic tasks. As you can see from this screenshot.


    I'm not asking for every 'last' under the sun, but a few (or any at all) would be nice.

Original thread: https://forums.rpgmakerweb.com/threads/last-functions-for-control-variable.99717/