Hello there, hope you're doing well!
I need help with my game, there's a short description first and a long one further down.
I really hope some of you fine folk can help me out.
I am implementing the Item Crafting System VisuStella MZ into my game, and I have a problem. This plugin is open for Javascript code, and I need to know how to do the following in Javascript code:
Call a common Event (which will set a value to either 1 or 0)
Check if the variable is 1 (or not)
Set the crafted item number to zero if it isn't.
Longer explanation following:
My game features a skill system where every skill is expressed as a number between 1 and 100. When using a skill, the game takes the current skill value and add a random number between 1 to 100, if this result exceeds the Challenge Rating (usually 100) the skill succeeds, and the common event spits out a 1. If it fails, it spits out a 0.
In the case of a 1, the player gets some XP, in the case of a 0, the player gets more XP.
This all works perfectly.
What I want is for when player uses the plugin to create an item (food mostly), the plugin runs the common event for Cooking, then checks if the player succeeded or not. If they did (variable is 1), the plugin just runs like normal but if they fail the plugin sets the amount of created items to zero, resulting in the player losing their ingredients but gaining nothing but xp (and bitter tears).
To be clear, I need a javascript code that:
1: Runs a common event.
2: Checks if a variable is 1 or 0.
3: Sets the plugin variable for items to 0. (This one I might be able to fix myself, as it is included in the plugin description, and requires familiarity with this specific plugin).
Appreciate any help on my project!
Thanks in advance!
- Lars.
Edited: Replaced Java with Javascript after being told that these are in fact two separate languages.
I need help with my game, there's a short description first and a long one further down.
I really hope some of you fine folk can help me out.
I am implementing the Item Crafting System VisuStella MZ into my game, and I have a problem. This plugin is open for Javascript code, and I need to know how to do the following in Javascript code:
Call a common Event (which will set a value to either 1 or 0)
Check if the variable is 1 (or not)
Set the crafted item number to zero if it isn't.
Longer explanation following:
My game features a skill system where every skill is expressed as a number between 1 and 100. When using a skill, the game takes the current skill value and add a random number between 1 to 100, if this result exceeds the Challenge Rating (usually 100) the skill succeeds, and the common event spits out a 1. If it fails, it spits out a 0.
In the case of a 1, the player gets some XP, in the case of a 0, the player gets more XP.
This all works perfectly.
What I want is for when player uses the plugin to create an item (food mostly), the plugin runs the common event for Cooking, then checks if the player succeeded or not. If they did (variable is 1), the plugin just runs like normal but if they fail the plugin sets the amount of created items to zero, resulting in the player losing their ingredients but gaining nothing but xp (and bitter tears).
To be clear, I need a javascript code that:
1: Runs a common event.
2: Checks if a variable is 1 or 0.
3: Sets the plugin variable for items to 0. (This one I might be able to fix myself, as it is included in the plugin description, and requires familiarity with this specific plugin).
Appreciate any help on my project!
Thanks in advance!
- Lars.
Edited: Replaced Java with Javascript after being told that these are in fact two separate languages.