KG1988

Warper
Member
Joined
Jul 1, 2021
Messages
2
Reaction score
0
First Language
English
Primarily Uses
RMMZ
Hello all,

My goal is to create a clothing durability system for an adult rated game. I was thinking a percentage of damage taken could count as durability damage points. At certain breakpoints (ex:75/100 durability) the clothing would change from a normal state to a slightly torn state. Based on durability states the battle HUD character image would update. This is a common system in many adult rated RPG Maker games, but I haven’t been able to find any plugins that do this.

Can anyone point me in the direction of a plug-in that could accomplish this? Or can someone with a programming background give me some direction on how to create and implement a system like this in MZ?

Thanks,

KG
 

rexie09

Villager
Member
Joined
Apr 4, 2021
Messages
26
Reaction score
10
First Language
English
Primarily Uses
RMMZ
Most H-Games like that get their scripts custom made for it and is really no universal script for clothing durability that all H-game devs use. You're best bet is to make the plugin you're self if you can or have someone make it for you. For a idea (probably not the best one) is to change the
Game_Actor.prototype.onDamage(value) (inheratied from Game_Battler)to call another function that checks if the player attacked is one you want to have clothing change and if so changes the durability of the clothing and if the durability gets bellow a certain point change the image of the actor.

-If you need more help with making the script just post it here ill be happy to help out
 
Last edited:

KG1988

Warper
Member
Joined
Jul 1, 2021
Messages
2
Reaction score
0
First Language
English
Primarily Uses
RMMZ
Most H-Games like that get their scripts custom made for it and is really no universal script for clothing durability that all H-game devs use. You're best bet is to make the plugin you're self if you can or have someone make it for you. For a idea (probably not the best one) is to change the
Game_Actor.prototype.onDamage(value) (inheratied from Game_Battler)to call another function that checks if the player attacked is one you want to have clothing change and if so changes the durability of the clothing and if the durability gets bellow a certain point change the image of the actor.

Thanks for taking the time to reply Rexie! It explains why I haven’t found any universal plugins yet.

The idea you mentioned sounds like a good way to pull a durability value from the .ondamage function. That’s a starting point that I didn’t have before as I’m still a beginner with coding.

I plan to start with just one outfit at first, but add more options later if I can get the clothing damage/durability system working. Do you think a simple else-if conditional would be a viable approach for the change actor image component with multiple outfits?

Thanks again,

KG
 

rexie09

Villager
Member
Joined
Apr 4, 2021
Messages
26
Reaction score
10
First Language
English
Primarily Uses
RMMZ
Thanks for taking the time to reply Rexie! It explains why I haven’t found any universal plugins yet.

The idea you mentioned sounds like a good way to pull a durability value from the .ondamage function. That’s a starting point that I didn’t have before as I’m still a beginner with coding.

I plan to start with just one outfit at first, but add more options later if I can get the clothing damage/durability system working. Do you think a simple else-if conditional would be a viable approach for the change actor image component with multiple outfits?

Thanks again,

KG
if you are talking about the part where the durability has already been calculated then yes. A small trick that you could do is make a variable with the name of the armor and then make the name of the images ~armorSame~armorState for example
JavaScript:
let armorName = "";

function checkArmor(durabilty) {
    if(durability == 100) {
        FunctionThatShowsPicture(armorName + "1");
    }else if(durability == 75) {
        FunctionThatShowsPicture(armorName + "2");
    }//and so on
}

This way you dont need to make a if or switch statement for each and every armor. If you want each armor to have a different amount of states than each other then you just need to make sure you add enough checks. Say if one armor has only 2 states but another has 4 you just need to make sure you have a if statement with 4 and add a few variables to compensate for the change in states for example.
please note there is probably better way to do the if statement but i cant think of it right now
JavaScript:
let armorName = "";

let armorStateAmmounts = 2;



