Tsukihime 1,426 Report post Posted May 22, 2012 (edited) Game log Author: Tsukihime Overview This script attempts to provide a standard way to keep track of game-related "records" such as how many encounters you've had throughout the game, how many enemies you've killed, how many times you've escaped from battle, etc. The idea is to allow developers to quickly add things that they want to keep track of without having to write their own logging system. Features Keep track of various things with simple method calls Design your own records scene using standard object access to retrieve data Usage Game Log is accessed using the script call SceneManager.call(Scene_Records) For users, you can use script calls to keep track of events. For example, if you want to keep track of how many chests have been opened, you might add a script call $game_records.add_record("Chest", 1) Which increments the number of chests you've opened by 1. For developers (scripters), all global records are stored in the Game_Records object accessed via $game_records. Each Battler object also has their own Game_Records object which can be retrieved using @game_records. All record adding and removing should be done using the methods provided by the Game_Records object. You can add your own methods if you need. The provided methods so far are init_record(record, value) - meant for initializing a record add_record(record, value) - for number-related records add_set_record(record, value) - for set-related records add_hash_record(record, key, value) - for hash-type records. Values must be numeric types. add_max_record(record, value) - for "max" type of records get_record(record) - retrieves the value for this record get_max_record(record) - for hashes. Collects all of the values and returns the largest key all_records You can quickly go through different classes and add some calls if you want to record things. A simple alias with an extra line of code is typically enough to get the job done. A simple Records window has been provided for each actor and the party in general, which simply goes over each record and displays the value associated with it. The code is written so that you can design your own records window and style it however you wish. All you need is $game_records and all of the information is available to you. To toggle between actor and party mode, just press the A key (game "X"), or press pageup and pagedown to scroll through actors. An experimental feature I am implementing is the use of "record details", specified as the 4th element of each Record Table entry. It allows you to display specific information recorded in array or hash records. For example, Downloads Script: http://db.tt/AayH4x05 Notes I am not sure what is interesting to record. Suggestions? Also, all of these things can be accomplished using in-game variables. But rather than using variables, which are specific to the individual project, I think it's better to just store them somewhere else. Edited May 22, 2012 by Tsukihime 2 oriceles and Chaos17 reacted to this Share this post Link to post Share on other sites
DisturbedInside 2 Report post Posted May 22, 2012 Very nice!! What kind of a project can I use this in (commerical or non-commercial?) Suggestion: steps taken? maybe... quests completed (modern Algebra's script) Monster species seen? ~~DisturbedInside Share this post Link to post Share on other sites
Tsukihime 1,426 Report post Posted May 22, 2012 (edited) I don't mind how people use the scripts as long as they leave credits. I've added support for monster species and steps taken. That quest script will need to be modified to add a new record. I've added a new method for storing records: add_set_record(record, value) This is for "set" related records. For example, monster species seen would store a list of enemy ID's that you've encountered. Since you want to store unique instances, you'd use a Set data structure. It is currently stored as an array, but at the very least the implementation should support "size" and "count" methods to retrieve the number of elements in the data structure. Other set-related records include "types of weapons/armors/items collected" I will look into adding a new type of record that allows you to specify things like "2 out of 20 eggs" or something, if you want to keep track of specific items that users can collect throughout the game. Maybe storing individual logs would be nice as well, so you can keep stats for each actor. Like, actor that killed the most enemies, or actor that died the most. Edited May 22, 2012 by Tsukihime 1 DisturbedInside reacted to this Share this post Link to post Share on other sites
DisturbedInside 2 Report post Posted May 22, 2012 (edited) Thank you!!! Can't wait to use it in my game!! Lol. The character that died the most Ralph = loser XD Edited May 22, 2012 by DisturbedInside Share this post Link to post Share on other sites
+ Novem 344 Report post Posted May 22, 2012 This is neat and all, but I swear there is another script for this same exact purpose. Found it, http://www.rpgmakervxace.net/topic/2257-xs-records/ Sorry to burst your bubble. Or is there features in this script that are better than the other one I just showed? I'm just wondering why I should use this instead of that. Share this post Link to post Share on other sites
Tsukihime 1,426 Report post Posted May 22, 2012 (edited) Seems like it's getting hard to keep track of arbitrary types of records. Even with my "hash type" record, all of the values must be numbers which is quite limited.. For example, the "actor that died the most" is implemented using a hash record, where each key is the actor name and each value is the number of times the actor died. This is neat and all, but I swear there is another script for this same exact purpose. Found it, http://www.rpgmakervxace.net/topic/2257-xs-records/ Sorry to burst your bubble. Or is there features in this script that are better than the other one I just showed? I'm just wondering why I should use this instead of that. Let me know if you can implement something like "enemy species seen" or "weapon types collected" using that script. Or "actor that died the most" or "monster defeated the most" If so then there isn't much of a difference Edited May 22, 2012 by Tsukihime 1 DisturbedInside reacted to this Share this post Link to post Share on other sites
Daniel Tom 9 Report post Posted May 22, 2012 well, I saw another which was made before you post it. Share this post Link to post Share on other sites
Gadwin 8 Report post Posted May 22, 2012 is it possible to see the kill count and the death count of a character? and is it also possible to view the death count of a specific monster? Share this post Link to post Share on other sites
Tsukihime 1,426 Report post Posted May 22, 2012 (edited) I'm still thinking of a good way to track actor information. For enemy death counts, I think you are better off using a monster encyclopedia or something like that. Edited May 22, 2012 by Tsukihime Share this post Link to post Share on other sites
syrus ultima 44 Report post Posted May 22, 2012 (edited) This is neat and all, but I swear there is another script for this same exact purpose. Found it, http://www.rpgmakerv...257-xs-records/ Sorry to burst your bubble. Or is there features in this script that are better than the other one I just showed? I'm just wondering why I should use this instead of that. Do you not understand the saying "to each his own"? Tsukihime's script is more user friendly, yea it might be similar but for some people simplicity works best. I like this one better because as a developer or if I am beta testing my game I can get critical statistics. not everything has to be criticized. Edited May 22, 2012 by syrus ultima Share this post Link to post Share on other sites
Tsukihime 1,426 Report post Posted May 22, 2012 (edited) This is how I've implemented actor logs: each actor has their own Game_Record object. It will track specific information that's unique to each actor, such as how many times they've died. Unfortunately, the global $game_records is not connected to the actor's @game_records, which means you are potentially making duplicate calls just to update two different records. I think it might make a little more sense if the total kill count is the sum of all of the actors' kill counts rather than having to record it separately, but I don't want to hardcode things just to go and search for data. Actor kill count is implemented by adding a "last hit user" to the battler object. This means several things -if you use a poison spell on an enemy, and the enemy dies FROM that poison later on, the user that casted the poison spell gets the kill count -if you kill yourself, you still get a kill count. Maybe I should treat this as "suicide count"? Just check whether the last person that hit you is yourself You can toggle between party log and actor log by pressing the A key (game "X"), or pressing pageup or page down to scroll through actors. Edited May 22, 2012 by Tsukihime Share this post Link to post Share on other sites
syrus ultima 44 Report post Posted May 22, 2012 -if you kill yourself, you still get a kill count. Maybe I should treat this as "suicide count"? Just check whether the last person that hit you is yourself Lol this is awesome. Can all these be changed to suite user specifics? Share this post Link to post Share on other sites
Tsukihime 1,426 Report post Posted May 22, 2012 (edited) They should be, though I haven't found a really good way to do it. The XS records script uses an array for each type of record that should be kept track of, using variables as the key. I might use an array as well so that users can specify order, "display name", icons, visibility, and things like that. Naturally, the record keys should be separate from the display name. Being able to hook them up to variables would be nice as well though "control variable" provides a script call field so you can sort of just say $game_records.get_record(RECORD_KEY) or something EDIT: well, I added an array lol Edited May 22, 2012 by Tsukihime Share this post Link to post Share on other sites
syrus ultima 44 Report post Posted May 22, 2012 I will most likely use this. I need something for vehicle steps. I want to be able to use this script specifically for design creation purposes rather than for those who play my game. Thats what I like so much about it. Share this post Link to post Share on other sites
Tsukihime 1,426 Report post Posted May 22, 2012 (edited) I've added an array for configuration. Right now you need two things: First, define the Record key. This is only to prevent duplicate code across your scripts by using constants. Actually this isn't necessary, but results in cleaner code. Second, add a new entry to the Record table. This is used by the windows to determine what to draw, whether it should be drawn, and how to draw it. I would like to avoid declaring constants first so you just have to work with a record table, but that means you'll end up hardcoding strings throughout your scripts for logging. New feature in the works: "Record Details" You can store arrays and hashes, so why not display what you've stored? Each record can optionally have details. I'm planning on changing the hashes and arrays to return their sizes and totals by default, and allow you to open up the details to view specific information. Since all hashes values should be numbers, I can do something like this. Edited May 22, 2012 by Tsukihime Share this post Link to post Share on other sites
ergz 1 Report post Posted May 23, 2012 Very cool. Is it ok if I modify this script to be used as a secrect unlock record. For exmaple you have found 10 out of 120 chests. You have mastered 5 out of 100 skills. You have 1 seceret wepons out of 4. Share this post Link to post Share on other sites
Tsukihime 1,426 Report post Posted May 23, 2012 (edited) Yes, I provide the basic logging functionality and scripters can modify it to suit their needs. You can post improvements as well. Edited May 23, 2012 by Tsukihime Share this post Link to post Share on other sites
decadence 3 Report post Posted July 20, 2012 Newbie question, but, is there a way to store some of that information into actual game variables? So that I could, for example, incorporate the total amount of kills into a damage formula for a skill. Thanks and good day(: Share this post Link to post Share on other sites
Tsukihime 1,426 Report post Posted July 20, 2012 (edited) I've updated the script to allow you to specify which variable the data is stored in. Each entry in the Record_Table at the top of the script has a number in the 5th element of the list. If it's non-zero, then it's stored in the appropriate game variable and is updated whenever the record is updated. Note that because of poor design, only records that are VISIBLE (eg: 2nd element is true) can be stored in variables. I'll have to re-think how it is done... Record_Table = [ [battle_Defeat, true, "Battle Defeats", "", 0], # don't store [battle_Victory, true, "Battle Victories", "", 1], # store in 1st variable [battle_Escape, true, "Battle Escapes", "", 2], # store in 2nd variable ... ] The only reason I used an array was to allow you easily specify sort order, but it's not really easy to access information as a result... Edited July 20, 2012 by Tsukihime Share this post Link to post Share on other sites
decadence 3 Report post Posted July 20, 2012 That was quick! Exactly what I needed, thanks!(: Now I don't have to make 12908371289 pages of battle events @_@" Share this post Link to post Share on other sites
decadence 3 Report post Posted July 20, 2012 Double post but... there seems to be a syntax error on line 70. I would attempt to fix it if I had the slightest scripting knowledge x.x Share this post Link to post Share on other sites
Tsukihime 1,426 Report post Posted July 20, 2012 Try again I don't know how an extra character got in there. Share this post Link to post Share on other sites
decadence 3 Report post Posted July 21, 2012 (edited) Thanks, works perfectly now (: I just have an incompatibility issue with another script of yours x.x I'll PM you about it. EDIT: Nevermind, it was a problem with the script itself. Edited July 21, 2012 by decadence Share this post Link to post Share on other sites
Tsukihime 1,426 Report post Posted July 21, 2012 Which script? There are a couple scripts that are written poorly. Like, passive effects and all. Share this post Link to post Share on other sites
decadence 3 Report post Posted July 22, 2012 I had a bit of trouble getting your FP: Equip Slots to work with Yanfly's Equip Engine, but after some tweaking everything works fine now(: Share this post Link to post Share on other sites