[SOLVED] How do I add a second charset layer on top of default charset?

Status
Not open for further replies.

Lanzy

Veteran
Veteran
Joined
Feb 29, 2020
Messages
70
Reaction score
22
First Language
English
Primarily Uses
RMMV
Hello fellow RPG Comrades,

I want to change the Player's appearance when, let's say, he puts a new helmet on.
But, instead of changing the entire charset, I want to add another charset layer on top of the player.
The second charset layer would only show the helmet in various positions.

That way, I would save myself the hassle of creating an entire new charset for every single item combination.
I searched for plugins and posts, but so far have not found anything. Sorry if I missed something and this is a redundant post.

In rpg_sprites, line 2329 I found the method for loading the charset of $gamePlayer.

JavaScript:
Spriteset_Map.prototype.createCharacters = function() {
    this._characterSprites = [];
    $gameMap.events().forEach(function(event) {
        this._characterSprites.push(new Sprite_Character(event));
    }, this);
    $gameMap.vehicles().forEach(function(vehicle) {
        this._characterSprites.push(new Sprite_Character(vehicle));
    }, this);
    $gamePlayer.followers().reverseEach(function(follower) {
        this._characterSprites.push(new Sprite_Character(follower));
    }, this);
    this._characterSprites.push(new Sprite_Character($gamePlayer));
    for (var i = 0; i < this._characterSprites.length; i++) {
        this._tilemap.addChild(this._characterSprites[i]);
    }
};
I tried adding a new charset Sprite to SceneManager._scene._spriteset._characterSprites and set the x, y coordinates to the player. However, the charset keeps returning to it's original map position. So I couldn't even attempt to make the charset move along with the player, while being on top.

I'm sure there is a plugin for this I haven't found yet.
Either way as always I'm thankful for any help.

Kind regards,

Lanzy
 

Kuro DCupu

Trust me, I'm a veteran RMer
Veteran
Joined
Jul 6, 2014
Messages
446
Reaction score
1,402
First Language
Indonesia
Primarily Uses
RMMV
It's called paper doll.
Which lead me to this thread:
Which answered with a link to this plugin:
http://sumrndm.site/dynamic-actors/
 
  • Like
Reactions: Bex

aporokizzu

anti-kumbaya
Veteran
Joined
Jan 14, 2020
Messages
59
Reaction score
84
First Language
english
Primarily Uses
RMMV
Create a subfolder in your project's img folder called "equipment". Put your helmet png in it.

Create a plugin file and place this code in it:
Sprite_Equipment.png

Pull up the console and type these commands:
JavaScript:
let helmet = new Sprite_Equipment($gamePlayer, `helmet`);
// replace `helmet` with the filename of your helmet png (without the extension)
and
JavaScript:
SceneManager._scene.children[0]._tilemap.addChild(helmet);
You might have to adjust the x and y coordinates of where your helmet will be placed in conjunction to your player sprite, which you can do by rewriting the first console command-

let helmet = new Sprite_Equipment($gamePlayer, filename, x, y);

Enjoy!
 
Last edited:

Lanzy

Veteran
Veteran
Joined
Feb 29, 2020
Messages
70
Reaction score
22
First Language
English
Primarily Uses
RMMV
Create a subfolder in your project's img folder called "equipment". Put your helmet png in it.

Create a plugin file and place this code in it:
View attachment 149777

Pull up the console and type these commands:
JavaScript:
let helmet = new Sprite_Equipment($gamePlayer, `helmet`);
// replace `helmet` with the filename of your helmet png (without the extension)
and
JavaScript:
SceneManager._scene.children[0]._tilemap.addChild(helmet);
You might have to adjust the x and y coordinates of where your helmet will be placed in conjunction to your player sprite, which you can do by rewriting the first console command-

let helmet = new Sprite_Equipment($gamePlayer, filename, x, y);

Enjoy!

Thank you for this extensive workaround. Unfortunately, after some testing, it didn't work. The helmet nor the armor charset appears anywhere. I tested on a small map and adjusted the coordinates. Still to no avail I'm afraid. Even after adjusting the coordinates. It does not show up on the screen.

Maybe the screenshots help you understand the problem. Thanks for you time!
 

Attachments

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,660
Reaction score
13,270
First Language
English
Primarily Uses
RMMV
And what about the plugin that does this exact thing that was suggested earlier? Did you try it?
 

Lanzy

Veteran
Veteran
Joined
Feb 29, 2020
Messages
70
Reaction score
22
First Language
English
Primarily Uses
RMMV
And what about the plugin that does this exact thing that was suggested earlier? Did you try it?
I first tried aporokizzu's suggestion, because I prefer it to using plugins. I try to avoid as many plugins as possible, because I have my own plugins for my game, which can go more or less deep into the core script. So I try to avoid any conflicts.

I will try out the dynamic actors plugin now however.
 

aporokizzu

anti-kumbaya
Veteran
Joined
Jan 14, 2020
Messages
59
Reaction score
84
First Language
english
Primarily Uses
RMMV
@Lanzy - weird it's working on my end:


I looked through you screenshots and everything seems kosher... so I'm sorry it didn't work for you. Maybe it's a conflict with other plugins?
 

Lanzy

Veteran
Veteran
Joined
Feb 29, 2020
Messages
70
Reaction score
22
First Language
English
Primarily Uses
RMMV
@Lanzy - weird it's working on my end:


I looked through you screenshots and everything seems kosher... so I'm sorry it didn't work for you. Maybe it's a conflict with other plugins?
Hmm, I'll open a new project and see if that works. Thanks for trying it out. I'll let you know if it worked.
 

Lanzy

Veteran
Veteran
Joined
Feb 29, 2020
Messages
70
Reaction score
22
First Language
English
Primarily Uses
RMMV
It worked! Problem was, it was so far out of the map, I didn't even see it. Only when I loaded a huge image and walked to the map corner I could see it then. Yipeee, thanks everonye :)
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,003
Reaction score
4,744
First Language
Dutch
Primarily Uses
RMXP

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

So I just spent the weekend...playing my own game. The one I released last year. Yep you heard that right.
Goal for MZ? None... I'm still curious how to finish my VXA project and how it looks like when it actually finished. Which will take at least another two years. Coming late again to the party.
Finding it amusing that people are posting support questions in new threads for an engine that isn't even released yet. Touch and Archeia are the only ones authorised to say anything, and there's only one active thread where they'll be answering questions.
I think my goal for MZ ... is to actually release a game and not have twenty technical demos and debugging projects. Let's see if I can manage that. ;o
I am starting to enjoy writing. I never thought I would enjoy it since my dyslexia was holding me back so much.
Thanks to the community here :)
For those interested chapter 2 and 3 are available to read here:

Forum statistics

Threads
100,652
Messages
978,096
Members
132,261
Latest member
DarthNinjus
Top