function checkArmor(durabilty, armorStateAmmounts) {
    //equals 50
    let sum = 100/armorStateAmmounts;

 
    // if durability == 50
    if(durability == (100/sum*1)) {


        FunctionThatShowsPicture(armorName + "1");

    // // if durability == 0
    }else if(durability == (100/sum*2)) {


        FunctionThatShowsPicture(armorName + "2");


    }//and so on

if armorStateAmmounts was 4 then you would need 2 extra branches to the else if.
I hope this made sense

- also here is this if you ever need to quickly find a function in rpg maker mz https://lunatechs.dev/LunaLite/index.html
 
Last edited:

KG2020

Villager
Member
Joined
May 11, 2021
Messages
5
Reaction score
0
First Language
English
Primarily Uses
RMMZ
if you are talking about the part where the durability has already been calculated then yes. A small trick that you could do is make a variable with the name of the armor and then make the name of the images ~armorSame~armorState for example
JavaScript:
let armorName = "";

function checkArmor(durabilty) {
    if(durability == 100) {
        FunctionThatShowsPicture(armorName + "1");
    }else if(durability == 75) {
        FunctionThatShowsPicture(armorName + "2");
    }//and so on
}

This way you dont need to make a if or switch statement for each and every armor. If you want each armor to have a different amount of states than each other then you just need to make sure you add enough checks. Say if one armor has only 2 states but another has 4 you just need to make sure you have a if statement with 4 and add a few variables to compensate for the change in states for example.
please note there is probably better way to do the if statement but i cant think of it right now
JavaScript:
let armorName = "";

let armorStateAmmounts = 2;



function checkArmor(durabilty, armorStateAmmounts) {
    //equals 50
    let sum = 100/armorStateAmmounts;

 
    // if durability == 50
    if(durability == (100/sum*1)) {


        FunctionThatShowsPicture(armorName + "1");

    // // if durability == 0
    }else if(durability == (100/sum*2)) {


        FunctionThatShowsPicture(armorName + "2");


    }//and so on

if armorStateAmmounts was 4 then you would need 2 extra branches to the else if.
I hope this made sense

- also here is this if you ever need to quickly find a function in rpg maker mz https://lunatechs.dev/LunaLite/index.html

Thank you for the detailed description and for the link to the MZ functions resource.

This is something that I had been trying to figure out how to implement for a little over a month now. I worked through a few Programming Fundamentals and JS ES6 courses on LinkedIn Learning, but this is my first attempt to create a script that will work with the RPG Maker engine. All of the logic and code in your reply makes sense. You have probably saved me at least a few weeks of time trying to figure it out with your explanation, so I really appreciate it.

I'm not sure how this forum handles commissions or tips, but I would be happy to send you a tip for all of the guidance you provided in your reply.

Thanks again,

KG
 

rexie09

Villager
Member
Joined
Apr 4, 2021
Messages
26
Reaction score
10
First Language
English
Primarily Uses
RMMZ
Thank you for the detailed description and for the link to the MZ functions resource.

This is something that I had been trying to figure out how to implement for a little over a month now. I worked through a few Programming Fundamentals and JS ES6 courses on LinkedIn Learning, but this is my first attempt to create a script that will work with the RPG Maker engine. All of the logic and code in your reply makes sense. You have probably saved me at least a few weeks of time trying to figure it out with your explanation, so I really appreciate it.

I'm not sure how this forum handles commissions or tips, but I would be happy to send you a tip for all of the guidance you provided in your reply.

Thanks again,
No need for a tip or anything like that and im happy i was able to help. If you need help with this script or any other script again just let me know ill be happy to help.
 

tseyik

Villager
Member
Joined
Oct 22, 2015
Messages
29
Reaction score
29
First Language
English
Primarily Uses
CharacterPictureManager.js
[GitHub] :https://raw.githubusercontent.com/triacontane/RPGMakerMV/mz_master/CharacterPictureManager.js
MIT
* You can manage and display standing pictures consisting of multiple images.
* Register the image, display conditions, and the scene you want to display from the plug-in parameters. * It has the following features.
* ・ Changes in the standing picture according to conditions such as HP remaining amount, state, equipment, occupation, switch, etc.
* ・ During battle, switching images according to the battle situation such as action and damage
* ・ Creating costume differences and facial expression differences using multiple images
* ・ The same standing picture can be reused on the battle screen, menu screen, and map screen. *
* Also, when combined with the separately released APNG picture plug-in * You can animate the standing picture. However, be careful not to overuse it. *
* ● How to specify in the memo field condition
* If "aaa" is specified in the memo field of the display condition, it will be in the database (*) of the target actor.
* A standing picture is displayed when the following memo fields are included.
* <StandPicture: aaa> * * Applicable to actors, occupations, weapons, armor, and states * * ● Image coordinate specification support function * Only during test play, you can check and adjust the coordinates by dragging the standing picture. * The current reference coordinates and unique coordinates are displayed on the screen. * If you press the Ctrl key, the image in the back is selected, and if you do not press it, the image in the foreground is selected.
* Adjusts the reference coordinates when the Shift key is pressed, and the unique coordinates when not pressed.
* Ctrl + Enter will return all the adjusted images to their original positions. *
* ● Dynamic setting of standing picture file (for advanced users)
* If you want to use a lot of standing pictures, you can dynamically decide the file name according to the naming convention.
* An error will occur if the file does not exist, and the automatic deletion function for unused files will cause an error.
* For advanced users as files may be deleted.
* File names are converted according to the following rules. *
* {hp: 40,60,80} * HP rates are converted to indexes according to the specified threshold.
* In the above example, it will be converted to the following numbers.
* When 0% -39%: 0 * When 40% -59%: 1 * When 60% -80%: 2 * When 80% -100%: 3
 

KG2020

Villager
Member
Joined
May 11, 2021
Messages
5
Reaction score
0
First Language
English
Primarily Uses
RMMZ
CharacterPictureManager.js
[GitHub] :https://raw.githubusercontent.com/triacontane/RPGMakerMV/mz_master/CharacterPictureManager.js
MIT
* You can manage and display standing pictures consisting of multiple images.
* Register the image, display conditions, and the scene you want to display from the plug-in parameters. * It has the following features.
* ・ Changes in the standing picture according to conditions such as HP remaining amount, state, equipment, occupation, switch, etc.
* ・ During battle, switching images according to the battle situation such as action and damage
* ・ Creating costume differences and facial expression differences using multiple images
* ・ The same standing picture can be reused on the battle screen, menu screen, and map screen. *
* Also, when combined with the separately released APNG picture plug-in * You can animate the standing picture. However, be careful not to overuse it. *
* ● How to specify in the memo field condition
* If "aaa" is specified in the memo field of the display condition, it will be in the database (*) of the target actor.
* A standing picture is displayed when the following memo fields are included.
* <StandPicture: aaa> * * Applicable to actors, occupations, weapons, armor, and states * * ● Image coordinate specification support function * Only during test play, you can check and adjust the coordinates by dragging the standing picture. * The current reference coordinates and unique coordinates are displayed on the screen. * If you press the Ctrl key, the image in the back is selected, and if you do not press it, the image in the foreground is selected.
* Adjusts the reference coordinates when the Shift key is pressed, and the unique coordinates when not pressed.
* Ctrl + Enter will return all the adjusted images to their original positions. *
* ● Dynamic setting of standing picture file (for advanced users)
* If you want to use a lot of standing pictures, you can dynamically decide the file name according to the naming convention.
* An error will occur if the file does not exist, and the automatic deletion function for unused files will cause an error.
* For advanced users as files may be deleted.
* File names are converted according to the following rules. *
* {hp: 40,60,80} * HP rates are converted to indexes according to the specified threshold.
* In the above example, it will be converted to the following numbers.
* When 0% -39%: 0 * When 40% -59%: 1 * When 60% -80%: 2 * When 80% -100%: 3

Hi Tseyik,

This is a cool plugin, thank you for sharing it with me. I was able to get the character images to change with the HP damage threshold, and it works well.

Do you know of a setting in the plugin to make it so healing HP doesn't also heal the clothing damage? (I'm hoping to have an item or a shop that can repair clothing durability separate from potions/healing magic.)

Thanks again,

KG
 

B22

Villager
Member
Joined
Aug 2, 2021
Messages
6
Reaction score
1
First Language
German
Primarily Uses
N/A
Hi Tseyik,

This is a cool plugin, thank you for sharing it with me. I was able to get the character images to change with the HP damage threshold, and it works well.

Do you know of a setting in the plugin to make it so healing HP doesn't also heal the clothing damage? (I'm hoping to have an item or a shop that can repair clothing durability separate from potions/healing magic.)

