|
Post by TheRPGNOOb on Dec 11, 2004 21:05:12 GMT -5
Oi, I was able to fairly easily create a grid-based 4 directional follower/leader bit, however the follower object goes wonkers with my 8-directional motions attempt . If someone has a tidy script for this kind thing please post it, otherwise I could send you what I got for repairs/improvement .
|
|
|
Post by IsmAvatar on Dec 12, 2004 10:33:10 GMT -5
i just use 2 datastructures. every step, add to ds1 the x coordinate, and add to ds2 the y coordinate. userweb.nni.com/cmagicj/snake.gmdas for grid, I think I had a trick that narrowed it down to just the grid positions, so the datastructures didn't get so large so fast. userweb.nni.com/cmagicj/snakeg.gmdof course, those were made in GM5.3. If you need me to remake them for 6.0, just ask.
|
|
|
Post by TheRPGNOOb on Dec 14, 2004 17:56:10 GMT -5
That's spiffy! 2 Things though: 1. I need the origin of the objects to be centered else I can't set the depth correctly: 2. If you have the time update to include diagonal motions: Other than that it makes good use of data-structers, and thanx for making the examples .
|
|
|
Post by IsmAvatar on Dec 15, 2004 13:53:38 GMT -5
I don't intend to add anything extra to them. I only showed them to you so you could look at the code and learn from them how to use datastructures for something like this.
|
|
|
Post by TheRPGNOOb on Jan 10, 2005 20:49:44 GMT -5
I updated my own follow thing-a-mig so now (I think) it can have as many followers as I want (only tested it with two), and they can overlap so the player wouldn't get stuck in a corner or something. It uses waypoints rather than data-structures though, because it was easier for me that way. Still can't get it to work with diagonals though. If I sent it to you would you take a look at it and see if you could finish the diagonal motions? The problem as far as I can tell, is they won't line up with the correct positions when moving at an angle, for some odd reason.
|
|