my bad i dont use event commands much lately
(using scripts), so i didnt recognized that there is no event command to change event imgs..
However you could have googled: "how to set event imgs with script in rpg mv"..
The script you want is a "Game_CharacterBase" which also applys on "$gameMap.event(id)"
here is the default script:
View attachment 247862
thats what it looks like used on "$gameMap.event(id)":
$gameMap.event(
eventId).setImage(
characterName,
characterIndex);
some more infos if needed:
#4
(about set eventImages)
--------
Now we need to know if that only works on 1 special actor, or if that should work on any actor that has the State?
- if its 1 special actor, thats easy you dont need a script to check all actor units
- if its for any actor you will need a "groupScript" to check all actors
i explained group scripts a lot in this thread and also made a tutorial here:
Srpg-plugins/$ScriptCallList_SRPG.js at main · DopanPlugins/Srpg-plugins
However here is the related text & script:
Spoiler
JavaScript:// Code to ask about All EventUnits with the option to add code if Conditions are "True":
//----------------------------------------------------------------------------------------------------------
// (different Codes that are made out of this,with small edits, can be found in the plugin "SRPG_UnitsGroups")
// check all MapEvents , "[i]" is the Event ID
for (var i = 1; i <= $gameMap.events().length; i++) {
// access to Battler data. In usage its needed to add [0] for the event_Type, or [1] for the event_Unit
// That will look like this -> "battleunit[0]" "battleunit[1]"
// in the following context, [0] or [1] is NOT added,thats to store event ID so that "battleunit"&"eventunit" can be equal
var battleunit = $gameSystem.EventToUnit([i]);
// access to GameMap event data
var eventunit = $gameMap.event([i]);
// if the event ID of "Event" and "Battler" are same ,beeing "actor"- or "enemy"- eventType & The Unit is NOTdeath("!" at the beginning means NOT)
if (battleunit && eventunit && (battleunit[0] === 'actor' || battleunit[0] === 'enemy') && (!battleunit[1].isDead())) {
// example for executed script after all "if conditions" are "true"
// here i wanna show how "$gameSystem.EventToUnit(eventID)[1]" is replaced by "battleunit[1]"
// this adds a State to all Units that fit to the Conditions above.. its only needed to add the StateID (Replace "addID")
battleunit[1].addState(addId);
// Free Room to add more Execution Scripts that are used if all Conditions are "true"
//
// <-insert test code here & remove this help text + those "//"
//
}
};
same code without infos:
JavaScript:// changed to ask if state affected & set img:
for (var i = 1; i <= $gameMap.events().length; i++) {
var battleunit = $gameSystem.EventToUnit([i]);
var eventunit = $gameMap.event([i]);
if (battleunit && eventunit && (battleunit[0] === 'actor' || battleunit[0] === 'enemy') && (!battleunit[1].isDead())) {
if (battleunit[1].isStateAffected(stateId)) { eventunit.setImage(characterName, characterIndex) };
}
};
You should probably add an "else" condition to the last part, so if state is not affected set default img..
And dont use a parrallel event to trigger this or this will be triggered all the time:
there is always any actor that is or is not state affected..
You should use "turnEnd" or "after action" as triggger..
You might also want to store data on battlers/event/actor, to know if the actor/event has an img changed or if its using its original img--
-> to not trigger img changes when a unit has its original img and no state affected
=> i can explain this more detailled if you dont figure it out yourself
=> and if you dont use this on enemy units, you can remove the "enemy part":
|| battleunit[0] === 'enemy'
Btw solution 3 would also work in your case
edit
basicly you got 2 options left:
-
solution 1 ,which is explained above, but that will require more script to change the img back ect..
..if for any reason
using several eventpages is not wanted, you need solution 1
(if you want use solution 1 , i might need to give more detailled info and build script to check&restore the default event img after state was affected and state affection ended)
-
solution 3, which requires using several eventpages for each actor Unit, and a common event that enables/disables a unique switch for each possible actor, related to state affected..
-> these Unique switches should be used as event page conditions
-> the common event should be triggered parrallel when srpg battle is active
(that way the switches will always be "up to date" in srpg battle)
-> i would recommend this solution, cose it doesnt require so much script to change the imgs or to change them back when state is gone, or to check&restore the event default img ect..
-> basicly this solution can be done without script usage, by using event commands instead, to check actors state and to set switches ect
(the img changes will be handled from the different eventpages in these cases)
-------
no matter which solution you choose i can give more detailled infos how to do it if required..