- Joined
- Mar 22, 2020
- Messages
- 7
- Reaction score
- 2
- First Language
- English
- Primarily Uses
- RMMV
Hello! I just made this account and though I've read lots of threads here before, have never posted. I am also very new to Javascript although I've picked some things up. So I apologize if this is in the wrong forum, or my terminology is off, or anything like that.
I'm creating an alchemy system where the player can choose three ingredients that they have, then those chosen ingredients are compared against all established "recipes" (specific sets of ingredient IDs) to see if any match. If so, they create a specific potion. If not, they create "Unidentifiable Sludge" and lose the ingredients. The variables used to store the chosen ingredient IDs are reset to 0 after each use, for a clean slate for next time.
Anyway, my issue is this:
I have four test recipes right now and only three of them work. They are all set up exactly the same, with the only thing differing being the IDs of the target ingredients. I noticed that the only thing that sets the non-working one apart from the others is that, while the target ingredient IDs for the first three are all single-digit values and thus formatted like "000x", two of the target ingredients in the non-working one have two-digit ID values and thus are formatted like "00xy".
I cannot even begin to fathom why this would make a difference. I changed these two-digit IDs to single-digit ones to rule out anything else, and voila! It suddenly worked! Changed them back to the original two-digit IDs, and it's not working anymore. I have double, triple, quadruple checked that I am using the correct item IDs. At the end of the day, something about those lines of script isn't compatible with "00xy" values or something, and I don't know why and don't know how to fix it...
I've included annotated screenshots to help with following along!
Anyone with more JS knowledge who knows what's going on or how I can fix/get around it? Thank you so much in advance!!
<3
I'm creating an alchemy system where the player can choose three ingredients that they have, then those chosen ingredients are compared against all established "recipes" (specific sets of ingredient IDs) to see if any match. If so, they create a specific potion. If not, they create "Unidentifiable Sludge" and lose the ingredients. The variables used to store the chosen ingredient IDs are reset to 0 after each use, for a clean slate for next time.
Anyway, my issue is this:
I have four test recipes right now and only three of them work. They are all set up exactly the same, with the only thing differing being the IDs of the target ingredients. I noticed that the only thing that sets the non-working one apart from the others is that, while the target ingredient IDs for the first three are all single-digit values and thus formatted like "000x", two of the target ingredients in the non-working one have two-digit ID values and thus are formatted like "00xy".
I cannot even begin to fathom why this would make a difference. I changed these two-digit IDs to single-digit ones to rule out anything else, and voila! It suddenly worked! Changed them back to the original two-digit IDs, and it's not working anymore. I have double, triple, quadruple checked that I am using the correct item IDs. At the end of the day, something about those lines of script isn't compatible with "00xy" values or something, and I don't know why and don't know how to fix it...
I've included annotated screenshots to help with following along!
Anyone with more JS knowledge who knows what's going on or how I can fix/get around it? Thank you so much in advance!!
<3
Attachments
-
175.7 KB Views: 7
-
160.6 KB Views: 7
-
171.7 KB Views: 6
-
155.5 KB Views: 6
-
169.8 KB Views: 6


