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

I think after I get this game done, I'm going to take a long vacation from game development. It feels great to see the coding skills get better and it is fun - but god it is also so exhausting.
Just advertising that I released version 0.9 of my game yesterday, for feedback purposes. My first game or creative endeavor ever :D Would be cool if someone tries it out!
An overall view of my full set of sprites so far, this was really fun to work in this past year! :kaopride:
1653056206274.png

Even though the game is cancelled, I'm still doing art in my spare time and seeing how it'd look.

It's a lot of fun. Wish I could be an artist!

Forum statistics

Threads
121,971
Messages
1,145,563
Members
160,249
Latest member
PhantomRaptorDS
Top