Jump to content


Photo

Game Log


  • Please log in to reply
32 replies to this topic

#1 Tsukihime

Tsukihime

    Advanced Member

  • Member
  • 7120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 21 May 2012 - 08:03 PM

Game log
Author: Tsukihime

Posted Image

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.

Posted Image

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,

Posted Image

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 by Tsukihime, 22 May 2012 - 04:21 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?

#2 DisturbedInside

DisturbedInside

    The Math genius is going on hiatus

  • Member
  • 96 posts
  • LocationSomewhere, but not anywhere and always where I want to be!
  • RM Skill - Jack of All Trades

Posted 21 May 2012 - 08:26 PM

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
~~~DisturbedInside

Posted Image

My scripts:

DisturbedInside's Party Manager

#3 Tsukihime

Tsukihime

    Advanced Member

  • Member
  • 7120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 21 May 2012 - 08:55 PM

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.

Posted Image

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 by Tsukihime, 21 May 2012 - 08:59 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?

#4 DisturbedInside

DisturbedInside

    The Math genius is going on hiatus

  • Member
  • 96 posts
  • LocationSomewhere, but not anywhere and always where I want to be!
  • RM Skill - Jack of All Trades

Posted 21 May 2012 - 09:04 PM

Thank you!!! Can't wait to use it in my game!!
Lol. The character that died the most

Ralph = loser
XD

Edited by DisturbedInside, 21 May 2012 - 09:05 PM.

~~~DisturbedInside

Posted Image

My scripts:

DisturbedInside's Party Manager

#5 Novem

Novem

    Author

  • + Sponsor
  • 2679 posts
  • LocationTonawanda, New York
  • RM Skill - Writer

Posted 21 May 2012 - 09:05 PM

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.
Hey there. I'm Novem, author and a long time veteran of this community (previous known under names such as Nine or Obrusnine). 
 
If you're interested in my books, you can find them on amazon in the links in this spoiler.
 

 
Quotes:
Spoiler


uUftBOz.png

#6 Tsukihime

Tsukihime

    Advanced Member

  • Member
  • 7120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 21 May 2012 - 09:12 PM

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..

Posted Image

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.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.


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 by Tsukihime, 21 May 2012 - 10:25 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?

#7 Daniel Tom

Daniel Tom

    Let be a Team

  • Member
  • 220 posts
  • LocationLook I am new
  • RM Skill - Writer

Posted 22 May 2012 - 06:04 AM

well, I saw another which was made before you post it.
Posted Image

Banner:
Game Maker
Spoiler


Heir of the King

#8 Gadwin

Gadwin

    Unsigned Zero

  • Member
  • 144 posts
  • LocationMetro Manila, Philippines
  • RM Skill - Pixel Artist

Posted 22 May 2012 - 12:58 PM

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?
Power alone is just plain power.

Scripts
Custom BattleStatus Pause Script

#9 Tsukihime

Tsukihime

    Advanced Member

  • Member
  • 7120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 22 May 2012 - 01:07 PM

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 by Tsukihime, 22 May 2012 - 02:45 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?

#10 syrus ultima

syrus ultima

    RM Skill: Logic

  • Member
  • 289 posts
  • RM Skill - Musician

Posted 22 May 2012 - 01:13 PM

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 by syrus ultima, 22 May 2012 - 01:14 PM.

myuserbar.png
Where I work



Current Project:

Spoiler


#11 Tsukihime

Tsukihime

    Advanced Member

  • Member
  • 7120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 22 May 2012 - 02:06 PM

Posted Image

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

Posted Image

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 by Tsukihime, 22 May 2012 - 02:25 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?

#12 syrus ultima

syrus ultima

    RM Skill: Logic

  • Member
  • 289 posts
  • RM Skill - Musician

Posted 22 May 2012 - 02:21 PM

-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?

myuserbar.png
Where I work



Current Project:

Spoiler


#13 Tsukihime

Tsukihime

    Advanced Member

  • Member
  • 7120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 22 May 2012 - 02:40 PM

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 by Tsukihime, 22 May 2012 - 03:07 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?

#14 syrus ultima

syrus ultima

    RM Skill: Logic

  • Member
  • 289 posts
  • RM Skill - Musician

Posted 22 May 2012 - 03:09 PM

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.

myuserbar.png
Where I work



Current Project:

Spoiler


#15 Tsukihime

Tsukihime

    Advanced Member

  • Member
  • 7120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 22 May 2012 - 03:16 PM

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?

Posted Image

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.

Posted Image

Edited by Tsukihime, 22 May 2012 - 04:31 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?

#16 ergz

ergz

    Terranigma Origins - Creator

  • Member
  • 48 posts
  • LocationSomewhere under a rock thats under a bigger rock
  • RM Skill - Jack of All Trades

Posted 22 May 2012 - 07:12 PM

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.
Posted ImagePosted Image

I will add you to the sponsors in the credits of the game if you do! Thanks so much for your support!

Become a sponsor add the above sponsor badge to your website, MySpace, Facebook, blog, signature or whatever you have.
Make sure you link the badge to this forum and notify me once comeplete.
(If you need a support badge for a black background let me know, or if you need a custom one)

Let the legend begin!


Posted Image
Also please support TERRA EARTH HOME OF TERRANIGMA if you love this game.
Click the banner above.

Posted Image
Here is a smaller badge if you need one smaller

#17 Tsukihime

Tsukihime

    Advanced Member

  • Member
  • 7120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 22 May 2012 - 07:20 PM

Yes, I provide the basic logging functionality and scripters can modify it to suit their needs.

You can post improvements as well.

Edited by Tsukihime, 22 May 2012 - 07:21 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?

#18 decadence

decadence

    Member

  • Member
  • 27 posts
  • RM Skill - Jack of All Trades

Posted 20 July 2012 - 12:57 PM

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(:

#19 Tsukihime

Tsukihime

    Advanced Member

  • Member
  • 7120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 20 July 2012 - 01:28 PM

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 by Tsukihime, 20 July 2012 - 01:35 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?

#20 decadence

decadence

    Member

  • Member
  • 27 posts
  • RM Skill - Jack of All Trades

Posted 20 July 2012 - 01:33 PM

That was quick! Exactly what I needed, thanks!(:
Now I don't have to make 12908371289 pages of battle events @_@"




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users