- 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.
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.