[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
77
Reaction score
26
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
77
Reaction score
26
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,677
Reaction score
13,301
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
77
Reaction score
26
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
77
Reaction score
26
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
77
Reaction score
26
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,025
Reaction score
4,767
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

One 3-day jam and a Game Awards... this month is moving... \o/
Maker-ing has been being the best thing that happened to me this year so far. it is so good to rescue some old skills fo creativity and the people I have met are really incredible. I love my coffelanders and tocudos buddies. Maybe one day I will reach other countries folks too. S2
Well... My game plays better at 1920x1080, so I guess that's the new resolution. Still runs at 60FPS. :LZSexcite: Also... I really want a boss to be able to build new maps around the player... Mostly because it's visually spectacular! I'm er... not quite sure yet how I can do that without making MV explode.... But I'll find a way, anything in service to the "sparkles"! :kaopride:
How to change your netbooks screen resolution

Forum statistics

Threads
100,794
Messages
979,597
Members
132,437
Latest member
Vollar45
Top