How to add states to monsters when hit by their weakness?

Justguy

Villager
Member
Joined
Jan 3, 2022
Messages
10
Reaction score
2
First Language
english
Primarily Uses
RMMZ
Hey there I'm currently making a combat system for my RPG maker mz game but I have one question. How do you give enemies states when hit with the element they are weak to. I've looked for solutions but I can't find one. So please help. Also additional note I'm not good at java or anything coding-related so try to keep it to plug-ins or just a solution in the base RPG maker mz.
 

Tiamat-86

old jrpg gamer
Veteran
Joined
Dec 5, 2017
Messages
1,079
Reaction score
525
First Language
english
Primarily Uses
RMMV
depending on how you want this to work it would take a different approach.

if using the skill "Flame" hitting an enemy weak to fire applies burn state. this can be done with damage formula on the skill (note that damage formulas applying the state ignore any resistance rates for the state)
b.elementRate(X) > 1 ? b.addState(Y); Z
X is the element id found in 'types'
Y is the state's id
Z is the normal damage formula for the skill


if it a different state for different enemies (fire on wood golem applies burn state, but fire on giant moth applies panic state) this will require a plugin.


if using a skill that has 'normal attack' element and a weapon that gives 'attack element: fire'
this will require a plugin.


if the state and the element type have no connection, just the fact that they are hit by something they are weak to applies a stagger mechanic type of state. this will require a plugin.


all these different possibilities is why people want you to be as thorough as possible when explaining how want a mechanic to work when asking for help in the forums.
 
Last edited:

Justguy

Villager
Member
Joined
Jan 3, 2022
Messages
10
Reaction score
2
First Language
english
Primarily Uses
RMMZ
depending on how you want this to work it would take a different approach.

if using the skill "Flame" hitting an enemy weak to fire applies burn state. this can be done with damage formula on the skill (note that damage formulas applying the state ignore any resistance rates for the state)
b.elementRate(X) > 1 ? b.addState(Y); Z
X is the element id found in 'types'
Y is the state's id
Z is the normal damage formula for the skill


if it a different state for different enemies (fire on wood golem applies burn state, but fire on giant moth applies panic state) this will require a plugin.


if using a skill that has 'normal attack' element and a weapon that gives 'attack element: fire'
this will require a plugin.


if the state and the element type have no connection, just the fact that they are hit by something they are weak to applies a stagger mechanic type of state. this will require a plugin.


all these different possibilities is why people want you to be as thorough as possible when explaining how want a mechanic to work when asking for help in the forums.
thanks a ton, I should have been more specific, sorry about that.
 

Justguy

Villager
Member
Joined
Jan 3, 2022
Messages
10
Reaction score
2
First Language
english
Primarily Uses
RMMZ
depending on how you want this to work it would take a different approach.

if using the skill "Flame" hitting an enemy weak to fire applies burn state. this can be done with damage formula on the skill (note that damage formulas applying the state ignore any resistance rates for the state)
b.elementRate(X) > 1 ? b.addState(Y); Z
X is the element id found in 'types'
Y is the state's id
Z is the normal damage formula for the skill


if it a different state for different enemies (fire on wood golem applies burn state, but fire on giant moth applies panic state) this will require a plugin.


if using a skill that has 'normal attack' element and a weapon that gives 'attack element: fire'
this will require a plugin.


if the state and the element type have no connection, just the fact that they are hit by something they are weak to applies a stagger mechanic type of state. this will require a plugin.


all these different possibilities is why people want you to be as thorough as possible when explaining how want a mechanic to work when asking for help in the forums.
I have a question. Do you have any recommended plugins for option number 4?. Here's an example of what I want. If the enemy is hit by fire and it's weak to it the enemy will be stunned. It's that simple. So if you have a plugin recommendation for that please tell me I tried to find one with no success whatsoever. Thanks in advance for any response.
 

Tiamat-86

old jrpg gamer
Veteran
Joined
Dec 5, 2017
Messages
1,079
Reaction score
525
First Language
english
Primarily Uses
RMMV
with mv it required 2 plugins, 1 for 'passive states' and 1 for 'custom react effect' on that state.
MZ visu's skill/state plugin gives the passive states but not sure which 1 would give the react effects.

going to need someone else to step in here thats more familiar with MZ's plugins
(and better at code then me, sorry i cant be more help then that)
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
6,143
Reaction score
6,292
First Language
English
Primarily Uses
RMMZ
The equivalent of Custom React Effect is <JS Pre-Damage As Target>, it's a standard features in Skills and States Core, no other plugins needed.
 

Tiamat-86

old jrpg gamer
Veteran
Joined
Dec 5, 2017
Messages
1,079
Reaction score
525
First Language
english
Primarily Uses
RMMV
@Trihan you happen to also know the code he will need for 'this.elementRate > 1 { addState(X)'
he mentioned in the OP he's also not good at code

edit: guess before that we would need to know how he wants the reapply to work.
allowing for this mechanic to stunlock will probably be to overpowered.
 

Justguy

Villager
Member
Joined
Jan 3, 2022
Messages
10
Reaction score
2
First Language
english
Primarily Uses
RMMZ
with mv it required 2 plugins, 1 for 'passive states' and 1 for 'custom react effect' on that state.
MZ visu's skill/state plugin gives the passive states but not sure which 1 would give the react effects.

going to need someone else to step in here thats more familiar with MZ's plugins
(and better at code then me, sorry i cant be more help then that)
The equivalent of Custom React Effect is <JS Pre-Damage As Target>, it's a standard features in Skills and States Core, no other plugins needed.
@Trihan you happen to also know the code he will need for 'this.elementRate > 1 { addState(X)'
he mentioned in the OP he's also not good at code

