Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Hey there.

I don't think it's viable to have more than 4 ingredient slots in this plugin, there are a lot of points in the code where I hard-coded that number to get certain things to work. I can think of a few that might be tripping you up in editing it, but I'm not sure even if you get past those that it'd work.

  • The ingredient list window is hard-coded to check for the cursor index of 4 to know when you've hit ok on the craft button, and not on an ingredient slot, so the onIngredientOk() function needs to be modified to check for an index of 6 or 8 (for 6 or 8 slots instead).
  • The ingredient window is only supposed to show four items, and probably needs to be longer to facilitate extra items in the list. That might not be a problem if your project has a higher than default resolution, though.
  • The function that checks for a partial recipe match only checks up to n-2 ingredients, meaning it will only ever check provided ingredients against recipes that are at most, two ingredients less than the total number of ingredients provided. You'd have to extend this function to n-4 (for 6 ingredients) and n-6 (for 8).
  • The plugin manager only expects 4 ingredient slots, so you'd need to manually add more slots to the recipe list object, and parse those slots in the datamanager on load, like the other four slots. The plugin reads each ingredient item on project load and turns them into the actual database item, and then attaches that item to the recipe array for future use. Simply adding new slots to the plugin parameters will allow you to specify extra items in a recipe, but unless they're parsed in the same way this will be a problem.
    • I had hardcoded the names of the first four ingredients, (secondType, secondId, etc) so you will need to work with that as well.

With this in mind, I think it's much more realistic to not edit the plugin at all, and rather make your base items craft into intermediate items, that then craft into the full item. This would allow you to stay within the four item limit, while still allowing more than four base ingredients. 

For example, a sword recipe:

  • <category> Sword blade
  • Hilt
  • Scabbard

To make each of these items requires more ingredients:

  • Sword Blade
    • <category> Metal
    • Flux
    • Sword mold
  • Hilt
    • Wood
    • Leather
  • Scabbard
    • Leather
    • Cloth

Obviously this isn't an ideal solution, but I feel like it's a little more doable than editing the core functions of the plugin, and you're a lot less likely to run into problems working within the four item limit. Keep in mind though, that there is a hard limit currently, in that you can only have one category ingredient per recipe, so you'd need to make each recipe if you had a few different types of hilts, scabbards and sword blades that could be interchanged in the recipe.

(7 edits)

Hmm I don't think you understood me or I did not explain myself well enough. My game has items used for crafting and these items have bonuses attached to them that may effect the final synthesized item. For example, Iron Ore +20 Attack and Iron Ore +20 Defence. If you used both of these together you would get the bonus associated with the weapon or armor type you craft which I would then create a new recipe every time in your plugin for. And certainly I would think its not impossible to add more slots even with the hard coded stuff I am trying to follow everything very closely but still cannot get it to work. (Course Im no coder, merely a beginner.) Would you be so kind as to maybe even take a look at your code that I have edited and maybe try and push me in the right direction of getting this to work? Whenever you have time of course. Absolutely no rush cause I know people can be busy. I am just trying to learn and I actually am learning small things here and there from your code. Which I am also grateful for. If maybe you can give me an email I can send to you? If not I also completely understand, thank you for making this plugin and hopefully I'll get this to work one day! Cheers.

Edit* Yeah, I can admit I don't completely understand everything. Particularly adding in the n-3 and n-4 in the findPartialRecipe function. I have placed a tag //Dungeonmind Edit* on every line I have added or touched. That might also make it easier to get to each location in the script that needs editing for this to work.

Btw rpg maker mv handles that command window the same everywhere and when you add to the list it just creates a scrolling command window which I dont mind at all and I'm sure others wouldn't either.

I got the index thing to work perfectly but now the crafting option just disappears from the menu and you can no longer access the scene, SO I assume I broke something I did not add something where I should have

Yeah, if the crafting option is gone, the plugin probably found an error on load and didn't load the rest of the way. Trust me, I've seen enough of that problem while I was making it.

I don't think I should share my email address on a public spot like this, but you can direct message me on discord Ramza#3215 and send me your edit that way.

The n-3 and 4 thing is confusing, I'll admit. It's only used to find partial matches, so for just getting it to work with a 6 item recipe, we don't need it right away for testing purposes. If you look at the difference between my n-1 and n-2 sections, which are commented, you can see what you need to change to get it to check for n-3. 

The most important change is going to be to edit the recipe list struct to accept more than 4 ingredients. This is going to involve adding in new parameters, giving them a new name, and parsing them the same way that the first four ingredients are parsed in a recipe. The actual parsing is handled right after the help file section ends, so you can have a look there and see what I do to convert the plugin parameter into an actual object.

(1 edit)

Okay thank you so much for your help! I will message you there I think I fixed the parsing but don't quote me on that. I also appreciate your script comments, they are helpful for learners like me! I'll send it to you on discord personal message if it allows me to. Thanks so much !!!


Edit* I have added you as a friend on discord I don't think it allows me to message you until you accept.