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,453
Reaction score
620
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
35,870
Reaction score
9,508
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 Posts

Latest Profile Posts

Had a funny feeling about my laptop last night so I moved my project over to desktop via thumbdrive, just experienced my first corrupted project and couldn't be happier about the timing!! *proceeds to copy file onto every thumbdrive in the house*
Test game. Find something broken. Fix. Re-test game. Broken thing fixed but new thing broken that wasn't before. What?!?! Uhg! :kaoangry:
I watched this youtube video of this reporter that went to a Flat Earth Conference. And there was just a whole lot of stupid in one room.
What?! You want 2 more hours of a playthrough? Well you got it! Come hang out with us while we dive even deeper into the awesome game Kindred Novel by BirdBunch! :LZSjoy:

Forum statistics

Threads
122,072
Messages
1,146,294
Members
160,354
Latest member
Erulia
Top