edit: guess before that we would need to know how he wants the reapply to work.
allowing for this mechanic to stunlock will probably be to overpowered.
thanks again for responding and let me clarify more on how the reapply will work. Unless the enemy is a boss hitting its weakness will 100% stun it. In my game, the party is almost always just one character so I added the stun enemy when its weakness is hit mechanic to make fights with two enemies easier to handle. I also did it to leave less of the combat up to Rnjesus and make it more strategic. When fighting a boss when its weakness is hit there is a chance it'll get stunned and a chance it won't it varies depending on the boss. Sorry if this is not specific enough. I will also try using the information you already gave me to make this battle system thanks. Also, it'll help a lot for convenience if you could link for mz visu's skill/state plugin. I tried searching it up but so many things come up and I've watched many videos but can't find anything about passive states. Once again thanks
 

Sword_of_Dusk

Ace Attorney
Veteran
Joined
Sep 13, 2015
Messages
1,143
Reaction score
1,186
First Language
English
Primarily Uses
RMMV
Thanks for the link just another quick question. There are two downloads the sample game project and the bundle. There seems to be no download for the plugin itself so do I have to buy the bundle. If I do then I have money to spend so I don' mind
You want the sample game, which is free. It includes all of the free VS plugins, including Skill and States Core.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
6,143
Reaction score
6,292
First Language
English
Primarily Uses
RMMZ
@Trihan you happen to also know the code he will need for 'this.elementRate > 1 { addState(X)'
he mentioned in the OP he's also not good at code

edit: guess before that we would need to know how he wants the reapply to work.
allowing for this mechanic to stunlock will probably be to overpowered.
You almost had it, you just needed a false section for your ternary if:

b.elementRate(X) > 1 ? b.addState(Y) : null; Z

I generally avoid ternary ifs if I don't have something happening in both cases, but this is a perfectly valid line of code.
 

Justguy

Villager
Member
Joined
Jan 3, 2022
Messages
10
Reaction score
2
First Language
english
Primarily Uses
RMMZ
Thanks for the link just another quick question. There are two downloads the sample game project and the bundle. There seems to be no download for the plugin itself so do I have to buy the bundle. If I do then I have money to spend so I don' mind
You almost had it, you just needed a false section for your ternary if:

b.elementRate(X) > 1 ? b.addState(Y) : null; Z

I generally avoid ternary ifs if I don't have something happening in both cases, but this is a perfectly valid line of code.
Once again I'm grateful for your help I got the plugin and I'm going to search up a tutorial on how to use it. I hope this battle system works out after that but who knows. Thanks a lot for the code too it'll definitely help.
 

Justguy

Villager
Member
Joined
Jan 3, 2022
Messages
10
Reaction score
2
First Language
english
Primarily Uses
RMMZ
You almost had it, you just needed a false section for your ternary if:

b.elementRate(X) > 1 ? b.addState(Y) : null; Z

I generally avoid ternary ifs if I don't have something happening in both cases, but this is a perfectly valid line of code.
Hey there I know it's been a while but I've run into a problem with the code. I know it's silly and might be an annoying question but what should I put in x, y, and Z. I already tried the options in Timats response but they didn't seem to work.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
6,143
Reaction score
6,292
First Language
English
Primarily Uses
RMMZ
X would be the ID of the element you're checking the rate of, Y would be the ID of the state you want to add if they're weak against that element, and Z is the damage the skill deals.
 

Tiamat-86

old jrpg gamer
Veteran
Joined
Dec 5, 2017
Messages
1,079
Reaction score
525
First Language
english
Primarily Uses
RMMV
@Trihan i think there was a misscommunication earlier in the discussion.
he would need code for the <JS Pre-Damage As Target> for enemy's passive state notetag.
not damage formula

stagger mechanic, enemy gets stunned when hit by any attack that hits X weakness

(also im not seeing that note tag being from skill/state core you sure its not an extension plugin?)
 
Last edited:

Justguy

Villager
Member
Joined
Jan 3, 2022
Messages
10
Reaction score
2
First Language
english
Primarily Uses
RMMZ
@Trihan i think there was a misscommunication earlier in the discussion.
he would need code for the <JS Pre-Damage As Target> for enemy's passive state notetag.
not damage formula

stagger mechanic, enemy gets stunned when hit by any attack that hits X weakness

(also im not seeing that note tag being from skill/state core you sure its not an extension plugin?)
X would be the ID of the element you're checking the rate of, Y would be the ID of the state you want to add if they're weak against that element, and Z is the damage the skill deals.
Hey I know I've been gone for a while again but I got an idea. All this coding stuff is confusing me so I want to ask. Is it possible that whenever an enemy is hit with its weakness to run a common event that adds the state?. Thanks for any answers
 

Latest Threads

Latest Posts

Latest Profile Posts

Have to be more organised and serious. It helps that im running out of time at work :|. so much to do. Trying to make game studio proffessional. www.bmpgames.com
imgur links are back!
now I CAN keep getting away with NOT replacing them with updated renders!
yay!
I forgot RPG Maker even existed. Such good memories. Might boot up steam and download MV one more time
10 pieces of KFC chicken for US$12.30, delivery included. Cheap or expensive? :aswt:
Ugh-I HATE this! There's construction going on in my area and because of that my Internet connection is wonky; this site in particular keeps constantly freezing up on me; I can't even barely type a single sentence without the page freezing in the middle of it! I hope this changes soon.

Forum statistics

Threads
131,548
Messages
1,220,754
Members
173,220
Latest member
ZecaVn
Top