Greetings!
I am currently starting to on a RPGmaker game that has been floating around my head for a few weeks now and I have come across some issues when trying to make one specific mechanic work.
The concept behind the skill: I am trying to make a mechanic where one off my characters has the ability to "call out" an opponents next move. The way that it would work is the character would use up his turn to predict that one specific enemy would use either a physical attack or a magical attack. During that enemy's turn if they attack and the character called out the correct damage type he will punish them with a hard hitting attack that also generates a large amount off TP. If they do not perform the correct the attack then nothing would happen and the character essentially wasted his turn...
The way I have gone about creating this is that the character will have two abilities titled "call: magic" and "call: physical". Both off these skills would inflict a state called "Called: magic" and "Called: Physical" respectively. I would then have every single enemy skill in the game run a common event (one for the magic skills and one for the physical skills) where the game would check if the enemy using the skill has the appropriate state and if they do, use a ForceAction to have the player character use their punishing attack.
The problem: I have been unable to find a way to have the common event Properly check the state off the enemy using a skill during their turn. The event manager itself has offered no way to do this so I have been trying to utilise a script to handle it.
This is a test event i created to test the script out. Unfortunatetely this script causes the game to crash with "ReferenceError
gameTroop is not defined" each time the event is run.
I have tried various other ideas too... With no luck. I understand the issue may be that $gameTroop.members() returns every enemy in the troop and not a specific one... However I am simply not expirienced enough with RPGmaker MZ or javascript as a whole to fix this myself.
Any help is much appreciated!!!
I am currently starting to on a RPGmaker game that has been floating around my head for a few weeks now and I have come across some issues when trying to make one specific mechanic work.
The concept behind the skill: I am trying to make a mechanic where one off my characters has the ability to "call out" an opponents next move. The way that it would work is the character would use up his turn to predict that one specific enemy would use either a physical attack or a magical attack. During that enemy's turn if they attack and the character called out the correct damage type he will punish them with a hard hitting attack that also generates a large amount off TP. If they do not perform the correct the attack then nothing would happen and the character essentially wasted his turn...
The way I have gone about creating this is that the character will have two abilities titled "call: magic" and "call: physical". Both off these skills would inflict a state called "Called: magic" and "Called: Physical" respectively. I would then have every single enemy skill in the game run a common event (one for the magic skills and one for the physical skills) where the game would check if the enemy using the skill has the appropriate state and if they do, use a ForceAction to have the player character use their punishing attack.
The problem: I have been unable to find a way to have the common event Properly check the state off the enemy using a skill during their turn. The event manager itself has offered no way to do this so I have been trying to utilise a script to handle it.
This is a test event i created to test the script out. Unfortunatetely this script causes the game to crash with "ReferenceError
gameTroop is not defined" each time the event is run.
I have tried various other ideas too... With no luck. I understand the issue may be that $gameTroop.members() returns every enemy in the troop and not a specific one... However I am simply not expirienced enough with RPGmaker MZ or javascript as a whole to fix this myself.
Any help is much appreciated!!!