I just tested in a project without plugins, and on the map SceneManager._scene._spriteset returns an instance of Spriteset_Map, as expected. It's the container for all character sprites (player, followers, events, vehicles) etc.
I'm guessing you either mistyped when checking the console, or one (or more) of your plugins completely overhauls all of that...? :kaoswt2:
deleted old post
edit
edit 1 (old)
my bad, it was because i always go to
scene menu before i open console f8 ..
( i am doing this to avoid "request animationFrame" issue.. info img)
thx for double checking with an empty/clean project
@
caethyril
you are a Genius! , your code works fine.. i tried this without going in "scene menu" & ignoring the "violation" info..:
JavaScript:var spriteset = SceneManager._scene._spriteset;
var eventId = 9; // in my testing project each actor ID is the same like the event ID..
var battler = $gameActors.actor(9); //.. i used event placeholders to make that sure
var sprChar = spriteset._characterSprites[eventId - 1];
sprChar._stateSprite = new Sprite_StateOverlay(); // init
sprChar.addChild(sprChar._stateSprite); // add
sprChar._stateSprite.setup(battler); // setup
so actor 9 with event ID 9 will indeed display the poison State if affected!
(after puting your code in console and closing console)
.. I am pretty sure i can do that on all Units without help..
The only issues left (no real Issues):
1. This will always just display the state with the highest Priority,there are Plugin requests for rotate trough states or display several states,
but i couldnt find a plugin that does it^^
(not even for the default SV battles)
2.This will Stop/End as soon the
"Scene menu" was opened.. and has to be refreshed after going back to
"map Scene"..
(i am not sure why, but that should be no problem, i can refresh the function..)
about 1:
i think the best way would be to add a rotation betwen the states, but i think thats not so easy because i couldnt find any plugin that does that.. even not for SV.
Or using StateNote tags that decide if this state is a "rotation state" or a "parrallel state".. without StateNote it would be a "Default state" that only shows up if its the highest priority
(i got no idea how this could be solved , i think i can use normal animations as walkaround for "special states" like "aura".. also i think displaying to much states could get laggy.. i already tried that with animations for all states and rotation via CE.. instead of using state overlays)
about 2:
I think when i make a function that "returns true" on
battlemap whenever active.. i can easyly refresh it whenever its "NOT true" outside of "scene menu" on
Battlemap.
( i am pretty sure i can figure this out myself.. aswell as adding all Units on map to the Function.. not just actor 9 )
*Battlemap means , when SRPG battle is active.. which is the same like "map scene" but only with the battle modus active.. where Events become Units ect..
Edit the 3rd
i think i solved "about 2"
here is my test function which can be used for SRPG projects
js code
JavaScript:Game_Interpreter.prototype.srpgStateOverlay = function() {
for (var i = 1; i <= $gameMap.events().length; i++) {
var battleunit = $gameSystem.EventToUnit([i]);
var eventunit = $gameMap.event([i]);
var spriteset = SceneManager._scene._spriteset;
var eventId = [i];
var sprChar = spriteset._characterSprites[eventId - 1];
if (battleunit && eventunit && (battleunit[0] === 'actor' || battleunit[0] === 'enemy') && (!battleunit[1].isDead())) {
sprChar._stateSprite = new Sprite_StateOverlay(); // init
sprChar.addChild(sprChar._stateSprite); // add
sprChar._stateSprite.setup(battleunit[1]); // setup
}
return true;
}
};
Game_Interpreter.prototype.srpgStateOverlay(); // can be used to refresh
i tried to use a Game battler prototype at first to get the event id of every Unit, but that didnt worked well..
Here the proof that it works on All Units Now^^
(enemys have "enemy state" , actors have "friend State", actor9/nymphe has "poison state" with higher priority)
works on all Units

--
hearts = friend state
fireface = enemy state
green bubbles = poison state (higher priority)
This thread will be reported as Solved,..to be closed
if "about 1" should be solved or needs more questions,.. this can be made in an Extra Thread