[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,654
Reaction score
13,265
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,001
Reaction score
4,743
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 Posts

Latest Profile Posts

ESAMarathon on Twitch, now streaming "Eat Girl". Yep, that's the title of a game... Apparently it's a Pacman knockoff.... Which is of course the only logical conclusion one would get from a name like "Eat Girl". :kaopride: I can't believe anybody would think anything else! :kaoback:
Super stoked i just finished my first town in my project, by finished i mean i can always add more decorative aesthetics and the NPCs don't talk yet but the mapping is complete and all the important chess pieces are present!
My brain: Hey, I have an idea how to make the transition to the main story quest in The Wastes more natural!
Me: Good!
My brain: You need to remake the hotel you start out in, it's not realistic enough.
Me: Ok... This was unexpected, but I can do it.
My brain: Now make each hotel floor 5 times as large to match the main part. Oh, you also need to make a bunch of new npcs to fill in the space on these maps.
Me: Crap.
Should be able to release Haxe MV/MZ next weekend.
It look that somehow MZ tracks are messed up (for example battle4 is obviously a theme, castle2 is a ship, ship1 is a scene and so on..). Maybe they just named them after with some ambiguity.

Forum statistics

Threads
100,618
Messages
977,837
Members
132,228
Latest member
zhengdddddd
Top