The Daily Click ::. Forums ::. Klik Coding Help ::. creating top down followers
 

Post Reply  Post Oekaki 
 

Posted By Message

lembi2001



Registered
  01/04/2005
Points
  608

VIP MemberIt's-a me, Mario!Wii OwnerI like Aliens!Has Donated, Thank You!PS3 OwnerI am an April Fool
12th September, 2010 at 21:26:16 -

I am trying to get a group of objects to follow my player object, they must occupy a set area behind the player but they must also follow the path taken by the player, snake style. the objects must not overlap each other either. hopefully this makes sense and someone can help me out.

 
n/a

Silveraura

God's God

Registered
  08/08/2002
Points
  6747

Game of the Week WinnerKlikCast StarAlien In Training!VIP Member360 OwnerWii OwnerSonic SpeedThe Cake is a LieComputerChristmas Tree!
I am an April Fool
13th September, 2010 at 02:42:01 -

Set up a list to record the coordinates of your player as he takes them. Then make the other objects use constantly adding alterable values to know which coordinate they should be on and offset the starting time each objects starts adding to their alterable value. Depending on your framerate, it should be approximately 50 loops for 1 second, assuming your framerate is the default 50fps and running at optimum speed. So if you want an object to trail exactly 2 seconds behind and follow the players movements exactly, offset the time they start following (adding to their alterable value to read the listed coordinates) by 100, in other words... make it's starting alterable value be -100 so by time it gets to 1, it's 100 loops behind the main players.

 
http://www.facebook.com/truediamondgame

Jon C-B

I create vaporware

Registered
  23/04/2008
Points
  237

I'm an alien!VIP MemberWii OwnerI donated an open source project Santa Hat
13th September, 2010 at 03:13:15 -

when i first read this i thought of making the player keep creating objects at his position, so then when he moved around there would be a trail. Then make the follower always look at the objects and destroy the objects when the followers touch it

 
n/a

lembi2001



Registered
  01/04/2005
Points
  608

VIP MemberIt's-a me, Mario!Wii OwnerI like Aliens!Has Donated, Thank You!PS3 OwnerI am an April Fool
13th September, 2010 at 20:27:14 -

I am trying to recreate "The Last Man" in MMF.

You have to round up groups of people and then lead them to safety. The people stand around inside houses and then when you get near they approach you and then group up behind you. They follow you to a safe zone where they stay.

I have got other features of the game replicated and am just struggling to get this one working.

 
n/a

Rick Shaw



Registered
  30/04/2008
Points
  158
17th September, 2010 at 04:14:25 -

To do it the way you describe, having the followers take your exact path, is possible if you use the list technique described above. You'd have a historical list of coordinates, and it would be relatively simple for each follower to decide which (x,y) coordinates they should be navigating toward. You would need to devise a mechanism to add and remove followers to your train, however, because each follower would need to be behind the one in front.

I've done something exactly like this once, and I just used a simple algorithm of always having the followers walk toward the player, stopping once they collided with an invisible circular object that follows the player. They don't all follow in a line, but they realistically cluster behind the moving player. If they also collide with each other you'll get even more realistic clumping. They might be prone to get stuck, but this depends on many factors of your game and whether or not you think it's a useful gameplay challenge.

 
n/a

lembi2001



Registered
  01/04/2005
Points
  608

VIP MemberIt's-a me, Mario!Wii OwnerI like Aliens!Has Donated, Thank You!PS3 OwnerI am an April Fool
18th September, 2010 at 15:45:39 -

Cheers Rickshaw

Would you be able to put an example together for me? If i manage to complete the game i will list you in the credits for it.

 
n/a

Rick Shaw



Registered
  30/04/2008
Points
  158
25th September, 2010 at 02:51:55 -

sorry for the delay, here's a download link http://rapidshare.com/files/421090995/follow_demo.mfa
This should illustrate what I was talking about.

 
n/a

lembi2001



Registered
  01/04/2005
Points
  608

VIP MemberIt's-a me, Mario!Wii OwnerI like Aliens!Has Donated, Thank You!PS3 OwnerI am an April Fool
27th September, 2010 at 16:10:07 -

Thanks I'll take a look later on.

EDIT - Just looked at it now. Works a treat. tweaked it a little but brilliant.

Edited by lembi2001

 
n/a
   

Post Reply



 



Advertisement

Worth A Click