Help - Search - Members - Calendar
Full Version: *Help* Make an objects chase player
RPG RPG Revolution Forums > Scripting > Event Emporium
rewells
I'm working on some puzzles and can't figure out how to make something work. I'm trying to create a room like the one found starting at 6:32 in this video: http://www.youtube.com/watch?v=RHClvvrhmxw...;feature=relmfu

There are three large balls. When the player gets within a certain distance, the balls start rolling in the direction of the player, and if you get hit you take damage. I want it set up so that when the ball collides with the player he is transfered back to the entrance of the map.

What I have tried but doesn't work: I made ball events set to approach player and activate on player touch that transfers to player to the start of the map. The events still move kind of erratically (as in they approach but randomly move left and right for some reason) and if they touch the player while the player is NOT moving, nothing happens (it works fine if the player is moving and collides with the event).

Can anyone help me?
Night_Runner
Have a demo
http://min.us/mQvqGzqGA

I think you mostly have it working, just have the events trigger off an "Event Touch".

The random movement left/right is a feature of the "Approach" Movement type, it's in case there's a tree or something in their way, they just move to the side every so often so they don't get stuck.
There's obviously better ways to address this potential issue (path generation for example, or only moving randomly if there's something actually blocking the way), but the dumb 'move randomly 1/6 of the time' is very simple to implement, and uses almost no processing power, so I'm guessing that's why Enterbrain implemented it happy.gif
rewells
Thank you! This is awesome. I'll credit you if I make a longer project!

QUOTE (Night_Runner @ May 29 2012, 08:12 AM) *
Have a demo
http://min.us/mQvqGzqGA

I think you mostly have it working, just have the events trigger off an "Event Touch".

The random movement left/right is a feature of the "Approach" Movement type, it's in case there's a tree or something in their way, they just move to the side every so often so they don't get stuck.
There's obviously better ways to address this potential issue (path generation for example, or only moving randomly if there's something actually blocking the way), but the dumb 'move randomly 1/6 of the time' is very simple to implement, and uses almost no processing power, so I'm guessing that's why Enterbrain implemented it happy.gif

rewells
Ok I set this up in my project and for some reason the things that chase me work left-to-right but not forward-and-back. I've triple checked my eventing and cannot for the life of me figure out why it's doing that. Any ideas?

Here is my current project. Maps 006 and 007 are the ones I'm having trouble with.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.