Indie Dev

Hello Guest!. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, sell your games, upload content, as well as connect with other members through your own private inbox!

Can i change an Event Image without using a switch, variable or second event page

Anthony D

Villager
Xy$
0.00
Hi All,

Long time RPG maker user however new to RPG Maker MV.

I have spent the last 2 weeks doing online java script tutorial at code academy and watching you tube videos to learn java script. I am still very new to the whole language so i am unsure of what can be achieved and what cannot not be achieved.

As the heading suggests, i am trying to find a way to change an event image without using a switch, variable or second page.
I am pretty sure this cannot be achieved though standard eventing, so i have turned to javascript.

The reason i am trying to do this is that i noticed that an event can only have 20 event pages in MV, which will not be enough for the event(s) and system i am trying to create.

If anyone can point me in the right direction for the command that will allow me to change an event image via javascript, that would be great

Thanks in advance
AD
 

CT_Bolt

Global Moderator
Staff member
Resource Team
Xy$
0.02
See spoiler for how to do this, but I've now made a plugin to simplify this issue.
The option to change the graphic is under the event movement settings. However this would be only a temporary change I believe due to not using a switch to lock in the graphic.

See image below:

Alternative way using Javascript would be the following...
Javascript:

JavaScript:
var event_Id = 1;
var character_index = 0;
var character_filename = "filename";
var direction = 2;
$gameMap.event(event_Id).setImage(character_filename, character_index);
$gameMap.event(event_Id).setDirection(direction); // 2 = Down, 4 = Left, 6 = Right, 8 = Up
Optional: Below is how to use the Event ID of the event in that is calling the script.
JavaScript:
var event_Id = this._eventId;
I've made you a very small demo to show this in action.
This uses another event with a parallel process to change 2 of the events on each side.
I could have just changed them right away but I felt like using a timer. (wink)
Talk with the middle one to change the graphic for that event.
Change Event Graphic - Javascript: Demo - Click here to view

Please let me know if that is what you needed. Hope that helps. (cute)(thumbsup)

**********Update**********
I've made a small plugin that will most likely suit your needs.
Plugin & Demo: Click here to View
 
Last edited:
Top