Jump to content


Photo

Action History


  • Please log in to reply
No replies to this topic

#1 Tsukihime

Tsukihime

    Advanced Member

  • Ace Member
  • 7,120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 30 September 2012 - 02:40 PM

Action History
-Tsukihime

This script stores all of the actions and their corresponding results with the battler so you can easily retrieve them when needed. Actions and results are cleared at the end of the battle.

It serves as a base script for any other scripts that would like to use such functionality.

The script itself does not provide any particular functionality for the end-user and is meant for scripters.

It will be improved as needed.

Documentation

Will come eventually...

Game_ActionResult

Added a bunch of instance variables that store cumulative data across all repetitions of a single action.

Game_Battler

Aside from some bookkeeping, the methods of interest are

last_action - returns the last action performed
last_result - returns the last result from some action performed
get_action(index) - returns the action specified by the index
get_result(index) - returns the result specified by the index
pop_action - removes and returns the last action
pop_result - removes and returns the last action
get_turn_actions(turn) - returns an array of actions that have the particular turn count
get_turn_results(turn) - same as above except returns an array of results
Note that while each action produces a result, there is no guarantee that the last result corresponds to the last action. For example, if everyone hits the same battler, then the rest of the battlers will not have any results.

Also note that the action is the action executed by the user, while the result is the result of the action executed by someone else.

A reference to the action used is stored in Game_ActionResult, so if you need to grab the user you can use that link.

Download

Script: Download here

Edited by Tsukihime, 16 March 2016 - 02:06 PM.

All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.pnglogo_instagram40x40.png

Go here for Bugs and Requests.
 
Want to become a beta tester for my plugins before they are released to the public?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users