Jump to content

andreslozano67

Just Joined
  • Posts

    1
  • Joined

  • Last visited

About andreslozano67

  • Birthday May 7

Contact Methods

  • Website URL
    https://www.vidaplayer.com/es

andreslozano67's Achievements

  1. Hi there! I took a look at your logic. Since you are using variables to track durability, the issue with displaying it usually comes down to how the engine refreshes text or how the variable is being called. Here are a few solutions to help you test and display the values: 1. The Quickest Way to Test (Console Log) If you just want to know if your math is working (i.e., is the weapon actually degrading?), the best way is to use the Console instead of the chat window. In your code/script section where you decrease the variable, add this line immediately after: JavaScript console.log("Current Durability: " + $gameVariables.value(YOUR_VARIABLE_ID)); (Replace YOUR_VARIABLE_ID with the ID number of your durability variable). Then, while playtesting, press F8 (or F12) to open the console. Every time you hit, you will see the number update in real-time. 2. Displaying in the Chat/Battle Log If you want the player to see it in the chat window upon impact, you need to push a message to the game's message handler inside your damage formula or script call: JavaScript // Example for RPG Maker script call $gameMessage.add("Durability remaining: " + $gameVariables.value(YOUR_VARIABLE_ID)); Note: Depending on your battle system (CTB/ATB), pop-ups might be better, but this will force text to the window. 3. Displaying in Item Description To show the variable in the item description, you usually use the standard text code: \V[x] (where x is the variable ID). Example: Durability: \V[15]/100 Important Note on Variables vs. Independent Items: If you are using a single Variable (e.g., Variable 15) to track durability, keep in mind that every weapon of that type will share that health. If you equip a second sword, it will have the same damage as the first one. If the description isn't updating: Item descriptions are often cached. You might need to exit and re-enter the menu to see the \V[x] number change, or use a plugin like YEP_MessageCore to ensure text codes work in descriptions. 4. Regarding the "0 Durability" Logic You mentioned you want to remove the item use without unequipping to avoid crashes. A safer alternative to "removing use" is to apply a "Broken" State. Create a State called "Broken Weapon" (Seal Attack, or set Parameters to 0). In your conditional branch: If Variable <= 0: Add State "Broken Weapon" to the user. Play a "Break" sound effect. (Optional) Change the weapon's icon or name if you are using an Independent Items plugin. Hope this helps you debug it!
×
×
  • Create New...