Enemy appears when lever is pulled

Hello people. First of all, sorry if I don't explain well enough but english is not my first language :stare:


Ok, so I'm making my very first game (I have been working on it in my spare time for a while) and I just started with all the eventing, switches and variables things. I already know how to do the simplest things, and now I want to move to something more elaborated.


First, these images will help you to understand what i want to do:


ZgJ56wd.png



This is the map is the basement where I want all the action to take place. The white square is a transfer event to the main floor of this building where a mad scientist is ocuppied with his stuff of mad scientist. The red circle is a lever event (See second image).


TTrCruh.png



And this is the second event page (Forget about #3, I was using it for testing):


QUdTcwt.png



As you can see this is a very basic event: The character pulls the leverr, the levers goes down, sprinklers BGS goes off, and if character tries to put it back to up position, it says that its already activated (2nd event page).


Now, what I want is this: When the player pulls the lever, and the sprinklers go off, I want that the mad scientist comes down (appears in the white square) and comes where the player is (in front of the red circle), and a battle starts. And when the mad scientist is defeated, delete him from the main floor.


I have basic understanding on set movement route events, but I have no idea how to do this. I think it needs a command where the yellow arrow is in the second image, but I'm not enterily sure.


Hope you can help me 🙂 and thanks everybody.
Making him appear directly on the square is not particularly easy when you have another event there.

What you should do is make a new event in front of the white square.

It should have 3 pages.

Page 1 should be nothing with no conditions
Page 2 should have the condition "Palanca aspersores" is on and have the mad scientist graphic.


Page 3.Should be nothing with a new switch condition along the lines of "mad scientist defeated"

Page 2 should have the following code.

Set Movement Route (create a route from the event location to the player)
Battle Processing (Mad Scientist Battle)
New Switch "Mad Scientist Defeated" (or whatever you want to name it on) that is the condition for page 3.

Finally create a new event page for the mad scientist upstairs with the same "Mad Scientist Defeated" condition with no graphic.

That should do what you want.
The Mad Scientist Event could be placed at the top of the ladder, and could appear facing Up (and so with his back to us...), then Moved down the ladder and up to the Hero to set off the Battle.


Just sayin'.
Making him appear directly on the square is not particularly easy when you have another event there.

What you should do is make a new event in front of the white square.

It should have 3 pages.

Page 1 should be nothing with no conditions
Page 2 should have the condition "Palanca aspersores" is on and have the mad scientist graphic.


Page 3.Should be nothing with a new switch condition along the lines of "mad scientist defeated"

Page 2 should have the following code.

Set Movement Route (create a route from the event location to the player)
Battle Processing (Mad Scientist Battle)
New Switch "Mad Scientist Defeated" (or whatever you want to name it on) that is the condition for page 3.

Finally create a new event page for the mad scientist upstairs with the same "Mad Scientist Defeated" condition with no graphic.

That should do what you want.



THAAAAAANKS, that is exactly what I want (I only need to make 2 littlle changes to your explanation)


Iyk0Fok.png



D9nM1jQ.png



Just adding a control switch and self switch so the battle doesnt repeat again. Now works perfect 🙂 Also the mad scientist desappears in the main floor after the battle, so that part pf your explanation also works perfectly.


P.S: Is there a way to delay the aparition of the mad scientist when I pull the lever? I know the wait command, but I don't know where to put it. What I want is that when the character pulls the lever, the mad scientist has to spend some second (2-4 or so) to reach the basement. Right now he appears in the exact moment I pull the lever.
You could simply put a wait command on top of the second event page of the scientist, if you don't want the player to be able to move during that time.
You could simply put a wait command on top of the second event page of the scientist, if you don't want the player to be able to move during that time.



Mmmm Maybe that would be the best. Thanks. I wanted the`player to be able to move around until the scientist appearss, but it may be too difficult to event that, doesn't it?
THAAAAAANKS, that is exactly what I want (I only need to make 2 littlle changes to your explanation)








Just adding a control switch and self switch so the battle doesnt repeat again. Now works perfect 🙂


P.S: Is there a way to delay the aparition of the mad scientist when I pull the lever? I know the wait command, but I don't know where to put it. What I want is that when the character pulls the lever, the mad scientist has to spend some second (2-4 or so) to reach the basement. Right now he appears in the exact moment I pull the lever.


Assuming you don't want the player to be able to move

Create another blank event page with the condition "Palanca aspersores" Set it to autorun.

Add the code wait 240-480 frames (that is 2-4 seconds 60 frames = 1 second)

Then trigger a self switch.

Finally have your page 2 only run after that self switch is triggered.
 
Create another blank event page with the condition "Palanca aspersores" Set it to autorun.

Add the code wait 240-480 frames (that is 2-4 seconds 60 frames = 1 second)

Then trigger a self switch.

Finally have your page 2 only run after that self switch is triggered.
 

 Or set that event page to Parallel, then the player can move during the wait command.
 Or set that event page to Parallel, then the player can move during the wait command.


Well the issue with that is he wants the scientist to come towards the player. If the player is moving around at random how does he do that?
You're right, that might be a problem. Move towards player could work, but only if there is nothing between scientist and player...


If Fullereno needs the scientist to walk all the way up to the player, your option is definitely the better one. If that's not quite as important (no long cutscene relaying on scientist and player standing next to each other), it might be enough to have the scientist move one or two steps into the room, turn towards the player and maybe give a few lines of dialog before the battle starts.


Having the player be able to move and also getting the scientist all the way up to the player is definitely challenging 😉
Just a tip, if the first page is to be empty with no commands, you can skip it with no problems.
You're right, that might be a problem. Move towards player could work, but only if there is nothing between scientist and player...


If Fullereno needs the scientist to walk all the way up to the player, your option is definitely the better one. If that's not quite as important (no long cutscene relaying on scientist and player standing next to each other), it might be enough to have the scientist move one or two steps into the room, turn towards the player and maybe give a few lines of dialog before the battle starts.


Having the player be able to move and also getting the scientist all the way up to the player is definitely challenging 😉



That is problem. Something getting in the way of the scientist. I'll do what you both suggested: A wait command and some dialogue before the battle. Thanks guys!

Just a tip, if the first page is to be empty with no commands, you can skip it with no problems.

Thanks 🙂

Original thread: https://forums.rpgmakerweb.com/threads/enemy-appears-when-lever-is-pulled.69117/