YR Plugins

Discussion in 'JS Plugin Releases (RMMV)' started by Waterguy, Oct 2, 2016.

  1. Kes

    Kes Global Moderators Global Mod

    Messages:
    20,602
    Likes Received:
    10,511
    First Language:
    English
    Primarily Uses:
    RMVXA

    Anohe1, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.


    I have merged your 2 posts together for you this time. If you want to add something, and no one has posted after you and it is less than 72 since your post, just use the Edit button and add the extra info/comment. For clarity's sake people often put in the word EDIT, as I have done for your post.
     
  2. Anohe1

    Anohe1 Villager Member

    Messages:
    24
    Likes Received:
    4
    First Language:
    French
    Primarily Uses:
    RMMV
    What is double Posting and how your Edit thing ???
     
  3. Krystek_My

    Krystek_My Veteran Veteran

    Messages:
    172
    Likes Received:
    39
    First Language:
    Polish
    Primarily Uses:
    RMMV
    Double posting is posting 2 messages right after first one them in less than 48 hours.
    But if someone posted after first message you can post again.
    Our friend @Kes in his post give a link to rules:
     
  4. Anohe1

    Anohe1 Villager Member

    Messages:
    24
    Likes Received:
    4
    First Language:
    French
    Primarily Uses:
    RMMV
    Ok I see thanks I took care of the problem anyway
     
  5. Waterguy

    Waterguy Veteran Veteran

    Messages:
    1,183
    Likes Received:
    254
    Location:
    Brazil
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    @Anohe1 thanks for the warning. I'll fix it soon, I'm working in a new plugin right now that I hope people will like.

    And I posted my New Parameters plugin on itch.io... Hope that leads to more people know about it and use it.
     
  6. Anohe1

    Anohe1 Villager Member

    Messages:
    24
    Likes Received:
    4
    First Language:
    French
    Primarily Uses:
    RMMV
    Thank you very much and keep up the good work
     
  7. Gregaur

    Gregaur Veteran Veteran

    Messages:
    86
    Likes Received:
    10
    First Language:
    french
    Just to tell you that I "fixed" the problem my self by showing the number of remaining tours / 2 (by changing the YEP plugin)

    So If i want the player to wait for 4 tours, I put the note box <Cooldown: 8>
    It will show 4 tour and deacrese by 2/2 tours every tours

    It may give you some ideas ;)
     
  8. Khulse

    Khulse Villager Member

    Messages:
    13
    Likes Received:
    4
    First Language:
    English
    Primarily Uses:
    RMMV
    Hey there, Waterguy! Thanks for the wonderful crafting plugin. A couple of the features found in yours that don't seem to be anywhere else are exactly what I was looking for!

    I did come across a couple of problems. I managed to poke at them until I fixed them, but I though I should let you know about them (Warning: Wall O Text ahead).

    First: I kept running into a problem where crafting with one particular discipline would freeze the game- it acted a bit like an infinite loop. I had to close the test window with task manager.
    It turned out to be the xp requirements. I had set it to have the same xp requirements per level. For some reason, if the xp requirements for each level are exactly the same, it freezes the game.
    It took going back and changing that discipline's settings to default one by one to figure that one out.

    Second: While I was troubleshooting the first problem, I loaded Yanfly's item core which I hadn't loaded up yet. I got an error stating something like 'requirement is undefined', and listed line 1340 as where the problem was. I went and had a look in the code, and found that line 1340 is part of an if else if that starts with a line reading:
    Line 1340 itself read:
    I changed requirement to result in line 1340 and line 1358, and that got rid of the problem.
    I'll admit I'm not much of a programer, just an experienced game modder. I don't know if I may have broken something for myself down the line, but it was the only way to get past the error. It does look to me like result was supposed to be requirement or vice versa, since it wouldn't make much sense otherwise. Can you confirm that, and tell me which it's actually supposed to be?

    Third: I created 11 crafting skills at one point, in order to test an idea. At that point, the plugin stopped working altogether. Nothing related to the plugin seemed to be working in any way, such as an event I had set up to test calling discipline xp and level crashing the game with 'getDisciplineLevel is not a function'.
    It seems you can't have more than 8 disciplines. If you go to nine, the plugin doesn't load.

    So, a couple issues you (and other users of this great plugin) should be aware of. For me personally, the only one I'm concerned about is two. I'm fine with 8 disciplines (I only need five), and don't really need a flat xp rate. I just like to experiment.

    One other question, though, if you happen to know. I want to have recipes drop off monsters. Is there any way you know of to have an item add the recipe when picked up? Obviously, I can have the item call an event to add the recipe when used, but that would be a lot of common events.
    Edit: Never mind, I figured out a method. For those that would like to do the same thing:
    Create an item to act as your recipe and insert the following in the damage formula:
    Code:
    var myInterpreter = new Game_Interpreter(); myInterpreter.pluginCommand('CRAFT', ['LEARN', 'ITEM', 'replacewithItemID']); //to learn all recipes for an item
    or
    var myInterpreter = new Game_Interpreter(); myInterpreter.pluginCommand('CRAFT', ['LEARN', 'ITEM', 'replacewithItemID', 'replacewithRecipeIndex']); //to learn a specific recipe.
    
    Substitute 'WEAPON' or 'ARMOR' in place of 'ITEM' when it's a recipe for weapon or armor.
    You'll need to add something else for the item to do if you want it to actually work. I just added a generic common event to the Effects box that displays a message.
    I can't figure out any way to run a conditional to determine if a recipe is already known, though. It would be nice to be able to tell the player they already know a recipe.
     
    Last edited: Jul 24, 2019
  9. zaraku

    zaraku Time Keeper Member

    Messages:
    29
    Likes Received:
    23
    First Language:
    English
    Primarily Uses:
    RMMV
    Hi Yorae,

    Your DB state transformation plugin seems to be conflicting with YEP Party System on my end. I get the following error:
    [​IMG]

    It occurs regardless of the position of the plugin, and the game runs fine when either your plugin or party system is turned off.
     
  10. Waterguy

    Waterguy Veteran Veteran

    Messages:
    1,183
    Likes Received:
    254
    Location:
    Brazil
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    @zaraku that is weird, because I had both on my project and no problem...
    but judging from the error it seems to be a naming problem, easy to fix. We'll see.

    @Khulse I see, thanks for pointing it out. I only tested it myself, so many errors may have slipped through, so thanks for taking the time to report them. I'll fix them soon, and then I'm sure someone will point out even more errors I let slip... :(

    I'm working on a personal plugin, a version of BreakerZero's rumble plugin because he seems to not know how to add turning it on or off to the options and it is basically making the first gamepad rumble and not the latest used, something that is problematic for someone that has more than one connected. So I'll make the changes I kinda need to it, send the finished file to BreakerZero's thread (he made the base plugin after all) and then I'll mess with these two plugins and fix these problems. Sorry for taking so long, I'll mention you guys when it is done.
     
    Khulse and zaraku like this.
  11. Khulse

    Khulse Villager Member

    Messages:
    13
    Likes Received:
    4
    First Language:
    English
    Primarily Uses:
    RMMV
    @Waterguy Don't worry. If someone ever makes a plugin (or mod) with no bugs at first release, it'll probably implode the sun lol.

    You never know what's going to happen until some monkey starts monkeying with things. Keep up the good work.
     
  12. Hahasea

    Hahasea Veteran Veteran

    Messages:
    115
    Likes Received:
    13
    First Language:
    English
    Primarily Uses:
    RMMV
    Hi @Waterguy, this plugin looks amazing, thanks so much.

    While I've used a fair few plugins successfully, I'm still a bit of a beginner, and I'm finding it hard to get my head around a couple of things. Mainly - where exactly do you put all the notetags and recipes?

    I don't know if you're up for this, but a demo would be amazing, that way I (and other green developers) don't need to bother you as much, we could just figure it out ourselves by looking at how the demo is set up.

    Also, what is the difference between:

    Result Item x

    and

    Result Item x: y

    ?

    And more questions:
    Are you supposed to replace every instance of 'x' in a recipe with a corresponding discipline?
    When you fill out category/discipline etc, should that text be in double brackets, or without?

    Would be really helpful to see some examples of the recipe notetag actually filled out.

    Sorry for being such a newb, everyone else seems to know exactly how to proceed!
     
    Last edited: Aug 6, 2019
  13. Waterguy

    Waterguy Veteran Veteran

    Messages:
    1,183
    Likes Received:
    254
    Location:
    Brazil
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    @zaraku check if it is working now, I think it should be. I changed it so the battler change code only happens during battle now. To be honest, I should have done this in the first code already... https://www.dropbox.com/s/21eh2a9uvdz6ip4/YR_DBStateTransform.js?dl=0

    @Hahasea I had a test project, but it doesn't do much besides the basics... as you can see by the list of fixes needed that missed as mentioned above by Khulse.

    The notetags... in the main result. As in, the recipe may have more than just it as a result, but that one will Always have one be made.
    Result Item x adds one of the item x to the results, Result Item x: y adds y times item x to the results. Basically Result Item 3 is the same as Result Item 3: 1.
    No, x is a substitute for the value needed. I can't just say in there "Result Item 13" because you won't always use item 13, so I put x and you exchange it for the item you want. Same with Result Armor x: y, x for the armor id and y for the quantity.
    Do you mean their name? Without.

    Well, this is my test item, it has two recipes, one using three items and another using two:

    Code:
    <Recipe>
    Discipline: 2
    Category: Food
    Result Item 39
    Ingredient Item 48: 3
    Ingredient Item 7: 2
    Ingredient Item 22
    </Recipe>
    
    <Recipe>
    Discipline: 2
    Category: Food
    Ingredient Item 8
    Ingredient Item 22
    </Recipe>
    
    <Not Independent Item>
     
  14. Hahasea

    Hahasea Veteran Veteran

    Messages:
    115
    Likes Received:
    13
    First Language:
    English
    Primarily Uses:
    RMMV
    @Waterguy, thank you, that's helpful, I've got a basic recipe working :D

    I do have a couple more questions though, if you'll bear with me:

    1) How do you use this part of the recipe note: 'Result Eval: code ||| text' ? Can you use that to have a "You made x!" message?

    2) I'm trying to understand how the description is used. I assume it's fills out this box with a description of what the recipe book is for?
    upload_2019-8-7_14-27-13.png
    Where are the contents of that set?

    3) Having issues with the alignment of the discipline level when using several words (as visible in the screenshot above), is there a way to move the number value over?

    4) Is it possible to have a title for the ingredients required?
    upload_2019-8-7_14-34-33.png

    Thanks, looking forward to playing with this more :)
     

    Attached Files:

  15. Waterguy

    Waterguy Veteran Veteran

    Messages:
    1,183
    Likes Received:
    254
    Location:
    Brazil
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    @Hahasea
    1- It is to run a line of code in javascript after the recipe is done. Code is to run some javascript code, text is what will be shown in the "results" part of the recipe. I'd not recommend it for too much code like the one needed for making a window like that.
    The idea was for things like "making a recipe turns a switch on when it is made", showing the message "Switch 13 on" on the results list, making the notetag be "Result Eval: $gameSwitches.setValue(13) = true; ||| Switch 13 on".
    I personally do not recommend even touching it much if you don't know much javascript. Tht can easily break your game if used wrong.

    2- It isn't used, it can just be there. It is just the item description in the database.

    3- That is because the Discipline name is left-aligned and the numbers are centered. I'll make them right-aligned when I fix the things Khulse pointed out to avoid this kind of thing happening.

    4- I did not add the option. I did not think it was needed for one simple reason... Everything needs an ingredient. Not everything has a non-consumable requirement. Results need to be separate anyway. Besides,
    But I recall others asking for this before. I may add the option when I finish the fixes for Khulse.
     
  16. Hahasea

    Hahasea Veteran Veteran

    Messages:
    115
    Likes Received:
    13
    First Language:
    English
    Primarily Uses:
    RMMV
    @Waterguy thanks

    1) So do you mean that the text that gets shown is text that is visible in the menu for the player, or is it more of a backend trigger? Would really like to be able to have some kind of successful crafting message generated, as I think without it the player might be a bit confused, at least initially. If your small demo has any of this stuff in it, I'd love to see it, even if it's not perfect. I'm not great with javascript but I'm trying to learn!

    2) Is is possible to apply descriptions to different Categories, so they would show up in this description field?

    3) Thanks :)

    4) Sure, that makes sense, but it seems that the option of a title would make it easier for players to visually understand the interface. It took me a few seconds to figure out what was what, and I like to keep in mind player experience, especially those that might not be super familiar with the RPG format. Think it would make sense to have an ingredients title option, especially when including non-consumable items in recipes. Maybe toggled on and off?

    Cheers!
     

    Attached Files:

  17. Waterguy

    Waterguy Veteran Veteran

    Messages:
    1,183
    Likes Received:
    254
    Location:
    Brazil
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    1- The text is just a message in the Rewards section. Like in your screen there is the "Some Weapon", there will also be the text you put there. There is no success message, because there is no failure system implemented. If you want a chance of failure, it'd need to be added, and to be honest I have no desire to go out of the way to do so in this one.
    I am making a different system that has a failure chance, though... but it is much more complex and will be a paid plugin.
    And your error message is because you left the code part as just code. That is not a javascript code. It'll look for a variable named code to run, which does not exist.

    2- Possible, yes. But as mentioned I am focused on doing a more complex crafting plugin. I am willing to do fixes and small changes but have no desire to go out of my way to add many new things to this one right now.
     
  18. Hahasea

    Hahasea Veteran Veteran

    Messages:
    115
    Likes Received:
    13
    First Language:
    English
    Primarily Uses:
    RMMV
    @Waterguy ok cool no sweat.

    Was a just a bit confused about what kind of javascript code to use if I just want the bit in the Rewards section to be plain text, not related to any switches or whatever.

    Thanks for all your help, I appreciate it.
    Looking forward to checking out the new plugin!
     
  19. Waterguy

    Waterguy Veteran Veteran

    Messages:
    1,183
    Likes Received:
    254
    Location:
    Brazil
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    @Khulse

    1- that is because, if the formula is the same for every level, as soon as you finish level 1 you finish level max... and beyond... and I did not put a check for stopping at that, sorry.
    that is, for a flat experience of for example 100 each level, use level * 100, not just 100.

    2- yeah... as you can imagine, the code for results in that part is very similar to the code for requirements, so it was copypasted. Sorry, I forgot to rename those two places...

    3- Still working on it... are you sure about the limit being 8? seems like such a random number...

    4- easier solution: script call your choice of this in the common event/damage box:
    Code:
    //for one recipe:
    $gameParty._itemRecipesLearned[itemId][recipeIndex] = true;
    
    $gameParty._weaponRecipesLearned[weaponId][recipeIndex] = true;
    
    $gameParty._armorRecipesLearned[armorId][recipeIndex] = true;
    
    
    //for all recipes of an item
    $dataItems[itemId]._recipes.forEach(function(recipe, recipeIndex){$gameParty._itemRecipesLearned[itemId][recipeIndex] = true;}, this);
    
    $dataWeapons[weaponId]._recipes.forEach(function(recipe, recipeIndex){$gameParty._weaponRecipesLearned[weaponId][recipeIndex] = true;}, this);
    
    $dataArmors[armorId]._recipes.forEach(function(recipe, recipeIndex){$gameParty._armorRecipesLearned[armorId][recipeIndex] = true;}, this);
    OR, if you are using a common event anyway, make the damage formula change some variable and use a plugin command eval plugin to use it in the formula (Yanfly has one, SRD too).

    To check if a recipe is learned, use:
    Code:
    $dataItems[itemId]._recipes[recipeId].isLearned()
    I didn't add these to the script calls because I thought they were a bit too advanced... but maybe I should since I'm editting it anyway...
     
    Last edited: Aug 7, 2019
  20. Waterguy

    Waterguy Veteran Veteran

    Messages:
    1,183
    Likes Received:
    254
    Location:
    Brazil
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    I think I am allowed to doublepost if it is justified?

    @Khulse I think I finished your fixes. Added functions for checking if recipe is learned and to learn recipe, they are in the Script Call section of the help.
    https://www.dropbox.com/s/5kzfxergt63aono/YR_ItemCrafting.js?dl=0

    @Hahasea I added the option to add an Ingredients title. You can leave it empty for no title without the empty space there.

    That means everyone who updates the plugin will need to open it in the plugin manager and save it, even if they use the default settings, though, to add the new parameter to the plugin files.

    However, adding a category description was too much work for too little gain, in my opinion.
     
    Last edited: Aug 8, 2019

Share This Page