Thanks again,

KG
Hi KG2020. I have the same problem you had. What do you needed to do that the RPG Maker saw the plugin or did you had a different method ? If someone could explain it to me, it would be great :)
 

KG2020

Villager
Member
Joined
May 11, 2021
Messages
5
Reaction score
0
First Language
English
Primarily Uses
RMMZ
Hi KG2020. I have the same problem you had. What do you needed to do that the RPG Maker saw the plugin or did you had a different method ? If someone could explain it to me, it would be great :)
Hi B22,

I found a way to make the plugin work separate from HP damage, but I can't guarantee that there are no bugs. I'm still in the process of getting everything set up, but if I find any bugs I will post an update here. Here is how I made it work:

I created a Clothing_01 durability variable that was set at 0. I then use a durability damage common event to add damage to the durability variable. The common event is added to an enemy attack skill and is called whenever the skill is used. At certain durability breakpoints (ex: 50 Durability Damage) a conditional common event (ex: If Clothing_01 Durability >= 50, Clothing_01 Ripped SWITCH = ON). You can also use a common event to change the walking sprite appearance when certain common events are called.

Triacontane's plugin has a feature to update the picture displayed based on what switches have been turned on. To fix clothing damage I created a "Sewing Kit" item that runs a common event to turn off the switches (Clothing01 Ripped = OFF) and set Damage Durability back down to 0. The downside to this is that you need to create clothing unique damage variables and clothing unique switches for each armor.

