Hello all.
I am currently working on a Card Battler using RPGMaker MV that has mechanics very similar to Slay the Spire. This includes the mechanic whereby the enemy's next action 'intent' is shown to allow the Player to plan accordingly.
While trying to introduce this mechanic into my own game, I came across Famicon80's post on the forum back in 2018 titled, "Show enemy's next move," where they were looking for assistance in re-creating the same mechanic.
Reading through the responses, I saw that both you and another user (Aloe Guvner) provided a way for the enemy 'intent' to appear as a state.
Guvner's addition to your code was for each new state be some pre-made array of state ID's unique to each enemy.
I am struggling to get the code to work properly, likely due to my overall inexperience with using these types of codes in general.
Would anyone be willing to provide me some example screenshots of how to properly implement these codes (preferably including Guvner's addition) so that I can re-create it within my project?
Thanks for your time and any assistance anyone can offer in regards.
EDITS:
I am currently working on a Card Battler using RPGMaker MV that has mechanics very similar to Slay the Spire. This includes the mechanic whereby the enemy's next action 'intent' is shown to allow the Player to plan accordingly.
While trying to introduce this mechanic into my own game, I came across Famicon80's post on the forum back in 2018 titled, "Show enemy's next move," where they were looking for assistance in re-creating the same mechanic.
Reading through the responses, I saw that both you and another user (Aloe Guvner) provided a way for the enemy 'intent' to appear as a state.
Code:
<After Eval>
var old = #
// Change # to the skill's required state
var newstate = [X, X, X];
// Replace the X's with state IDs, can have as many as you want here including duplicates
var index = Math.randomInt(newstate.length);
var choice = newstate[index]
if (user.isStateAffected(choice)) {
} else {
BattleManager._subject.removeState(old);
BattleManager._subject.addState(choice);
}
</After Eval>
<Custom Requirement>
var x = #
// Change # to the skill's required state
if (user.isStateAffected(x)) {
value = true;
} else {
value = false;
}
</Custom Requirement>
Guvner's addition to your code was for each new state be some pre-made array of state ID's unique to each enemy.
Code:
<After Eval>
var old = #
// Change # to the skill's required state
var newstate = $dataEnemies[user._enemyId].meta.states.split(',').map(function(n){return parseInt(n)});
// Reads the allowed state values from the enemy notetag
var index = Math.randomInt(newstate.length);
var choice = newstate[index]
if (user.isStateAffected(choice)) {
} else {
BattleManager._subject.removeState(old);
BattleManager._subject.addState(choice);
}
</After Eval>
I am struggling to get the code to work properly, likely due to my overall inexperience with using these types of codes in general.
Would anyone be willing to provide me some example screenshots of how to properly implement these codes (preferably including Guvner's addition) so that I can re-create it within my project?
Thanks for your time and any assistance anyone can offer in regards.
EDITS:
- Removed the spoiler tags and used 'Code' tags as recommended by ATT_Turan.
- Added (3) screenshots for my setup of the Skill, State, and Enemy note-tags in my attempt to follow the JSGreene and Guvner codes.