SnowMV - Simple Gathering

● ARCHIVED · READ-ONLY
Started by Sn0wCrack 161 posts Page 1 of 9 View original ↗

  1. SnowMV - Simple Gathering v2.3.1
    ​


    by Sn0wCrack
    ​


    Introduction
    Simple Gathering is a way to easily setup an item gathering event, including requirements for gathering (such as Pickaxes, Axes, Shovels, etc.) and highly customisable odds based upon what you are gathering and what tools you are using.
     
    How to Use
     
    Since people don't know how to use the Help section, here's the full documentation.

    Spoiler
    /*
    * ============================================================================
    * 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.
    *
    */




    Future Plans

    • None right now

    Bugs
     
    v1:

    • Newlines not working on Incorrect Tools Message  - Fixed as of 1.2.4
    • Stalling on startup, CPU throttling, etc. - Fixed as of 1.3.0
    • Doubling up of "Failed to Harvest Resources" message - Fixed as of 1.3.3

    v2:

    •  Chance break was required - Fixed as of 2.0.1

    Download
     
    Ensure that you rename the scripts to "SnowGather.js" if they are not named that in your plugins folder

    v1:
    https://github.com/Sn0wCrack/SnowMV/blob/master/SnowGather/SnowGather.v1.js 

    v2:
    https://github.com/Sn0wCrack/SnowMV/blob/master/SnowGather/SnowGather.js
     
    Dependencies


    Compatibility


    Credits

    • Yanfly for the note tag reading function
    • Kane Hart for requesting the plugin
  2. Any reason why you've provided access via a script call rather than a plugin call? That's inconsistent and is going to confuse a lot of people
  3. Shaz said:
    Any reason why you've provided access via a script call rather than a plugin call? That's inconsistent and is going to confuse a lot of people
    Well, I'm not really sure how I'd even do that in the first place to be honest, especially with it taking in arrays.

    And I do see a few scripts already posted here that do script calls rather than Plugin Commands, unless I'm completely misunderstanding what a Plugin Command actually is (a simple alias to a function in a Plugin)

    EDIT: I've figured out how to perform a plugin command with Array inputs, I'll update the OP with the new instructions
  4. awsome thank you for releasing this to the community
  5. Sn0wCrack said:
    Well, I'm not really sure how I'd even do that in the first place to be honest, especially with it taking in arrays.

    And I do see a few scripts already posted here that do script calls rather than Plugin Commands, unless I'm completely misunderstanding what a Plugin Command actually is (a simple alias to a function in a Plugin)

    EDIT: I've figured out how to perform a plugin command with Array inputs, I'll update the OP with the new instructions
    can you explain this to me? what is a script call and plugin command and why would it confuse normal users?
  6. Bernkastel said:
    can you explain this to me? what is a script call and plugin command and why would it confuse normal users?
    A script call is directly using JavaScript to run the script, whereas a Plugin Command (which is new to MV) is a simple non-Programmingy way for users to call scripts.

    Like before it was

    Snow.Gather.Gather([2, 5], [5. 4]);to call the script using a Script event command, and now it's just simply

    SnowGather [2,5] [5,4]to call with a Plugin Command event command.

    Shaz was probably just worried people could get confused with this activating differently than most other fairly simple scripts, I don't think it would confuse many considering my instructions, but I implemented it because it was simple enough (but semi-restricting in someways)
  7. @Sn0wCrack thank you for this I can't wait to try it out. I love your idea there of time of day. I could see that really exciting feature later on and adding more complexity. I know some my fav MMO's I wanted to see is a seasons/time based gathering / fishing. I think FF14 has that time of day effects + weather based effects.

    Anyways thanks again I can't wait to give this a try!
  8. Kane Hart said:
    @Sn0wCrack thank you for this I can't wait to try it out. I love your idea there of time of day. I could see that really exciting feature later on and adding more complexity. I know some my fav MMO's I wanted to see is a seasons/time based gathering / fishing. I think FF14 has that time of day effects + weather based effects.

    Anyways thanks again I can't wait to give this a try!
    Glad you like it, was a good exercise in getting to know MV.

    I've just updated the script to support custom messages.
  9. So I'm not sure if I'm doing anything wrong here. I for testing sake using 100 (stone) to mine 101 (coal)

    Then for coal I add these tags:

    <Chance Harvest: 100%>

    <Harvest Minimum: 1>

    <Harvest Maximum: 5>

    I add nothing for stone since I don't need a harvest boost for example just testing so I leave stone notes blank.

    This was the plugin event:

    SnowGather [100] [101]

    I can't harvest I think says failed to harvest. Now if I set it to false so

    SnowGather false [101]

    It works and randomly mines 1-5 ores :)

    I also have a small suggestion it would be cool rather then doing chance based on the ore having one on the picks. (Stone) as an example in my case during the testing.

    Stone Pick Note:

    <Harvest Chance [101]: 100%>

    <Harvest Chance [102]: 70%>

    <Harvest Chance [103]: 40%>

    <Harvest Chance [104]: 0%> - Can't mine it period.

    Maybe something similar to chance break. But making a higher pick on a low item never break or less so here we go.

    <Chance Break: [101] 0%>

    <Chance Break: [102] 5%>

    <Chance Break: [103] 10%>

    <Chance Break: [104] 40%>

    Not sure if these are bad ideas it seems overall it be nice to put most of the control of what you do via the items that way they can become slightly easier to change and work with.

    I also might just doing stuff wrong but loving it so far!
  10. Kane Hart said:
    So I'm not sure if I'm doing anything wrong here. I for testing sake using 100 (stone) to mine 101 (coal)

    Then for coal I add these tags:

    <Chance Harvest: 100%>

    <Harvest Minimum: 1>

    <Harvest Maximum: 5>

    I add nothing for stone since I don't need a harvest boost for example just testing so I leave stone notes blank.

    This was the plugin event:

    SnowGather [100] [101]

    I can't harvest I think says failed to harvest. Now if I set it to false so

    SnowGather false [101]

    It works and randomly mines 1-5 ores :)

    I also have a small suggestion it would be cool rather then doing chance based on the ore having one on the picks. (Stone) as an example in my case during the testing.

    Stone Pick Note:

    <Harvest Chance [101]: 100%>

    <Harvest Chance [102]: 70%>

    <Harvest Chance [103]: 40%>

    <Harvest Chance [104]: 0%> - Can't mine it period.

    Maybe something similar to chance break. But making a higher pick on a low item never break or less so here we go.

    <Chance Break: [101] 0%>

    <Chance Break: [102] 5%>

    <Chance Break: [103] 10%>

    <Chance Break: [104] 40%>

    Not sure if these are bad ideas it seems overall it be nice to put most of the control of what you do via the items that way they can become slightly easier to change and work with.

    I also might just doing stuff wrong but loving it so far!
    You need to include a chance boost, just leave it at 0%, I'll fix this now actually.

    Some fairly good suggestions, I'll look into how to actually implement a per item system, originally a percentage chance of actually mining the items would have been passed in with the items required and the receiving item.
  11. Thanks for that info.

    Yeah it's all cool I can see being item based more then ore based would make a big difference just giving more control over to items. But it's a suggestion nonetheless. 

    I'm really happy you were able to make this. I should ask for plugin suggestions for Ace I spend 1000 hours in Ace and did a lot of things event based and it was killing me a lot. 
  12. I've just updated the script with support for OrangeTimeSystem

    It all seems to work fine so far, all you have to do is setup a second event page with the selfswitch check for "A".
  13. Tried latest version using the same setup as I always did now with mvcommons.

    I get this error when going up to the ore. It should tell me I have no tool etc.

    http://i.imgur.com/KjFr83k.png

    This was the version I used last that worked fine besides of course that report I made.

    https://github.com/Sn0wCrack/SnowMV/commit/389eb3cac63c5cf2af22303b39c5c4531484978e

    I see you added the event stuff at the end not sure if it matters but I did not add it to my event:

    SnowGather [100] [101]
  14. Kane Hart said:
    Tried latest version using the same setup as I always did now with mvcommons.

    I get this error when going up to the ore. It should tell me I have no tool etc.

    http://i.imgur.com/KjFr83k.png

    This was the version I used last that worked fine besides of course that report I made.

    https://github.com/Sn0wCrack/SnowMV/commit/389eb3cac63c5cf2af22303b39c5c4531484978e

    I see you added the event stuff at the end not sure if it matters but I did not add it to my event:

    SnowGather [100] [101]
    Odd, I can't seem to reproduce this, perhaps edit the Plugin's parameters in the Plugin Manager, perhaps since that version didn't have any parameters its not loading anything in. And as a second measure ensure you plugin is called SnowGather.js

    EDIT: I fixed a bug with the time system override not getting read in properly as well
  15. Sn0wCrack said:
    Odd, I can't seem to reproduce this, perhaps edit the Plugin's parameters in the Plugin Manager, perhaps since that version didn't have any parameters its not loading anything in. And as a second measure ensure you plugin is called SnowGather.js

    EDIT: I fixed a bug with the time system override not getting read in properly as well
    That worked. I had to delete the plugin and add it again.

    It all seems to work great now :)

    Tomorrow I will start testing out the timed based stuff I need to edit a bunch of art to make each ore color hehe :)
  16. You don't need to replace OrangeTimeSystem._onChangeHour, you can do this:
     

    OrangeTimeSystem.on('changeHour', Snow.Gather.onChangeHour); 
    and then Snow.Gather.onChangeHour will be called every hour (This is done by Orange Event Manager)
  17. Hudell said:
    You don't need to replace OrangeTimeSystem._onChangeHour, you can do this:

    OrangeTimeSystem.on('changeHour', Snow.Gather.onChangeHour);
    and then Snow.Gather.onChangeHour will be called every hour (This is done by Orange Event Manager)
    Oh, that's much simpler, thank you.

    I've updated the script to include these changes
  18. You guys are great. I spend half my time clicking like :)
  19. Fixed a bug where the generated number wouldn't be only 2 decimal places (due to it applying harvest chance bonuses).

    This could lead to instances where 0.51111 would be generate and the chance is 0.51 to get it, you wouldn't receive the items, minor but a bug to kill nonetheless.

    EDIT:

    Also fixed a bug with the Incorrect Tools Message not using new lines correctly (probably needs a bit more work).
  20. Sn0wCrack said:
    Yanfly for the note tag reading function
    MVC has a notetag reading function.. a single function that can be called with absolute ease!

    Edit:

    Code:
    MVC.getTag(text, tag /*, defaults */)