I hope that helps. Please let me know if you find a better way to implement this.

Thanks,

KG
 

B22

Villager
Member
Joined
Aug 2, 2021
Messages
6
Reaction score
1
First Language
German
Primarily Uses
N/A
Hi B22,

I found a way to make the plugin work separate from HP damage, but I can't guarantee that there are no bugs. I'm still in the process of getting everything set up, but if I find any bugs I will post an update here. Here is how I made it work:

I created a Clothing_01 durability variable that was set at 0. I then use a durability damage common event to add damage to the durability variable. The common event is added to an enemy attack skill and is called whenever the skill is used. At certain durability breakpoints (ex: 50 Durability Damage) a conditional common event (ex: If Clothing_01 Durability >= 50, Clothing_01 Ripped SWITCH = ON). You can also use a common event to change the walking sprite appearance when certain common events are called.

Triacontane's plugin has a feature to update the picture displayed based on what switches have been turned on. To fix clothing damage I created a "Sewing Kit" item that runs a common event to turn off the switches (Clothing01 Ripped = OFF) and set Damage Durability back down to 0. The downside to this is that you need to create clothing unique damage variables and clothing unique switches for each armor.

I hope that helps. Please let me know if you find a better way to implement this.

Thanks,

KG
Hi!

Thanx for the big replay :) So you got it working on RPG Maker MZ ? Wich plugin exactly did you juse ? Can you send me the link ? Im not very good in making my own events (in plugins), if you can tell me how exactly you did it would be very nice. I have an Artist making me my Sprites (4x Battle Sprites for each chr/ clothing demage). Im good at world building and comming up with Quest´s, but i have absolutly no plan how to work with plugins :D
If you can help me out here XD

B22
 

KG2020

