RPGM Pain in ..for something so basic.. (Img/picture for actors in battles. ;) )

Axyal

Newbie
Nov 24, 2019
62
61
Hello guys.

*sigh*
I see a lot of rpg maker games being able to show pictures for Mc or ally characters, and it evolve depending on the current state.

Aaannnd i cant do that.

I "wish"' something that hard:

being able to show a picture for character playing his/her turn.
According to his/her current states, show differents pictures.

Oh yes my plan is to have a looooot of states (for more pictures).
I tried to MP some people on discord.
On rpg maker forum.
I created some topic.
This is only failure.

the thing is, i should go on ren'py, but it's frustrating to be stuck on something so basic...
I wonder could you help me guys?
Because i have every thing set to create content and a good start.
I wish to switch on ren'py later, depending on the succes of my first attempt. But damn rpg maker... w.w

To be more accurate, clear, i will create picture displayed in battle, whatever front or sideview, as for example:
if character is mid life, show a picture.
If character is poisoned, show a picture
If character is poisoned and mid life, show another picture..

and repeat this for each different character.
I wish to add a passive state with yanfly plugin, like "full hp and cursed" state wich will show different picture depending on the current actor.

I found this, on the internet, but i understand nothing ( x) ) :
---------------------
Apr 27, 2022
How can I show a specific picture in battle depending on which equipment is used by an actor what skills they use and what states they are in? Basically said picture would show what this actor is doing/wearing at the moment.

If it was answered somewhere already please direct me there as I can't find any information on it.

EDIT: So basically thanks to Yanfly's Buffs & States Core I can show pictures tied to a variable. And have said variable change with states. Need to figure out a way to assign specific images to a specific actors.

Using RPG Maker MV.
Thank you.

Apr 28, 2022

You could try using Yanfly's Actor Variables to record which image should currently be associated with the actor, then call a common event to display the image that variable's value corresponds to.

--------------------

Sound like i'm not the only one looking for basic stuff for rpg maker mv... (i'm using mv btw!)

I dont understand how they can "tied a picture to a variable", make it change depending on the state (??), and same for the answers i dont get it...
 
Last edited:
Aug 28, 2021
145
126
I don't know anything about RPG Maker MV, even which language it use is unknown to me... so I won't be able to give you specific advices but, let's imagine that

1) you can add logic and variables into your characters or into your turn system
2) A "match" pattern exist in its language
3) Also an enumeration exist

"tied a picture to a variable", make it change depending on the state (??), and same for the answers i dont get it...
When loading the portrait, first check which condition is true. With a match pattern, it could look like this :

match STATUS:
STATUS.OK
img = ok.png
STATUS.HURT
img = hurt.png

portrait_to_show = img

Where STATUS is an enum : STATUS = {OK, HURT, WHATEVER}

This loading stuff should happen when a turn is about to start (or when an attack is perform? it could be a cool feature to see it happening in "realtime" even in a turn based combat)

NB Remember, I have no idea how RPG Maker handle any of this, there is just some logic.
 
  • Like
Reactions: Axyal

Deleted member 1121028

Well-Known Member
Dec 28, 2018
1,716
3,292
Anyone please?
Hmm I don't have RPGM on that machine but simply use these when actor is in X state?

$gameActors.actor(actorId).setCharacterImage("name", index);
$gameActors.actor(actorId).setFaceImage("name", index);
$gameActors.actor(actorId).setBattlerImage("name");
$gamePlayer.refresh();

Or a plugins similar like this one?

 

Axyal

Newbie
Nov 24, 2019
62
61
well first thanks both of you for your help.
There's a lot of rpg maker project that use a front view that show a monster, and beside a picture for your character, and this picture/image change depending on the current states of your battlers.

For example, karryn's prison, i think it's the same mechnaic, heroin have many expression depending on states (hidden state).
There's a lot of rpg maker using that concept but strangely i'm not able to found anything.

Rpg maker mv language is ruby.
The victor plugin dont fit the idea, it can not show different picture from different actor, and it replace face or map view character, or battler. No images. Sadly.
 
Aug 28, 2021
145
126
I have done some tests on ruby site, it's only a console,so no image loading, nor gamy stuff, only logic from my previous post.

***

Jon = ['J0','J1']
Ruud = ['R0','R1']
Meg = ['M0','M1']

statut = 0
char = 'Ruud'

case char
in 'Jon'
img = Jon
in 'Ruud'
img = Ruud
end
puts img[statut]

***
First lines create 3 enum.

You should get statut and char from active character. In this example, char is a String, you can use integer (Cf Ruby doc). status is an integer, it allow us to search an index within our enums (here statut is equal to 0, so first element will pop)

