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

ZyCHqk2.png

Something about top-downs.
I have never felt so attacked by a tree before :LZSlol: it took 10++ hours to make but at least it looks pretty LOL

Untitled-1.png
now seems like the worst time for me to need a better computer with how much stuff is costing. that and I don't thing there's much else I can do to make MV run any better with what I have.
Sigh... to have some variety in this weather. More than just sun and rain and wind and thunder.
In the meantime, I've discovered that I'm slowly becoming fatigued from the many sleepless nights my neighbors cause. Or at least their dogs. Always barking at something.
I might need a day to just sleep and recharge.

Forum statistics

Threads
118,452
Messages
1,116,086
Members
155,429
Latest member
Fishm
Top