Storing Players Decisions

Discussion in 'Javascript/Plugin Support' started by Borkadd, Oct 5, 2019.

  1. Borkadd

    Borkadd Warper Member

    Messages:
    1
    Likes Received:
    0
    First Language:
    Spanish
    Primarily Uses:
    RMMV
    Hello!

    I am currently working in a plugin to store player's choices. This plugin must be able to store all the player's decisions during events in a database or a json or in any other format than can be accessed from outside the game.

    Does anyone know how to get the player's decisions outside the event?

    THanks in advance
     
    #1
  2. Silva

    Silva Scoobityboo Veteran

    Messages:
    305
    Likes Received:
    151
    First Language:
    English
    Primarily Uses:
    RMMV
    I'd say the best place to start is Game_Message. I'm not sure which value you're trying to store. If you're trying to store the index I would suggest looking at Game_Message.prototype.onChoice

    Code:
    Game_Message.prototype.onChoice = function(n) {
        if (this._choiceCallback) {
            this._choiceCallback(n);
            this._choiceCallback = null;
        }
    };
    n is the index of the choice. I'm not in a position to play around with the anything but I would assume you can get the text that's stored in the choice by using the line

    Code:
    this._choices[n]
     
    #2
  3. Almightypebble

    Almightypebble Veteran Veteran

    Messages:
    57
    Likes Received:
    1
    First Language:
    Bulgarian
    Primarily Uses:
    RMMV
    Why not have the choices linked to variables or switches?
    For example if you have 4 choices, you connect them to a variable that changes from 1-4 depending on the choice you select or if you have a yes or no kinda choice you just make it turn a switch on or off.
    And then they can be accessed through the save files right?
    You can just have a autosave file which keeps updating at specific points or something like that and the variables and switches are visible in it, outside of the game.
     
    Last edited: Oct 7, 2019
    #3
  4. Restart

    Restart Veteran Veteran

    Messages:
    235
    Likes Received:
    157
    First Language:
    English
    Primarily Uses:
    RMMV
    Why do you need to access them from outside the game? Doing some sort of save import thing?
     
    #4

Share This Page