In ruby, case open a match pattern. Right after case, you set the value you want to match (here, we match char, a character's name, a String). On next line, with in, you set values which will be test. Next line, you write code to execute if this statement match (if char match with 'Jon', img = Jon run).

end close the case statement.

puts print what follow into the console.

img[statut] : within our case, we have copied one enum into img, statut is the index within this enum. Here img is equal to Ruud and statut is equal to 0, so puts return a value equal to 'R0'

How it help?

Your status should have an id as an integer. Your enums contain references to your images, in order equal to your status indexes (if 100% hp, no boost, no negative statut is 1, first element in enums should be a ref to your smiling portrait). You update a texture container with what the case return.
 

Deleted member 1121028

Well-Known Member
Dec 28, 2018
1,716
3,292
Rpg maker mv language is ruby.
The victor plugin dont fit the idea, it can not show different picture from different actor, and it replace face or map view character, or battler. No images. Sadly.
Yes ruby, but you can inject javascript code in various way.
I had trouble to visualize what you want to do but I think (maybe lol) I get it now.

06a.png

First you should bookmark , should save you lot of time.
Your main points of interest :

brave_1k3MCOqgdr.jpg

brave_RsUds9baqi.jpg

After quick google :
Look at this , you will need Yanfly's Battle Engine Core & Buffs & States Core plugins.
This is pasted in the note tag box of the state.

Code:
<Custom Apply Effect>
// Check if user is an actor.
if (user.isActor()) {
  // Archive the previous settings.
  user._prevCharName = user._prevCharName || user._characterName;
  user._prevCharIndex = user._prevCharIndex || user._characterIndex;
  user._prevFaceName = user._prevFaceName || user._faceName;
  user._prevFaceIndex = user._prevFaceIndex || user._faceIndex;
  user._prevBattlerName = user._prevBattlerName || user._battlerName;
  // Check if the actor ID is 1.
  if (user.actorId() === 1) {
    // The filename of the character graphic without the file extension.
    var charName = 'HaroldSSJ';
    // The index of the character graphic used.
    var charIndex = 0;
    // The filename of the face graphic without the file extension.
    var faceName = 'HaroldSSJ';
    // The index of of the face graphic used.
    var faceIndex = 0;
    // The filename of the battler graphic without the file extension.
    var battlerName = 'Harold_SSJ1';
  // Check if the actor ID is 2.
  } else if (user.actorId() === 2) {
    // The filename of the character graphic without the file extension.
    var charName = 'ThereseSSJ';
    // The index of the character graphic used.
    var charIndex = 0;
    // The filename of the face graphic without the file extension.
    var faceName = 'ThereseSSJ';
    // The index of of the face graphic used.
    var faceIndex = 0;
    // The filename of the battler graphic without the file extension.
    var battlerName = 'Therese_SSJ1';
  // Check if the actor ID is 3.
  } else if (user.actorId() === 3) {
    // The filename of the character graphic without the file extension.
    var charName = 'MarshaSSJ';
    // The index of the character graphic used.
    var charIndex = 0;
    // The filename of the face graphic without the file extension.
    var faceName = 'MarshaSSJ';
    // The index of of the face graphic used.
    var faceIndex = 0;
    // The filename of the battler graphic without the file extension.
    var battlerName = 'Marsha_SSJ1';
  // Check if the actor ID is 4.
  } else if (user.actorId() === 4) {
    // The filename of the character graphic without the file extension.
    var charName = 'LuciusSSJ';
    // The index of the character graphic used.
    var charIndex = 0;
    // The filename of the face graphic without the file extension.
    var faceName = 'LuciusSSJ';
    // The index of of the face graphic used.
    var faceIndex = 0;
    // The filename of the battler graphic without the file extension.
    var battlerName = 'Lucius_SSJ1';
  // If none of the above actor ID's match, use this setting.
  } else {
    // The filename of the character graphic without the file extension.
    var charName = 'HaroldSSJ';
    // The index of the character graphic used.
    var charIndex = 0;
    // The filename of the face graphic without the file extension.
    var faceName = 'HaroldSSJ';
    // The index of of the face graphic used.
    var faceIndex = 0;
    // The filename of the battler graphic without the file extension.
    var battlerName = 'Harold_SSJ1';
  }
  // Changes the character image to the setting applied from above.
  user.setCharacterImage(charName, charIndex);
  // Changes the face image to the setting applied from above.
  user.setFaceImage(faceName, faceIndex);
  // Changes the battler image from the setting applied from above.
  user.setBattlerImage(battlerName);
  // Refreshes the user's appearance.
  user.refresh();
}
</Custom Apply Effect>

<Custom Remove Effect>
// Retrieve archived settings.
var charName = user._prevCharName;
var charIndex = user._prevCharIndex;
var faceName = user._prevFaceName;
var faceIndex = user._prevFaceIndex;
var battlerName = user._prevBattlerName;
// Changes the character image to the archived setting.
user.setCharacterImage(charName, charIndex);
// Changes the face image to the archived setting.
user.setFaceImage(faceName, faceIndex);
// Changes the battler image from the archived setting.
user.setBattlerImage(battlerName);
// Clear archived data.
user._priorityCharacterName = undefined;
user._priorityCharacterIndex = undefined;
user._prevFaceName = undefined;
user._prevFaceIndex = undefined;
user._priorityFaceName = undefined;
user._priorityFaceIndex = undefined;
user._prevFaceName = undefined;
user._prevFaceIndex = undefined;
user._priorityBattlerName = undefined;
user._prevBattlerName = undefined;
// Refreshes the user's appearance.
user.refresh();
</Custom Remove Effect>
While it does not do what you want, you have the part where the actor is selected when a state is applied (the if/else part).
Now instead of changing names/FaceName/FaceIndex and so on, you want to show/erase a picture. So a default state when battle begins and create new states when image had to be changed. Note that you could also use Yanfly's ActionSequence to call a common event that change the images in the action setup when Actor is performing an attack for exemple.
 
  • Like
Reactions: FromOtherSpace

Axyal

Newbie
Nov 24, 2019
62
61
Thanks boths of you. I'm being busy right now i cant tell if it work.
I also have found an potential alternative.
Wait and see. Anyway, thanks both of you :)
Xoxo!