Famicon80

Warper
Member
Joined
Aug 13, 2018
Messages
4
Reaction score
2
First Language
English
Primarily Uses
RMMV
Hello everyone! In slay the spire enemy's telegraph what their next action will do, like so:
77aaf12ce1.jpg

The big knight's the enemy and the thing above him is telling the player he's going to attack them for X damage this turn.
Is there a way to replicate this in RPG Maker MV, perhaps having a state be the thing above the enemy's head showing their next move?
 
Last edited:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Regular
Joined
May 15, 2012
Messages
14,693
Reaction score
3,034
First Language
Tagalog
Primarily Uses
RMVXA
Well if you're using default MV battles and want it to show while you are selecting your party's actions, it somehow cannot be done since afaik the enemy actions are only created after the party already chose their actions. In which case, it would need a rewrite of when the actions are created, which might cause some problems with other behaviors.
 

JGreene

Regular
Regular
Joined
Oct 24, 2015
Messages
456
Reaction score
373
First Language
English
Primarily Uses
RMMV
You can definitely replicate this using Yanfly's Skill Core and Buffs & States Core.

The following code will strict the enemy's skills to require a certain state to use. Then, when they use a skill, it removes the current state and randomly applies a new one - thus dictating which action they will take on the next turn.

<After Eval>
var old = #
// Change # to the skill's required state
BattleManager._subject.removeState(old);
var newstate = [X, X, X, X];
// Replace any X with a state ID, can have as many as you want here
var index = Math.randomInt(newstate.length);
var choice = newstate[index]
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>

The Buffs & States Core will allow you to show the state icon along with the stack number as indicated in your image. That part will have to be set up separately however.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Regular
Joined
May 15, 2012
Messages
14,693
Reaction score
3,034
First Language
Tagalog
Primarily Uses
RMVXA
Wow thats a neat workaround, and you can even extend it to make more decent AI easily (though also limited by some factors since it runs directly after the enemy makes its its moves).
 

Famicon80

Warper
Member
Joined
Aug 13, 2018
Messages
4
Reaction score
2
First Language
English
Primarily Uses
RMMV
I was trying to figure out how to do this for awhile, and that's a really easy and good solution.
thank you @JGreene, that's pretty much what I wanted!

EDIT: Is there a way to have the var newstate be some pre-made array of state ID's unique to each enemy in the database? Otherwise there would be lots of duplicate skills with the only difference being what states they apply.

Also, if it chooses the same state twice in a row that states deleted and the enemy has nothing to do.
 
Last edited:

JGreene

Regular
Regular
Joined
Oct 24, 2015
Messages
456
Reaction score
373
First Language
English
Primarily Uses
RMMV
I was trying to figure out how to do this for awhile, and that's a really easy and good solution.
thank you @JGreene, that's pretty much what I wanted!

EDIT: Is there a way to have the var newstate be some pre-made array of state ID's unique to each enemy in the database? Otherwise there would be lots of duplicate skills with the only difference being what states they apply.

Also, if it chooses the same state twice in a row that states deleted and the enemy has nothing to do.

For the pre-made array, you'd probably need some heavy scripting for that.

And I've fixed the code. Just needed to add in an if else segment.

<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>
 
Last edited:

Aloe Guvner

Walrus
Regular
Joined
Sep 28, 2017
Messages
1,627
Reaction score
1,201
First Language
English
Primarily Uses
RMMV
EDIT: Is there a way to have the var newstate be some pre-made array of state ID's unique to each enemy in the database? Otherwise there would be lots of duplicate skills with the only difference being what states they apply.

Yup, you can do this, just modify JGreene's code like this:

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>

In your database, on each enemy in the notetag, you can write:
Code:
<states:X,X,X,X>
(replace X with the different state IDs)
 

Latest Threads

Latest Posts

Latest Profile Posts



My finest work: A system that automatically updates the prompts for button inputs as the game goes along. (Eg. [Z] becomes [X] if you change the confirm button to be X on the keyboard, etc.).

This is 100% common eventing, and I'm tempted to make a demo for other people to utilize since it's the ultimate companion piece to YEP_KeyboardConfig.
Pushing myself to try more shading than just absolutely flat.
Well, who wants the Steam Key of Phil Alone - Game Dev Book? (It's my game and my DLC guys, don't worry)
I uploaded a new demo update for my open world cyberpunk rpg!
ThereseIdleWIP1.gif
Next hero in the works, Therese from MV. Knight/Crusader job class that can use 2 handed swords or 2 handed axes.

Forum statistics

Threads
134,782
Messages
1,250,552
Members
177,561
Latest member
pieweekend
Top