Make every event on map dissapear.

coolperez8

Veteran
Veteran
Joined
Mar 23, 2016
Messages
159
Reaction score
12
First Language
English
Primarily Uses
So, I'm working on an easter egg for my RPG Maker Project, and I want to know how to do something in script calls...


How can I make every event on the map disappear (as if they were erased) and disable saving using a single script call?


Also, one optional thing:


I also want to change the title bar displaying the name of the game to a specific string.
 
Last edited by a moderator:

Yappy Monoxide

The Yappiest Yap Yapp you will ever Yap
Veteran
Joined
Jul 13, 2016
Messages
172
Reaction score
203
First Language
English
Primarily Uses
N/A
You could just make an event page with nothing on it on the events you want to disappear and have it be triggered by a switch in the conditions tab.
 

coolperez8

Veteran
Veteran
Joined
Mar 23, 2016
Messages
159
Reaction score
12
First Language
English
Primarily Uses
You could just make an event page with nothing on it on the events you want to disappear and have it be triggered by a switch in the conditions tab.
Yeah. But, due to the easter egg I want, that would mean I'd have to program new events to do that too. I also want every event to disappear, leaving just the player and the tiles.


Figured it out:

Code:
for (var i = 1; i < $gameMap.events().length; i++) {
  $gameMap.eraseEvent([i]);
};
$gameSystem.disableSave();
 
Last edited by a moderator:

Yappy Monoxide

The Yappiest Yap Yapp you will ever Yap
Veteran
Joined
Jul 13, 2016
Messages
172
Reaction score
203
First Language
English
Primarily Uses
N/A

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
1,076
Reaction score
856
First Language
English
Primarily Uses
RMMV
Yeah, there are several ways. I was going to suggest the following, but your method is fine, too.

Code:
$gameMap._events.forEach(function(event) {
  event.erase();
});

$gameSystem.disableSave();
 

coolperez8

Veteran
Veteran
Joined
Mar 23, 2016
Messages
159
Reaction score
12
First Language
English
Primarily Uses
Yeah, there are several ways. I was going to suggest the following, but your method is fine, too.



$gameMap._events.forEach(function(event) {
event.erase();
});

$gameSystem.disableSave();
Yeah, that works better.


My method didn't do it with the last event.
 

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
1,076
Reaction score
856
First Language
English
Primarily Uses
RMMV
You just needed to do the following :  $gameMap.events().length - 1

'length' starts the count at 1 while the '_events' array starts at 0.
 

coolperez8

Veteran
Veteran
Joined
Mar 23, 2016
Messages
159
Reaction score
12
First Language
English
Primarily Uses
You just needed to do the following :  $gameMap.events().length - 1

'length' starts the count at 1 while the '_events' array starts at 0.
Oh, got it.


Now, is there any way to make the game print an error (show RPG Maker MV's error screen with a custom "error") after about 30 seconds since that script was activated, while giving the player the option to move around until the crash?


And, is it possible to change the title bar text?
 
Last edited by a moderator:

Yappy Monoxide

The Yappiest Yap Yapp you will ever Yap
Veteran
Joined
Jul 13, 2016
Messages
172
Reaction score
203
First Language
English
Primarily Uses
N/A
Oh, got it.


Now, is there any way to make the game print an error (show RPG Maker MV's error screen with a custom "error") after about 30 seconds since that script was activated, while giving the player the option to move around until the crash?


And, is it possible to change the title bar text?
I'm pretty sure you have to use the SetWindowText() Command.
 

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
1,076
Reaction score
856
First Language
English
Primarily Uses
RMMV
You can create an error using the following :


throw new Error('Error text');


Not quite sure how to change the name of the game window, and I'm too short of time to poke around.
 

coolperez8

Veteran
Veteran
Joined
Mar 23, 2016
Messages
159
Reaction score
12
First Language
English
Primarily Uses
You just needed to do the following :  $gameMap.events().length - 1

'length' starts the count at 1 while the '_events' array starts at 0.
Also, what if I want to exclude an event with a certain ID from being removed?


Sorry moderators, I know double posting isn't allowed but I had already made the previous post and was unsure how to add a quote to it as it would add it to the new post box.
 

coolperez8

Veteran
Veteran
Joined
Mar 23, 2016
Messages
159
Reaction score
12
First Language
English
Primarily Uses
You just needed to do the following :  $gameMap.events().length - 1

'length' starts the count at 1 while the '_events' array starts at 0.
Also, what if I want to exclude an event with a certain ID from being removed?


Sorry moderators, I know double posting isn't allowed but I had already made the previous post and was unsure how to add a quote to it as it would add it to the new post box.


(Whoops, I refreshed because it didn't appear to be posting, and it posted twice. Sorry, I have bad internet.)
 
Last edited by a moderator:

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
1,076
Reaction score
856
First Language
English
Primarily Uses
RMMV
Code:
$gameMap._events.forEach(function(event) {
  // If not the 1st event, erase event ...
  if (event._eventId != 1) event.erase();
  
  // If you want to select separate actions for
  // different events ... 
  switch (event._eventId) {
    // When event._eventId equals 1 ...
    case 1:
      // [code to execute]
      break;
      // When event._eventId equals 3 ...
    case 3:
      // [code to execute]
      break;
    // Everything else ...
    default:
      event.erase();
      break;
  }
});

$gameSystem.disableSave();
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,035
Messages
1,018,454
Members
137,821
Latest member
Capterson
Top