The coding was mostly done from scratch by triggerers/coders who weren't me. Because I do not do triggers or coding. Therefore, I have no clue! The campaign is single-player, but I'm pretty sure we made a trigger with a dozen variables and whatnot that basically make it so that when Player 1 selects a hero owned by Player 2 (heroes-that-aren't-in-your-party player slot), a dialog will appear asking if you would want to "Join their party" or whatever and then we'd move that hero's ownership to Player 3 (party-members-only player slot). It's complicated. Just look at the triggers yourself in the 1.5 version and you can get a better idea of how it works.