DavePerry

Villager
Member
Joined
Jul 18, 2019
Messages
29
Reaction score
5
First Language
english
Primarily Uses
RMMV
Is there a simple way to Tint my main player or followers on the map? turn them red or black etc

I found a plug in that can do this, but it slows the game down badly.. hoping a script call would be less intensive.
 

pasunna

Veteran
Veteran
Joined
Feb 3, 2019
Messages
531
Reaction score
279
First Language
thai
Primarily Uses
RMMV
I had read around before someone say it a bad memory so it removes from Mv
(never use other before but I think it had in earlier version?)
this filter is not black and red
but you can check it out if you can adapt it
because it look cool
 

DavePerry

Villager
Member
Joined
Jul 18, 2019
Messages
29
Reaction score
5
First Language
english
Primarily Uses
RMMV
I'll check it out, thanks
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,769
Reaction score
2,118
First Language
EN
Primarily Uses
RMMZ
You may find this post/thread helpful~
The default code (cf rpg_sprites.js, Spriteset_Map.prototype.createCharacters) stores all the sprites as members of the spriteset: events, vehicles, followers, player (in that order). So, assuming you have no other plugins that specifically change that pattern, the player sprite is the last in the list and you can reference/tint it like this:
Code:
var tmp = SceneManager._scene._spriteset._characterSprites;
var playerSprite = tmp[tmp.length - 1];
playerSprite.setColorTone([-128, -128, -128, 0]);  // darken
Note that by default followers are stored in reverse order immediately before the player, so in theory you could reference the sprite of follower 1 like this:
JavaScript:
var tmp = SceneManager._scene._spriteset._characterSprites;
var follower1Sprite = tmp[tmp.length - 2];  // 1 before player sprite
Reference code for sprite order:
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]);
    }
};
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
2,173
Reaction score
1,649
First Language
Portuguese - Br
Primarily Uses
RMMZ
Hi there!
Don't know if you want to learn how to do it or just want it done.
In the second case, there is a plugin made by @Ossra that is amazing.
Check it here. "Character control".
 

DavePerry

Villager
Member
Joined
Jul 18, 2019
Messages
29
Reaction score
5
First Language
english
Primarily Uses
RMMV
thanks for the responses ; )
 

Latest Threads

Latest Posts

Latest Profile Posts

Mr_Petue wrote on Eliaquim's profile.
please explain, why you are voting my commentary negativ.
Uploaded a new Video today where I play Minecraft "The Bridge" please check it out & let me know what you think of it!
I normally only post these every 24 hours, but same-sex marriage is coming to Rune Factory 5 and I just wanted to share it with the world! https://www.xseedgames.com/2021/09/23/rune-factory-5-localization-blog-2/
Today was wild. In the day I worked in my project (and realized I have almost 100 hours wich is a happy surprise), and now i'm having to calm my boyfriend down because of chris pratt Mario.
Mr_Petue wrote on GamchiSamwise's profile.
hey pepe, why do you have a gun on your head? where is wojak?

Forum statistics

Threads
115,320
Messages
1,088,921
Members
149,970
Latest member
TuxedoedPenguin
Top