Moghunter's Time System; how to pull number of months played?

● ARCHIVED · READ-ONLY
Started by Finrod 7 posts View original ↗
  1. I'm wrapping up a simulation game I've been working on, and I'm using Moghunter's time system to control the flow of time. For my initial game players (homeless kids in Manila) I want to have a contest and the person in their group who completes the game the fastest (in game time) will win.

    The way the plugin is set up already has days and years set to variables, but I it doesn't do so for months. I have it set up so that when the player accomplishes the final goal (buys a house) the day and year this was done is locked into their status page with variables through a Yanfly plugin. This works fine. I just have no idea (after fiddling around and guessing a lot for hours) how to get the number of months. Can anyone help with this? Can I convert it somehow to a variable and add it also to the status screen?

    I know absolutely nothing about javascript and plugins, etc. Making this first game has been a fun learning experience for me, but with this I hit a wall.

    Here's a link to the plugin https://atelierrgss.wordpress.com/rmv-time-system/

    Thanks in advance

    Edit: There's this bit of code here too, in the plugin itself:

    Total Days
    //==============================
    // * Total Days
    //==============================
    Game_System.prototype.total_days = function() {
    var months = ($gameVariables._data[this._month_variableId] * this.max_time(this._day_variableId));
    var years = ($gameVariables._data[this._year_variableId] * (this.max_time(this._day_variableId) * this.max_time(this._month_variableId)));
    var days = $gameVariables._data[this._day_variableId];
    this._total_days_week = (months + years + days);
    return this._total_days_week;
    }

    If that does what it sounds like it does--give me the total number of in-game days played-then that could be another solution. Then I wouldn't need to determine the day/month/year that the house was bought, but instead could just use the total number of days. But how do I use that to turn it into a variable?
  2. It is already a variable - the variable whose ID you configured in the plugin options.
  3. Only Hour, Day, and Year appear as variables that I can set in the parameters. Month doesn't show up there.

    For some reason I can't post the screenshot here; it says a server error occurs... Here's a copy/paste from the plugin script itself:

    Variables
    * @param >> VARIABLES ===================
    * @desc
    * @Default
    *
    * @param Hour Variable ID
    * @desc Definição das variável correspondente as horas.
    * @Default 10
    *
    * @param Day Variable ID
    * @desc Definição das variável correspondente os dias.
    * @Default 11
    *
    * @param Year Variable ID
    * @desc Definição das variável correspondente os anos.
    * @Default 12
    *

    If Month is there for me to set/edit, where can I find it? It's not with hour, day and year.
  4. Finrod said:
    If that does what it sounds like it does--give me the total number of in-game days played-then that could be another solution. Then I wouldn't need to determine the day/month/year that the house was bought, but instead could just use the total number of days. But how do I use that to turn it into a variable?
    That was the part of your post that I was answering - the days are already counted in that variable.
    and anything else could be reached by checking changes in that variable.
  5. Thanks for the help, but when I check days, the variable checks the current day, which is never over 30 because the month resets it when it changes to a new month. So it effectively is just giving me the day of the month with the variable, not the total number of days. I'm not sure if I'm writing this clearly.

    So player A finishes the game in 2 months and 17 days, the game says 17 days, not 77 days. That's why I need the month. It would then say 2 months and 17 days. I just discovered this while doing a play through to test things out.

    But that part of scripting that I pasted I think is something else; I just don't know how to use it to tell me the total number of days, rather than just getting the variable day, which is the current day of the game month. I only know how to use the variable. I'm not sure I'm making sense. Sorry if I'm not.
  6. If the function you posted is correct, you can just use that.

    Go to a "Control Variables" Event Command and use the script option to call that function.
    Code:
    $gameSystem.total_days()
  7. Thank you Aloe, I will give that a try. (I tried to use the whole thing...)

    Tested, but it didn't work quite right. I just set it up so I could buy the house on day one, and the result it gave me was 373 days... So maybe it doesn't do what I thought.

    Ok, so using the format you used for this script, I found a place in the plugin script for returning the month. I didn't understand what all the coding meant (and still don't), but I just formatted it like you did, and it worked.

    $gamesystem.month()

    Using the same setup as I did before, buying it on day one, it returns a day, month, and year all of 1, which is correct. I'll test it further on a real play through, but so far so good.

    Will confirm if solved as soon as I turn over to a new month. Thanks!

    I can confirm now this worked. Thank you.