SnowMV - Simple Gathering

● ARCHIVED · READ-ONLY
Started by Sn0wCrack 161 posts Page 8 of 9 View original ↗
  1. EFizzle said:
    Oh! Good to know! I read about it somewhere in the MVCommons thread, but I didn't know it was a engine wide limitation.


    Another thing, is there anyway to show the icon of the item gathered in the Successful Harvest message? Or would I need a separate plugin (or variable stuff) for something like that?

    If you store the item id into a variable (option within the script itself) you can use that to show an icon in the message box (or so I assume).

    solaris1111 said:
    Hi Sn0wCrack,


    I noticed a problem with respawn, and someone correct me if i'm wrong :


    If i gather something, for exemple, a fruit from a bush. It disappear and reapper after 3 hours. I tested it, everything is fine. But if after i gathered it, i save and leave the game, when i come back after, the fruit bush will never reappear again. Gone forever. Do you think there is something wrong somewhere? Is there a way to fix it? Or it's me, having a problem? The plugins are in the right orders. The tag is the following : <Respawn Time: 3>


    Thank you for your support!


    EDIT: I found a temporary fix that need the second page to be a parallel process that check if it's X hours later than the last gathering. If not, it reset it turning off the A self-switch. In the best world, if i could avoid using Parallel Process it would be nice. 

    Ah yes, I never did implement saving into this. I've put up something that should work, can't test it at the moment, but it should work just fine.
  2. Sn0wCrack said:
    Ah yes, I never did implement saving into this. I've put up something that should work, can't test it at the moment, but it should work just fine.

    I think your plugin do not work anymore. I reinstalled the previous version until then.


    By the way, Hudell is working on an upgrade of OrangeTimeSystem adding plugin command that enable and disable self-switch after x seconds/minutes/hours
  3. solaris1111 said:
    I think your plugin do not work anymore. I reinstalled the previous version until then.


    By the way, Hudell is working on an upgrade of OrangeTimeSystem adding plugin command that enable and disable self-switch after x seconds/minutes/hours

    Do you have any significant error messages for me? I'm sorry that I can't test it myself right now.
  4. Sn0wCrack said:
    Do you have any significant error messages for me? I'm sorry that I can't test it myself right now.

    The snowgather plugin command do not work anymore


    Exemple : SnowGather true [106] 13 this  <- nothing happen anymore.
  5. solaris1111 said:
    The snowgather plugin command do not work anymore


    Exemple : SnowGather true [106] 13 this  <- nothing happen anymore.

    I'll have to take a look at this tomorrow then, as nothing seems to be standing out to me right away
  6. Hi, I just downloaded the newest version of your plugin but it doesnt work for me.


    When I start the game I get this error in the debug tool:


    ZPugZJA.png
  7. I had the same problem as @Iliketea and after a little prodding, was able to fix the issue:


    DataManager.makeSaveContents = fucntion() {
    contents = Snow_Gather_DataManager_makeSaveContents.call(this);
    contents.gathering = Snow.Gather.WaitingEvents;
    return contents;
    }


    "fucntion" ought to be "function" and contents needs to be initialized
  8. Is there a good written documentation or guide?
    I followed perfectly the existing one, but the plugin does not work.
    Nothing happens. I think important steps are missing in the help.
  9. @CyndaBytes


    The current version has a bug, that is why it doesnt work
  10. Iliketea said:
    @CyndaBytes


    The current version has a bug, that is why it doesnt work

    I see :( . So it's an abandoned plugin. Too bad that now there are not alternatives.
    I have to continue work on my event based gathering system.
  11. I've fixed the issue, and that's probably the last thing I'm going to do with this plugin unless something else is broken.
  12. @Sn0wCrack Unfortunately it still doesnt work. The events dont re-spawn.
  13. Iliketea said:
    @Sn0wCrack Unfortunately it still doesnt work. The events dont re-spawn.

    I'm going to need a bit more details with this. Such as your plugin setup as well as any console outputs you're seeing.


    As well as the events you have the script setup on.
  14. Its ok, I found a different way to make it work.


    However I think the issue might have been that I placed your plugin Above the orange time plugin.


    The console didnt show anything and I followed the documentation point for point.
  15. I like it very much but...


    I've resolved a little problem I had with the way of the succes (or fail) messages are displayed.


    When I used a message with a particular display (dark, window or hide) and a particular position before the craft calling, the succes message is displayed the same way.


    To lock that I use :


    $gameMessage._background = [...];


    $gameMessage._positionType = [...];


    before every :


    $gameMessage.addMessage [...]


    It will be fine If you add a parameter to your plugin.
  16. Thanks for this great plug in! Just wanted to share two things with you:


    1. Line 407 of v2 currently reads "if (gen <= hand.chaceHarvest[j].harvestChance) {", and should read "if (gen <= hand.harvestChance[j].harvestChance) {"


    2. In the example Plug In command in the Help section, you have two spaces after SnowGather, but I found that it only worked for me if I deleted one of those spaces.


    Hope that helps (and makes sense)!
  17. Amazing Plugin but I do have some new problem with it. I can not save my game while having this plugin running. Using Yanfly Save Core. But when I do turn off SnowGather I can save my game again.
  18. Hello,


    This script is very cool and usefull ! I added two functions for my personal usage(without plugin commands and params).


    STAMINA VALUE


    First to set a "required Stamina value" using party leader hp and a item notetag <Stamina: [VALUE]>.


    When the craft result is 0 (success) :


    If the stamina value is less than 1/4 + stamina value, the hp is decrease and the gather is enable.


    Else I display a stamina less message and I replace the result game variable value by 2.


    ITEMS WEIGHT COMPATIBILITY


    I'm using MrTS_Limited_invetory.js plugin. So I added compatibility using the same <Weight: [VALUE]> items notetag.


    When the craft result is 0 (success) :


    If the weigth * by the number of items <  $gameParty.getInventorySpaceLeft() //this is the script command to get the space left with MrTS_Limited_invetory.js, I add the items to the player inventory else I decrease the number of items until is ok.


    If no item can be added I display a spaceless message and I replace the result game variable value by 3.


    The code with my modifications:
     

    Spoiler
    //=============================================================================
    // SnowMV - Simple Gathering
    // SnowGather.v2.js
    // Version: 2.3.1
    //=============================================================================

    "use strict";

    PluginManager.register("SnowGather", "2.3.1.1", {
    "email": "",
    "website": "",
    "name": "Sn0wCrack"
    }, "2016-05-22")

    //=============================================================================
    /*:
    * @plugindesc A simple way to manage "gathering" type events.
    * @author Sn0wCrack
    *
    * @param Successful Harvest Message
    * @desc Message to display upon sucessful harvest, %1 is the amount, %2 is the item name
    * @default You gathered %1 %2.
    *
    * @param Unsuccessful Harvest Message
    * @desc Message to display upon failing to harvest items
    * @default Failed to harvest any resources.
    *
    * @param Item Broken Message
    * @desc Message to display when an item breaks upon harvesting, %1 is the item name
    * @default Your %1 broke while harvesting!
    *
    * @param Incorrect Tools Message
    * @desc Message to display when you don't have the right tools
    * @default You don't have any tools that can be used here.
    *
    * @param Select Tool Message
    * @desc Help window message you want to display when player is selecting a tool
    * @default Please select the tool you wish to use
    *
    * @param Hand Tool ID
    * @desc The item ID of the tool that will be used as your hand
    * @default 10
    *
    * @param Hand Tool Last
    * @desc Do you want the hand tool to appear first or last in the items list. true = yes, false = no
    * @default false
    *
    * @param Respawning Events
    * @desc Override the default option when having a time system installed, true = ON, false = OFF
    * @default true
    *
    * @param Manual Self Switches
    * @desc If you wish to manually set self switches in your event for despawning them, true = ON, false = OFF
    * @default false
    *
    * @param Last Result Store
    * @desc If you want to store the last result of a harvest as a variable, true = ON, false = OFF
    * @default true
    *
    * @param Last Result Variable ID
    * @desc The variable to store the last result in, 0 = success, 1 = failure, 2 = incorrect tools
    * @default 1
    *
    * @help
    * ============================================================================
    * Introduction
    * ============================================================================
    *
    * Welcome to the Simple Gathering System by Sn0wCrack, this script allows you
    * to create gathering events in which you players to search for resources using
    * tools (or not if you want!)
    *
    * Please see https://github.com/Sn0wCrack/SnowMV/blob/master/LICENSE for license
    * details.
    *
    * If you use this script, please give credit!
    *
    * ============================================================================
    * Setup
    * ============================================================================
    * In your items database you can tag any item (this means only normal items,
    * not weapons, armour, etc.) with the following tags:
    *
    * Havesting Tools:
    * THESE ARE PUT ON THE ITEMS YOU WANT TO USE TO HARVEST WITH IN THE NOTE TAG SECTION
    *
    * <Harvest Chance Boost: x%> - Not Required
    * This tag allows you to set an amount this particular item will boost
    * the chances of you finding items.
    *
    * <Harvest Chance>
    * itemId: percentage%
    * </Harvest Chance>
    *
    * You can set the chance for harvesting different materials for an item
    * by something like this:
    * <Harvest Chance>
    * 7: 100%
    * 8: 10%
    * </Harvest Chance>
    *
    * <Chance Break>
    * </Chance Break>
    *
    * Same as above however the values are how often the item will break when
    * trying to harvest the resource.
    *
    * Harvestables:
    * THESE ARE PUT ON THE ITEMS YOU WANT TO BE GATHERED IN THE NOTE TAG SECTION
    *
    * <Harvest Minimum: x> - Required
    * The minimum amount of the item to be found upon the successful harvesting of
    * it.
    *
    * <Harvest Maximum: x> - Required
    * The maximum amount of the item to be found upon the successful harvesting of
    * it.
    *
    * Events:
    * THESE ARE PUT ON EVENTS (in the event editor page) YOU WANT TO RESPAWN IN THE NOTE TAG SECTION
    *
    * <Repspawn Time: x> - Required if you want respawing events (Requires OrangeTimeSystem)
    * Sets how long in hours you want the event to respawn in
    *
    * ============================================================================
    * Usage
    * ============================================================================
    * To call the script, create an event with a plugin command
    * SnowGather require tools [recieveable item ids] commonEventId this
    *
    * Replace require tools with true if you want the player to need tools to gather
    * items at this event, or false if you don't want them to use any tools on this
    * particular event spot.
    *
    * Recievable item ids is an array that you replace with something like [7,8]
    * please note how there are not spaces in this, keep it this way or it will not
    * function correctly. This sets the items taht you can get from this event.
    *
    * commonEventId is the id of the common event you want to run after selecting a tool
    * to harvest with. You may ignore this if you don't want to use it.
    *
    * this is well, always the word this, this is only required if you're using
    * a time system.
    *
    * Repsawning Events:
    *
    * In order for an event to actually despawn and then respawn after the allotted
    * time, you must first create second event page, on this page you just have to
    * have the self switch for "A" checked as a condition, leave everything else
    * blank.
    *
    */
    //=============================================================================

    var Snow = Snow || {};
    Snow.Gather = Snow.Gather || {};
    Snow.Gather.Windows = Snow.Gather.Windows || {};
    Snow.Gather.Scenes = Snow.Gather.Scenes || {};
    Snow.Gather.Parameters = PluginManager.parameters("SnowGather");
    Snow.Gather.PopEvents = false;

    Snow.Gather.TempItems = [];
    Snow.Gather.TempRecItems = [];
    Snow.Gather.TempEvent = 0;
    Snow.Gather.TempCommonEvent = 0;

    Snow.Gather.WaitingEvents = [];

    var stamina_enabled = MVC.Boolean(String(Snow.Gather.Parameters["ACTIVATE ESZ STAMINA ADDON"]))|| true;

    // Note Tag Stuff

    Snow.Gather.DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded;
    DataManager.isDatabaseLoaded = function() {
    if (!Snow.Gather.DataManager_isDatabaseLoaded.call(this)) {
    return false;
    }
    this.processNotetagsSnowGather($dataItems);
    return true;
    };

    // Save and Load Stuff

    var Snow_Gather_DataManager_makeSaveContents = DataManager.makeSaveContents;
    DataManager.makeSaveContents = function() {
    contents = Snow_Gather_DataManager_makeSaveContents.call(this);
    contents.gathering = Snow.Gather.WaitingEvents;
    return contents;
    }

    var Snow_Gather_DataManager_extractSaveContents = DataManager.extractSaveContents;
    DataManager.extractSaveContents = function(contents) {
    Snow_Gather_DataManager_extractSaveContents.call(this, contents);
    Snow.Gather.WaitingEvents = contents.gathering;
    }

    // Time System Stuff

    if (Imported["OrangeTimeSystem"] && MVC.Boolean(String(Snow.Gather.Parameters["Respawning Events"]))) {
    Snow.Gather.PopEvents = true;
    Snow.Gather.onChangeHour = function() {
    console.log("1 Hour Passess...");
    for (var i = 0; i < Snow.Gather.WaitingEvents.length; i++) {
    Snow.Gather.WaitingEvents.timeRemaining -= 1;
    if($gameMap.mapId() == Snow.Gather.WaitingEvents.mapId && Snow.Gather.WaitingEvents.timeRemaining <= 0) {
    var key = [$gameMap.mapId(), Snow.Gather.WaitingEvents.eventData.id, "A"];
    $gameSelfSwitches.setValue(key, false);
    Snow.Gather.WaitingEvents.splice(i, 1);
    }
    }
    }
    OrangeTimeSystem.on('changeHour', Snow.Gather.onChangeHour);
    }

    // More Note Tag Stuff

    DataManager.processNotetagsSnowGather = function(group) {
    var note1 = /<(?:HARVEST CHANCE BOOST):[ ](\d+)([%%])>/i;
    var note2 = /<(?:CHANCE BREAK [\d+]):[ ](\d+)([%%])>/i;
    var note2_1 = /<(?:CHANCE BREAK)>/i;
    var note2_2 = /<\/(?:CHANCE BREAK)>/i;
    var note3 = /<(?:HARVEST CHANCE [\d+]):[ ](\d+)([%%])>/i;
    var note3_1 = /<(?:HARVEST CHANCE)>/i;
    var note3_2 = /<\/(?:HARVEST CHANCE)>/i;
    var note4 = /<(?:HARVEST MINIMUM):[ ](\d+)>/i;
    var note5 = /<(?:HARVEST MAXIMUM):[ ](\d+)>/i;
    var note6 = /<(?:STAMINA):[ ](\d+)>/i;
    var note7 = /<(?:WEIGHT):[ ](\d+)>/i;

    var chanceBreakFlag = false;
    var harvestChanceFlag = false;

    for (var i = 1; i < group.length; i++) {
    var obj = group;
    obj.harvestChance = [];
    obj.chanceBreak = [];
    var notedata = obj.note.split(/[\r\n]+/);
    for (var n = 0; n < notedata.length; n++) {
    var line = notedata[n];
    if (line.match(note1)) {
    obj.harvestChanceBoost = parseFloat(RegExp.$1 * 0.01);
    }
    else if (line.match(note2_2)) {
    chanceBreakFlag = false;
    }
    else if (line.match(note2_1)) {
    chanceBreakFlag = true;
    }
    else if (chanceBreakFlag) {
    var data = line.split(": ");
    if (data[1])
    data[1] = data[1].replace("%", "");
    obj.chanceBreak.push({itemId: Number(data[0]), chanceBreak: parseFloat(Number(data[1]) * 0.01)});
    }
    else if (line.match(note3_2)) {
    harvestChanceFlag = false;
    }
    else if (line.match(note3_1)) {
    harvestChanceFlag = true;
    }
    else if (harvestChanceFlag) {
    var data = line.split(": ");
    if (data[1])
    data[1] = data[1].replace("%", "");
    obj.harvestChance.push({itemId: Number(data[0]), harvestChance: parseFloat(Number(data[1]) * 0.01)});
    }

    else if (line.match(note4)) {
    obj.harvestMinimum = parseInt(RegExp.$1);
    }
    else if (line.match(note5)) {
    obj.harvestMaximum = parseInt(RegExp.$1);
    }
    else if (line.match(note6)) {
    obj.stamina = parseInt(RegExp.$1);
    }
    else if (line.match(note7)) {
    obj.poids = parseInt(RegExp.$1)||1;
    }
    }
    }
    }

    // Helper Functons

    Snow.Gather.idIntoItem = function(id) {
    return $dataItems[id];
    }

    Snow.Gather.RandomInt = function() {
    return Math.random();
    }

    Snow.Gather.RandomIntRange = function(min, max) {
    return Math.floor(Math.random() * (max - min + 1)) + min;
    }

    Snow.Gather.Round = function(value, decimals) {
    return Number(Math.round(value + "e" + decimals) + "e-" + decimals);
    }

    // Windows

    var ItemChoiceWindow = function() {
    this.initialize.apply(this, arguments);
    }

    ItemChoiceWindow.prototype = Object.create(Window_ItemList.prototype);
    ItemChoiceWindow.prototype.constructor = ItemChoiceWindow;

    ItemChoiceWindow.prototype.initialize = function(x, y, width, height) {
    Window_ItemList.prototype.initialize.call(this, x, y, width, height);
    this._data = [];
    this.activate();
    this.refresh();
    this.select(0);
    }

    ItemChoiceWindow.prototype.isEnabled = function(item) {
    return true;
    }

    ItemChoiceWindow.prototype.makeItemList = function() {
    this._data = Snow.Gather.TempItems;
    }

    ItemChoiceWindow.prototype.drawItemNumber = function(item, x, y, width) {
    if (this.needsNumber() && item.id != Number(Snow.Gather.Parameters["Hand Tool ID"])) {
    this.drawText(':', x, y, width - this.textWidth('00'), 'right');
    this.drawText($gameParty.numItems(item), x, y, width, 'right');
    }
    }

    Snow.Gather.Windows.ItemChoiceWindow = ItemChoiceWindow;


    var ItemChoiceHelpWindow = function() {
    this.initialize.apply(this, arguments);
    }

    ItemChoiceHelpWindow.prototype = Object.create(Window_Help.prototype);
    ItemChoiceHelpWindow.prototype.constructor = ItemChoiceHelpWindow;

    ItemChoiceHelpWindow.prototype.initialize = function(numLines) {
    Window_Help.prototype.initialize.call(this, numLines);
    }

    Snow.Gather.Windows.ItemChoiceHelpWindow = ItemChoiceHelpWindow;

    // Scenes

    var ToolChoice = function() {
    this.initialize.apply(this, arguments);
    }

    ToolChoice.prototype = Object.create(Scene_ItemBase.prototype);
    ToolChoice.prototype.constructor = ToolChoice;

    ToolChoice.prototype.initialize = function(data) {
    Scene_ItemBase.prototype.initialize.call(this);
    }

    ToolChoice.prototype.create = function() {
    Scene_ItemBase.prototype.create.call(this);
    this._createItemChoiceHelpWindow();
    this._createItemChoiceWindow();
    }

    ToolChoice.prototype.start = function() {
    Scene_ItemBase.prototype.start.call(this);
    }

    ToolChoice.prototype._createItemChoiceWindow = function() {
    this._itemChoiceWindow = new Snow.Gather.Windows.ItemChoiceWindow(0, this._itemChoiceHelpWindow.height, Graphics.boxWidth, Graphics.boxHeight - this._itemChoiceHelpWindow.height);
    this._itemChoiceWindow.setHandler('ok', this._onItemChoiceWindowOK.bind(this));
    this._itemChoiceWindow.setHandler('cancel', this._onItemChoiceWindowCancel.bind(this));
    this.addWindow(this._itemChoiceWindow);
    }

    ToolChoice.prototype._createItemChoiceHelpWindow = function() {
    this._itemChoiceHelpWindow = new Snow.Gather.Windows.ItemChoiceHelpWindow(1);
    this._itemChoiceHelpWindow.setText(Snow.Gather.Parameters["Select Tool Message"]);
    this.addWindow(this._itemChoiceHelpWindow);
    }

    ToolChoice.prototype._onItemChoiceWindowOK = function() {
    var selected = this._itemChoiceWindow.item();
    Snow.Gather.Gather2(selected, Snow.Gather.TempRecItems, Snow.Gather.TempEvent, Snow.Gather.TempCommonEvent);
    this.popScene();
    }

    ToolChoice.prototype._onItemChoiceWindowCancel = function() {
    this.popScene();
    }

    Snow.Gather.Scenes.ToolChoice = ToolChoice;

    // Actual Gathering Stuff

    Snow.Gather.Gather = function(requireItem, recievableItems, commonEvent, event) {
    event = event || {_eventId: 0};
    commonEvent = commonEvent || 0;
    var eventId = event._eventId;

    //================================================== Si aucun outils n'est requis
    if (requireItem == false) {
    var itemisedRecievableItems = [];
    for (var i = 0; i < recievableItems.length; i++) {
    itemisedRecievableItems = Snow.Gather.idIntoItem(recievableItems);
    }

    var resourceGet = 0;
    var hand = Snow.Gather.idIntoItem(Number(Snow.Gather.Parameters["Hand Tool ID"]));

    for (var i = 0; i < itemisedRecievableItems.length; i++) {
    var gen = Snow.Gather.Round(Snow.Gather.RandomInt(), 2);
    for (var j = 0; j < hand.harvestChance.length; j++) {
    if (hand.harvestChance[j].itemId == itemisedRecievableItems.id) {
    if(stamina_enabled){
    console.log("Stamina enabled");
    actor = $gameParty.leader();
    if(actor.hp() >= 100){
    if(gen <= hand.chaceHarvest[j].harvestChance){
    resultat_gather=0;
    var _new_hp = actor.hp()-80;
    actor.setHp(_new_hp);
    }else{
    resultat_gather=1;
    }
    }else{
    resultat_gather=2;
    }

    }else{
    if(gen <= hand.chaceHarvest[j].harvestChance){
    resultat_gather=0;
    }else{
    resultat_gather=1;
    }
    }

    if (resultat_gather==0) {
    console.log("Reussite gather à main nue");
    var itemGathered = Snow.Gather.RandomIntRange(itemisedRecievableItems.harvestMinimum, itemisedRecievableItems.harvestMaximum);
    $gameParty.gainItem(itemisedRecievableItems, itemGathered);
    if (MVC.Boolean(String(Snow.Gather.Parameters["Last Result Store"]))) {
    $gameVariables.setValue(Number(Snow.Gather.Parameters["Last Result Variable ID"]), 0);
    }
    $gameMessage.add(Snow.Gather.Parameters["Successful Harvest Message"].replace("%1", itemGathered).replace("%2", itemisedRecievableItems.name));
    resourceGet++;
    } else if (resultat_gather==1){
    if (MVC.Boolean(String(Snow.Gather.Parameters["Last Result Store"]))) {
    $gameVariables.setValue(Number(Snow.Gather.Parameters["Last Result Variable ID"]), 1);
    }
    } else if (resultat_gather==2) {
    $gameMessage.add("Pas assez d'énérgie");
    }
    }
    }
    }

    if (resourceGet == 0) {
    $gameMessage.add(Snow.Gather.Parameters["Unsuccessful Harvest Message"]);
    }

    if (Snow.Gather.PopEvents) {
    Snow.Gather.WaitingEvents.push({
    mapId: $gameMap.mapId(),
    eventData: $dataMap.events[eventId],
    timeRemaining: Number($dataMap.events[eventId].meta["Respawn Time"])
    });

    if (!MVC.Boolean(String(Snow.Gather.Parameters["Manual Self Switches"])))
    {
    $gameSelfSwitches.setValue([$gameMap.mapId(), eventId, "A"], true);
    }
    }
    //================================================== Si un outils n'est requis
    } else {
    var playerUsableItems = [];
    var itemisedRecievableItems = [];
    var playerInventory = $gameParty.items();

    for (var i = 0; i < recievableItems.length; i++) {
    itemisedRecievableItems = Snow.Gather.idIntoItem(recievableItems);
    }

    var hand = Snow.Gather.idIntoItem(Number(Snow.Gather.Parameters["Hand Tool ID"]));

    if (!MVC.Boolean(Snow.Gather.Parameters["Hand Tool Last"])) {
    for (var j = 0; j < recievableItems.length; j++) {
    for (var k = 0; k < hand.harvestChance.length; k++) {
    if (hand.harvestChance[k].itemId == recievableItems[j]) {
    if (!playerUsableItems.contains(hand)) {
    playerUsableItems.push(hand);
    }
    }
    }
    }
    }


    for (var i = 0; i < playerInventory.length; i++) {
    if (playerInventory.harvestChance !== []) {
    for (var j = 0; j < recievableItems.length; j++) {
    for (var k = 0; k < playerInventory.harvestChance.length; k++) {
    if (playerInventory.harvestChance[k].itemId == recievableItems[j]) {
    if (!playerUsableItems.contains(playerInventory)) {
    playerUsableItems.push(playerInventory);
    }
    }
    }
    }
    }
    }

    if (MVC.Boolean(Snow.Gather.Parameters["Hand Tool Last"])) {
    for (var j = 0; j < recievableItems.length; j++) {
    for (var k = 0; k < hand.harvestChance.length; k++) {
    if (hand.harvestChance[k].itemId == recievableItems[j]) {
    if (!playerUsableItems.contains(hand)) {
    playerUsableItems.push(hand);
    }
    }
    }
    }
    }

    if (playerUsableItems.length == 0) {
    if (MVC.Boolean(String(Snow.Gather.Parameters["Last Result Store"]))) {
    $gameVariables.setValue(Number(Snow.Gather.Parameters["Last Result Variable ID"]), 2);
    }
    $gameMessage.add(Snow.Gather.Parameters["Incorrect Tools Message"]);
    return;
    }

    Snow.Gather.TempItems = playerUsableItems;
    Snow.Gather.TempRecItems = itemisedRecievableItems;
    Snow.Gather.TempEvent = eventId;
    Snow.Gather.TempCommonEvent = commonEvent;

    SceneManager.push(Snow.Gather.Scenes.ToolChoice);
    }
    }

    Snow.Gather.Gather2 = function(chosenItem, recieveableItems, eventId, commonEvent) {
    var resourceGet = 0;

    var harvestChanceBoost = chosenItem.harvestChanceBoost || 0.0;

    if (commonEvent > 0) {
    $gameTemp.reserveCommonEvent(commonEvent);
    }

    for (var i = 0; i < recieveableItems.length; i++) {
    var gen = Snow.Gather.Round(Math.max(0, Snow.Gather.RandomInt() - harvestChanceBoost), 2);
    for (var j = 0; j < chosenItem.harvestChance.length; j++) {
    if (recieveableItems.id == chosenItem.harvestChance[j].itemId) {
    if(stamina_enabled){
    console.log("Stamina enabled");
    var actor = $gameParty.leader();

    if(actor.hp > ( recieveableItems.stamina + Math.floor(actor.mhp/4))){
    if(gen <= chosenItem.harvestChance[j].harvestChance){
    var resultat_gather=0;
    var _new_hp = actor.hp-recieveableItems.stamina;
    actor.setHp(_new_hp);
    }else{
    var resultat_gather=1;
    }
    }else{
    var resultat_gather=2;
    if (MVC.Boolean(String(Snow.Gather.Parameters["Last Result Store"]))) {
    $gameVariables.setValue(Number(Snow.Gather.Parameters["Last Result Variable ID"]), 3);
    }
    };

    }else{
    if(gen <= chosenItem.harvestChance[j].harvestChance){
    var resultat_gather=0;
    }else{
    var resultat_gather=1;
    }
    }

    if (resultat_gather==0) {

    var itemGathered = Snow.Gather.RandomIntRange(recieveableItems.harvestMinimum, recieveableItems.harvestMaximum);
    var itemGatherCounter = itemGathered;
    while(itemGatherCounter>0){
    if(recieveableItems.poids * itemGathered < $gameParty.getInventorySpaceLeft()){
    itemGatherCounter = 0;
    }else{
    itemGatherCounter--;
    itemGathered--;
    }
    };

    if(itemGathered>0){
    if (MVC.Boolean(String(Snow.Gather.Parameters["Last Result Store"]))) {
    $gameVariables.setValue(Number(Snow.Gather.Parameters["Last Result Variable ID"]), 0);
    };
    $gameParty.gainItem(recieveableItems, itemGathered);
    resourceGet++;
    $gameMessage.add(Snow.Gather.Parameters["Successful Harvest Message"].replace("%1", itemGathered).replace("%2", recieveableItems.name));
    }else{
    if (MVC.Boolean(String(Snow.Gather.Parameters["Last Result Store"]))) {
    $gameVariables.setValue(Number(Snow.Gather.Parameters["Last Result Variable ID"]), 4);
    };
    $gameMessage.add("Vous ne disposez pas d'assez de place");
    };

    }else if (resultat_gather==1){
    if (MVC.Boolean(String(Snow.Gather.Parameters["Last Result Store"]))) {
    $gameVariables.setValue(Number(Snow.Gather.Parameters["Last Result Variable ID"]), 1);
    }
    } else if (resultat_gather==2) {
    $gameMessage.add("Pas assez d'énergie");
    }
    }
    }
    }

    if (chosenItem.chanceBreak !== undefined) {
    var itemBroken = false;
    for (var i = 0; i < recieveableItems.length; i++) {
    for (var j = 0; j < chosenItem.chanceBreak.length; j++) {
    if (chosenItem.chanceBreak[j].itemId == recieveableItems.id) {
    var gen = Snow.Gather.Round(Snow.Gather.RandomInt(), 2);
    if (chosenItem.chanceBreak[j].chanceBreak >= gen && !itemBroken) {
    itemBroken = true;
    $gameParty.loseItem(chosenItem, 1);
    $gameMessage.add(Snow.Gather.Parameters["Item Broken Message"].replace("%1", chosenItem.name));
    }
    }
    }
    }
    }

    if (resourceGet == 0) {
    $gameMessage.add(Snow.Gather.Parameters["Unsuccessful Harvest Message"]);
    } else{
    if (Snow.Gather.PopEvents) {
    Snow.Gather.WaitingEvents.push({
    mapId: $gameMap.mapId(),
    eventData: $dataMap.events[eventId],
    timeRemaining: Number($dataMap.events[eventId].meta["Respawn Time"])
    });


    }

    if (!MVC.Boolean(String(Snow.Gather.Parameters["Manual Self Switches"])))
    {
    $gameSelfSwitches.setValue([$gameMap.mapId(), eventId, "A"], true);
    }
    }

    }



    var Snow_Gather_Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
    Game_Interpreter.prototype.pluginCommand = function(command, args) {
    Snow_Gather_Game_Interpreter_pluginCommand.call(this, command, args);
    if (command === "SnowGather") {
    if (args.length == 4) {
    Snow.Gather.Gather(JSON.parse(args[0]), JSON.parse(args[1]), JSON.parse(args[2]), eval(args[3]));
    } else if (args.length == 3) {
    Snow.Gather.Gather(JSON.parse(args[0]), JSON.parse(args[1]), 0, eval(args[2]));
    } else {
    Snow.Gather.Gather(JSON.parse(args[0]), JSON.parse(args[1]))
    }
    }
    }



    That's a begin but I can make it better in a independent js plugin file with more options if someone is interressed (using game variable as stamina, change the targeted party member, add a gauge system and other animations...).
  19. @esziaprez have you got the SnowMV plugins that have compatibility with MrTSLimited Inventory? and if you are using MrTsLimited inventory then you should be aware that there is some issue with MrTsLimited Inventory plugins such as there is no indication once your bag is full but you can still purchase item, money is deducted but no item is added in the bag. have you got the solution to that? if yes, please do share with me the plugins.

    Thanks!
  20. I'm having the same issue as @Vendon (Not being able to save the game while this plugin is running) and was wondering if anyone has managed to figure out a solution. I'm using a lot of different plugins, but I know the issue is with this one since disabling it let's me save. I'm assuming the problem is with this portion of the code:

    180. // Save and Load Stuff
    181.
    182. var Snow_Gather_DataManager_makeSaveContents = DataManager.makeSaveContents;
    183. DataManager.makeSaveContents = function() {
    184. contents = Snow_Gather_DataManager_makeSaveContents.call(this);
    185. contents.gathering = Snow.Gather.WaitingEvents;
    186. return contents;
    187. }
    188.
    189. var Snow_Gather_DataManager_extractSaveContents = DataManager.extractSaveContents;
    190. DataManager.extractSaveContents = function(contents) {
    191. Snow_Gather_DataManager_extractSaveContents.call(this, contents);
    192. Snow.Gather.WaitingEvents = contents.gathering;
    193. }


    Deleting this specific portion of the code allows me to save, but gathering spots won't respawn after loading (since I'm pretty sure this code was added to make the saved game remember the respawn timers).
    I managed to figure out how to open the console and saw this message when I tried saving with the plugin still intact (AKA when the saving doesn't work and gives me the error buzz)snowgather console error.JPG
    I don't know scripting at all really, and will attempt to figure something out, but I figured I'd post this here in case someone already has a solution. If not, can anyone direct me to a different gathering plugin that provides pretty much everything this one does?

    Update: So I realized that "contents" could be referring to the contents = Snow_Gather_DataManager_makeSaveContents.call(this) portion, and just put var before contents. Apparently that makes it work. No error thing in the console (for this at least), I can save, and it seems that the harvest points respawn even after saving and loading. Hurray. So if anyone else has this issue then this seems to be the solution (until something else goes wrong, at which point I'll post another update.)