The problem there is that doing that requires built-in pathfinding, something I'm not too keen on building into the engine. I don't think that's really the function's intended purpose anyway--it's just a minimal implementation you can use to make your party members follow each other around. Anything more advanced is left up to the game developer to do in script.
TL;DR incoming: See, I've learned something while working on this project, it's the thing that makes Sphere such an awesome engine: It provides a lot of built-in functionality, which allows you to get a game up and running very quickly, but it's also quite deliberately designed to get out of the way when you decide you want to step outside of its provided parameters. You generally don't appreciate this as someone on the outside looking in developing a game, but seeing the finer points of how the engine does things under the hood, I've started to appreciate the little subtleties.
A great example: I had to fix edge script triggering not once, but
twice because of this. When I first implemented edge scripts, a cursory glance at the reference implementation (i.e. Sphere) yielded this code:
if (input_valid)
{
if (!UpdateEdgeScripts())
return false;
}
I naturally interpreted this to mean that edge script activation requires a valid input attachment (AttachInput). I later found out this wasn't the case when the Trial and Error intro turned out to be broken in minisphere, and, after another quick look--this time at the UpdateEdgeScripts() function--changed it to require an active
camera attachment instead. This fixed T&E, but was still incorrect, which I didn't find out until Radnen sent me his Blockman game and I couldn't move between maps. The game manages the camera itself in script, so there's no AttachCamera() calls to be found. In other words, the edge script activation logic only cares about where the camera actually *is*, not who's holding it. Realizing this was an epiphany: I suddenly understood that the engine was
deliberately designed this way so that you could replace AttachCamera() with your own implementation if you wanted to, and that doing so wouldn't break other things that you might not necessarily want to replace.
Sphere doesn't look like much, but it's actually a pretty well-engineered little engine.
As for that
input_valid variable? Turns out what it actually means is whether the map engine is currently accepting input at all (i.e. are we inside the main MapEngine() loop), regardless of whether there's a current input attachment or not. Poor choice of naming, which I of course rectified in minisphere (it's called
is_main_loop there
).