Joined
Dec 24, 2018
Messages
59
Reaction score
3
First Language
Finnish
Primarily Uses
RMMV
So, I have enemies that walk a round the map, and once fought dissapear. I would like for these enemies to be reset on map change, which would at the moment require the transition to somehow changes all the enemies Self-Switches off. How on earth would I go around doing this?

So to elaborate, at the moment when an enemy is encountered, their script switches their Self-Switch to A, which activates the event page that turns them off and invisible.
 

Heirukichi

Veteran
Veteran
Joined
Sep 24, 2015
Messages
1,434
Reaction score
606
First Language
Italian
Primarily Uses
RMVXA
You could use a script call in the event used to change map. In the said script call you can change the value of all your events self switches:
Code:
var eventList = [id1, id2, id3, etc]; // change these to be the IDs of your events
eventList.foreach = function(id) {
  $gameSelfSwitches.setValue([$gameMap.mapId(), id, 'A'], false);
};
More about MV script calls can be found in this thread, that also contains an example similar to the one I used.

NOTE: be sure to place this BEFORE the transfer player command.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
34,763
Reaction score
8,978
First Language
German
Primarily Uses
RMMV
So to elaborate, at the moment when an enemy is encountered, their script switches their Self-Switch to A, which activates the event page that turns them off and invisible.
that is where you went wrong.

remove the self-switch and the second page and just use the "erase event" command.
The switches make this permanent, if you erase the event from memory it will be automatically reloaded if you leave and re-enter the map.
 
Joined
Dec 24, 2018
Messages
59
Reaction score
3
First Language
Finnish
Primarily Uses
RMMV
that is where you went wrong.

remove the self-switch and the second page and just use the "erase event" command.
The switches make this permanent, if you erase the event from memory it will be automatically reloaded if you leave and re-enter the map.
Ah thanks, yeah didn't think of this, as I originally had them leaving corpses behind, but decided against it later.

You could use a script call in the event used to change map. In the said script call you can change the value of all your events self switches:
Code:
var eventList = [id1, id2, id3, etc]; // change these to be the IDs of your events
eventList.foreach = function(id) {
  $gameSelfSwitches.setValue([$gameMap.mapId(), id, 'A'], false);
};
More about MV script calls can be found in this thread, that also contains an example similar to the one I used.

NOTE: be sure to place this BEFORE the transfer player command.
Thanks for your help!
 
Last edited by a moderator:

Latest Threads

Latest Profile Posts

Challenging myself to make a game on the console versions of RMMV with alot of custom stuff, battle system is almost done, but holy heck is the interface and navigation so backwards on console ports. I've lost several hours of work because of design choices from that team!
If only RM had the capability to show whether a project has been edited, or not... like 99% of all other editors out there. That don't cost, too, or release new versions with very few features just to get the extra money... ugh, just too many basic features missing even after, what, two decades?
Surgically removing people's faces and grafting them on to other people is kind of fun.

(editing character art busts for my game)
I think sleep is like a foreign language to me.

Forum statistics

Threads
118,819
Messages
1,118,954
Members
156,003
Latest member
arsenic333
Top