Villager
Member
Joined
May 11, 2021
Messages
5
Reaction score
0
First Language
English
Primarily Uses
RMMZ
Hi!

Thanx for the big replay :) So you got it working on RPG Maker MZ ? Wich plugin exactly did you juse ? Can you send me the link ? Im not very good in making my own events (in plugins), if you can tell me how exactly you did it would be very nice. I have an Artist making me my Sprites (4x Battle Sprites for each chr/ clothing demage). Im good at world building and comming up with Quest´s, but i have absolutly no plan how to work with plugins :D
If you can help me out here XD

B22
Yes, I was able to achieve what I wanted using MZ.

Triacontane made the character display plugin that I'm using, I've linked it below:
He is active on Twitter and responds to questions.

The game I'm making doesn't use the side view sprites during the battles. There is only one main character, so I went with the front view battle system. There is a standing character picture that shows up above the HP/MP that updates based on what armor is equipped and how much durability damage the armor has sustained. Certain attacks call cut-in animations that replace the standing image temporarily. When the battle ends, there is a parallel event that checks if the equipped armor is damaged to a certain point (ex: if Clothing01 Ripped Switch = ON) and then swaps the walking sprite to a walking sprite with the clothing damage. I'll send you some screenshots of how I got the eventing set up in a private message.

My screenshots should help you to get started, but to elaborate - certain enemy attack skills call common durability damage events. When a breaking point in durability is reached, a switch is turned on. The standing character picture plugin runs parallel to check to see what switches are turned on and then updates the standing picture based on what switches are active. You have the option to have the plugin automatically manage everything internally with HP, but the downside is healing HP also fixes damaged clothing. That is the main reason I decided to use switches and conditionals.

Thanks,

KG
 

B22

Villager
Member
Joined
Aug 2, 2021
Messages
6
Reaction score
1
First Language
German
Primarily Uses
N/A
Yes, I was able to achieve what I wanted using MZ.

Triacontane made the character display plugin that I'm using, I've linked it below:
He is active on Twitter and responds to questions.

The game I'm making doesn't use the side view sprites during the battles. There is only one main character, so I went with the front view battle system. There is a standing character picture that shows up above the HP/MP that updates based on what armor is equipped and how much durability damage the armor has sustained. Certain attacks call cut-in animations that replace the standing image temporarily. When the battle ends, there is a parallel event that checks if the equipped armor is damaged to a certain point (ex: if Clothing01 Ripped Switch = ON) and then swaps the walking sprite to a walking sprite with the clothing damage. I'll send you some screenshots of how I got the eventing set up in a private message.

My screenshots should help you to get started, but to elaborate - certain enemy attack skills call common durability damage events. When a breaking point in durability is reached, a switch is turned on. The standing character picture plugin runs parallel to check to see what switches are turned on and then updates the standing picture based on what switches are active. You have the option to have the plugin automatically manage everything internally with HP, but the downside is healing HP also fixes damaged clothing. That is the main reason I decided to use switches and conditionals.

Thanks,

KG
Yeah me again :D I followed the link you sent me, but I was unable to find out how to download the plugin arg. My combat system is a bit simpler. It should only change the sprite in the case of suffered damage (no grab etc). For example; normal sprite 100-75%, light deamge sprite 74-50% and so on. I'm sorry that I have to be taken by the hand on the subject.

Bastie22
 

Latest Threads

Latest Profile Posts

Redesigning characters after such a long time feels great. Makes me excited to work on an old game again.
Phone menu to replace main menu WIP:
It's been that long since I wrote a plugin, it took me 4 attempts to realize it's != rather than #. In a 40-line plugin, 20 of those lines being documentation!
Disk Check Plugin - Running on Linux:
RMMV-Game-Mint.png
workin on some graphics for my game. was originally planning on doing a cartoony style for the town but I might stick with this instead

Forum statistics

Threads
116,085
Messages
1,095,614
Members
151,459
Latest member
ingridabiyos
Top