Lizardcats

Villager
Member
Joined
Nov 5, 2021
Messages
6
Reaction score
1
First Language
English
Primarily Uses
RMMZ
Hi sort-of newbie here,

I need a bit of help with some mechanics in my game, hopefully I can explain my problem well.

Basically, my game has five elements, Fire, Earth, Metal, Water and Wood. Hitting an enemy with an elemental attack gives them a weakness to the next element along the "chain" (Fire > Earth > Metal > Water > Wood > Fire). This weakness increases the longer the chain is kept going, topping at 3x (so 1.5x, 2x, 2.5x then 3x). Further attacks would just keep the weakness multiplier at 3x. However if the wrong element was used, the "chain" would reset back to a 1.5x weakness to the next element.

For example, if an enemy is hit with a Fire attack, they'd gain a 1.5x weakness to Earth attacks, then if they were hit with an earth attack they'd gain a 2x Metal weakness. However, if they were then hit by Water attack, they'd lose the 2x Metal weakness, but gain a 1.5x weakness to Wood, which would become a 2x Fire weakness if they were hit with a Wood attack.

I use states with the each of the elements and weakness levels, so 20 all up. So my idea was to have each attack check to see if the target had particular state (a weakness to the attacking element), add the appropriate state and remove the original. I (miraculously) got this a prototype to work with MV thanks Yanfly, but I've since switched to MZ. Which due to the changes in how MZ operates, means my prototype no longer works.

At the moment I'm trying to run a Common Event for each element. But I can't seem to get it to work, as I'm not very experienced with scripting. My major problem is I'm not sure what code to use to check the target's state, as the options menu only asks for specific enemies not generic ones. If anyone is able to help me that would great.
 

Lizardcats

Villager
Member
Joined
Nov 5, 2021
Messages
6
Reaction score
1
First Language
English
Primarily Uses
RMMZ
(Apologies for double posting). Right, so I solved this by modifying my old prototype along with some trial and error. The idea is to get the script to check if the target has a certain weakness (state) or not and apply the next appropriate weakness (state) in the sequence.

Here's a copy of the code I'm using. Obviously I'm switching out the state numbers for each element, but otherwise their all identical.

1638326027506.png

This code works, but if there was any way to make it run smoother, I'd love to hear about it.
 

Latest Threads

Latest Posts

Latest Profile Posts

Remember to do your 0,01% progress on your game today!
Went to see Jujutsu Kaisen 0 yesterday, it was cool. The movie wasnt really a masterpiece, it had some pacing and characterization problems, but overall I enjoyed it, maybe because it was the first anime film I have ever been to in the cinema lol. The battle animation & music were top-notch. I havent seen much of the anime so people who watched the entire season would probably like it more.
MainMenu.PNG
Finally satisfied with the main menu xD

The plan was to have battle sprites in the menu...But these faces from Ocean's Nostalgia look pretty damn good imo. (Will have to adjust for them ofc and maybe recolor to match the overworld/battle sprites more)
It's always disturbing to me to see my cat eating something off the bathroom floor.

Forum statistics

Threads
121,994
Messages
1,145,758
Members
160,261
Latest member
Darinoplas
Top