Retrieving Player Character Sprite

I found out that it is stored in SpriteMap:

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)); // <<< one of these is the gamePlayer's sprite that I need. for (var i = 0; i < this._characterSprites.length; i++) { this._tilemap.addChild(this._characterSprites); }};How do I get a copy of the sprite (not the entire character bitmap just the active 48x48 frame) when the player is on the Game_Map?

Wish I could delete posts... Of course always just after I ask the question online shortly after I find the answer myself but never in the hours before...

Solution:

Code:
var alias_silv_mm_createCharacters = Spriteset_Map.prototype.createCharacters;Spriteset_Map.prototype.createCharacters = function() {	alias_silv_mm_createCharacters.call(this);	Spriteset_Map.prototype.playerSprite = this._characterSprites[this._characterSprites.length - 1];}// Usage: Spriteset_Map.prototype.playerSprite._bitmap
Note that the player sprite may have been changed, since other plugins could add additional character sprites to the list (eg: if you spawn more events to the map)

Each character sprite holds a reference to the character object

Sprite_Character.prototype.setCharacter = function(character) { this._character = character;};I would prefer looping over all of the sprites (in reverse order) and checking if it's the one I want.Alternatively, you could maintain a hash map kind of thing to speed this up.
Thanks you're right I totally forgot. New solution after reading your post:

Code:
var alias_silv_mm_createCharacters = Spriteset_Map.prototype.createCharacters;Spriteset_Map.prototype.createCharacters = function(){	alias_silv_mm_createCharacters.call(this);		for (i = this._characterSprites.length - 1; i >= 0; i--)	{		if (this._characterSprites[i]._character == $gamePlayer)		{			Spriteset_Map.prototype.playerSprite = this._characterSprites[i];			break;		}		}}
When the player walks on grass the playergraphics becomes invisible? Does it use a different graphic for that?
No, it just turns translucent. This is called bush opacity which you set on tiles.

Original thread: https://forums.rpgmakerweb.com/threads/retrieving-player-character-sprite.50859/