Item Synthesis Variables (relative to time)

Discussion in 'Javascript/Plugin Support' started by Jhessail, Nov 7, 2018.

  1. Jhessail

    Jhessail Warper Member

    Messages:
    2
    Likes Received:
    1
    First Language:
    English
    Primarily Uses:
    RMMV
    Note - tl;dr synopsis at bottom of post for your convenience.

    So, I have this game I'm working on that makes heavy use of time.
    Specifically every action taken uses up time and adds to the variables that track the time in game.
    Every step passes a little time, every command usable from menu passes time, every combat tracks it's length and adds to the counter.

    I love Yanfly's item synthesis plugin, it greatly simplifies item synthesis, but I'm wondering, and I'm not skilled at scripting so I might be missing a very obvious solution, but, what I'm trying to figure out is if there is a way to make this system add an amount to a variable (to pass the time it takes to craft the item) for each different craftable item.

    For example, say if you were going to make a potion, that might take 5 minutes, so I'd want to be able to put something into the potion's crafting section that added 5 to the minute tracking variable.

    I do see a workaround involving some extra common events to be called by the crafting system, but it would be very resource intensive (basically assign a variable to each craftable item, have it check each to see if they've changed and increase accordingly if they have, would work, but be very top heavy and in conjunction with other complex systems would contribute to slowdown running the game, an undesirable trait to say the least, not to mention the extra time it'd take, the additional variables reserved, and reduction to the effective modularity that the plugin provides).

    tl;dr I'm looking for a way to change a variable anytime an item is crafted using Yanfly's Item Synthesis Plugin, set per item. I suspect it can be done through some lunatic mode script, but I'm not familiar enough with scripting to work out the details.

    Additional Note - Doubt it matters, but in case it effects responses, the time system is not timer based and does not take real time into account.
     
    #1
  2. Jhessail

    Jhessail Warper Member

    Messages:
    2
    Likes Received:
    1
    First Language:
    English
    Primarily Uses:
    RMMV
    So, I got this working, thanks to data I found in an old post on a related question by Sarah_yt (thank you) in answer to Yusha.

    An example of the code I used for anyone else looking to solve this problem.

    <Custom Synthesis Effect>

    var x = $gameVariables.value(3);

    x = x + 10;

    $gameVariables.setValue(3, x);

    </Custom Synthesis Effect>

    To break that down, x is a created variable within the function, variable 3 is my game's variable that tracks minutes, and yeah, it just gets the variable (which I did not know how to do until reading the similar answer), modifies it according to need and sets it again. Nice and simple, easy peasy, problem resolved. Actually not sure why the searches I did previously didn't come up with the post in question (Yanfly's Item Synthesis and adding variables, posted Jul 18 2017 by Yusha) when I did my presearch before posting this question (likely something wrong on my end, either the computer, or some typo, still annoying because I searched for numerous combinations of words that should have gotten me that result, eh, no matter).
     
    #2
    xDRAGOONx likes this.
  3. xDRAGOONx

    xDRAGOONx Villager Member

    Messages:
    10
    Likes Received:
    2
    First Language:
    English
    Primarily Uses:
    RMMV
    Thank you for posting this! It is exactly what I was looking for! After looking at the sample of Lunatic Mode: Custom Synthesis Effects, I knew it was possible to add to variables like this but I couldn't figure it out on my own.
     
    #3

Share This Page