Touched
Resident ASMAGICIAN
- 625
- Posts
- 10
- Years
- Age 123
- Seen Feb 1, 2018
I played around with the modified mimic function Shiny Quagsire posted, and, correct me if I'm wrong, but it will only follow you a short distance? It'll go across routes, sure, but it's limited by steps.
NPCs have a movement-distance variable (right under movement type in Advanced Map, which I put as the first 'Mirror Player' there - that's the correct one, right? Worked anyway.) in XY format I think, so I guess the max any NPC can go is the movement value FF, or 16 y and 16 x. That's as far as I was able to make it go.
If you go far enough away from the NPC, they teleport back to their original position, and for me at least go kinda bonkers when you go back to retrieve them. So you could spam NPCs at a far enough distance from each other to hax it into longer distance, or less spastically put some kind of periodic script to mod the movement-type/start-pos of the NPC following you? o_0 Or a combo of the two, which sounds more feasible if it's a small hack and you, say, only have the NPC following you around for a short while/area anyway. Although it seems like there should be a way, since the NPC seems to check how far it's gone since the origin point, to silently find and ASM repoint that origin as you move along so the NPC never runs out of space to roam from the origin. If it's just one var, it shouldn't be too lag inducing. Maybe I'm completely wrong and that isn't how NPCs move, or maybe since the origin is hardcoded and probably not used as a temp var you'd just have to get the NPC to stop looking for the origin altogether rather than repointing it.
If there's a way to make NPCs move further and I'm just ignorant and blathering about nothing, please correct me, I'm a newbie.
Yeah, you can't move them outside that boundary box, as it's built into the collision detection. The NPC literally views that box as a solid wall, meaning they're unable to pass through it. So I just rewrote part of the collision detection for this behaviour.
I've made significant progress on this, so I thought I would share that with you (some of you have been waiting 4 years for this O.o). Following (pun not intended) on from shinyquagsire's idea of reusing the behaviour byte, I've got basic following working. This means you can walk and run around with a follower and you won't lose them. Right now, there are significant bugs, because I haven't finished all of the code.
Let's start off with what DOESN'T work
- Bumping into NPCs and water, maybe some more things (laziness, haven't finished collision detection)
- NPCs can walk through the follower, but this was because I was lazy with my collision detection again
- Biking
- Surfing
- Warps
- Applymovement
However, let's go over what does work
- Walking around
- Running
- Map connections
- Regular height based collision
- Scripts on the following NPC
- The player can walk through the NPC
- Ledges
Whether the last point is working or not is debatable; the ledge jumping is really ugly, as the follower just kinda walks over it. I tried a number of things, and finally settled on this approach. The reason for this is because the regular "hop" animation takes twice as long as walking two steps takes, which means you'll always lose the follower if you hold down. To fix this, I just made the NPC walk 2 steps while you're jumping. This means you don't lose the follower, but if you take a break at the bottom of the ledge they will just sit on the ledge and it'll look weird.
Anyway, I'll be uploading a video shortly, showing all of what does and doesn't work.
EDIT: No video yet, because VBA hates me
Collision detect, which is the last big obstacle in the way of completing this, has been fixed :D
Last edited: