But... but... what if the player orders "spread out" or "close ranks?"Dain Ironfoot said:So if I replace :distance with an integer that is a little more or less than half the distance between troops, that would have the desired effect?
Actually, when I wrote about that script, I thought it would be easy enough to put in script_battlegroup_get_data, adding slots for distance to scripted destination and averaging for each division as a whole. Then you'd simply pull that slot, see if it were under, say, minimum_distance_between_troops, then set the front rank. Or pull the corresponding slot for each agent in the front rank and do the same on an agent basis. It's a great idea!Dain Ironfoot said:Actually, this is a problem I haven't solved. The AI makes similar decisions based on the average position of the troops -- not terribly ideal. I suppose you could write a script that would loop through all agents, pick the ones in the formation, and compare position with scripted destination, then make some judgments about how many are how close...
Eep. Sounds tricky. What I'm trying to do is fire off a script which causes the front rank to brace spears, easy enough to do.. except they become immobile, which can result in the first rank getting left behind. And I guess I'd need a stand up script for every movment etc. Flibbertigibbet.
Maybe I can take a break from BW after the weekend to set you up.