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!

Events triggered by events

Gamescolar

Villager
Xy$
0.00
Good day!

I'm trying to design a 'smart chase scene' where the monster would chase after the player and learn to jump through obstacles, rather than running blindly around trying to find a way through.

A jump movement can be triggered easily by the player since there are Triggers ready to be activated by the player. However, I cannot seem to find a way to have the trigger be activated by an event which is approaching the player.

My request is as follows:
I'm looking for a way or logic that can make the monster trigger a Jump movement toward the left when he steps on an event.

Monster chases smart player to the cliff, no way to go through.
Chase 1.png


We set an event that makes a Jump to X=-1
Chase 2.png


Monster event approaches player but steps on triggered event to make it jump over the cliff.
Chase 3.png

Summary:
How do you make an event trigger another event for it?

Any replies are welcome and will be really appreciated. Thanks!

Best regards,
Gamescolar Dev. Group
 

Saruteku

Villager
Xy$
0.00
I never tried this but I think you can use the logic of Push Statue puzzles (Which I have used) Where you have the X and Y of the monster and X and Y of the target being tracked and if they match the monster jumps using move route.

Like I said, I haven't tried it so I'm not sure if it's Optimal or if it will slow your game down but the game is very fast as processing which means you can theoretically do this with only 4 varables as long as all monsters have control varible events set to their X and Y on Parallel, same with the Jump Pads.

Not sure if this helps but there you are.
 

Desro

Villager
Xy$
0.00
Well, I would suggest this. Place an event that will be jump pad; make it with no image and on the same priority as characters. Set it's trigger to be 'parallel'. In it, place a conditional branch, go to page 4 to select a script as the test, and place the following command:

$gameMap.event(Id).isCollidedWithEvents(x,y);

Replace id with the integer id of the jump pad event itself, and x and y with the x and y coordinates displaced by 1 from whatever direction you want the event to come from. For example, if the jump pad is (8,7), and the event will be coming from the right, you'll want to put (9,7) as your parameters.

Inside of the conditional branch, flip a switch on that will trigger the event page on the event that is making the jump. You could have multiple conditional branches to determine from which direction the jump will come from. In the same example in the previous paragraph, if the character event was coming from the top instead of the left, the command would be,

$gameMap.event(Id).isCollidedWithEvents(8,6);


As far as I know the MV system, I'm not sure if there even is a way to accomplish what you want to accomplish without using commands like the one I have provided.

You can see here how I made it happen myself.
 
Last edited:

Gamescolar

Villager
Xy$
0.00
Thank you for the really helpful advice! We were able to get it up and running. Now we have less chances of players taking advantage of the terrain against the chase.

I appreciate the help :)

(Issue resolved)
 
Top