Henchman Won't Transition
Zephirius
Member Posts: 419
I've got a hell hound henchman that doesn't follow me through open air transitions. Anyone know a bit of code that would remedy this?
Just checked with standard door transitions - mixed results with the hell hound "spawning" about 10 seconds after area transition click. Not good!
Just checked with standard door transitions - mixed results with the hell hound "spawning" about 10 seconds after area transition click. Not good!
Post edited by Zephirius on
0
Comments
For an instant fix, you can use the version of nw_g0_transition from my Travel Builder package on the Vault. You just need that one script.
This uses an iterative approach for each associate type. It works fine. A more elegant solution is to use GetFirst / NextPartyMember, which I leave as an excercise for the reader.
I made a script called "PetsJumpToo" which should do what you want.
Mine is iterative, so it handles associates of associates to any level of nesting.
Like I said, you can also do all associate types and follower nesting in one go, using GetFirst / NextPartyMember, which I would do if writing it today.
That's a good idea although for multi-player, you'd probably want to not automatically jump all party members but only the party member who entered the transition plus their summons, which is what my script was designed for.
I'm pretty sure that the description in the Lexicon is incorrect, in that FALSE returns both PCs and NPCs whereas TRUE returns only the PCs in the party.
Regardless, using FALSE would return ALL NPCs in the faction, and not only the NPCs who are "pets" of the PC making the jump, which means that in a multi-player module you'd be attempting to transition all summons from all players in the party to the destination, even if they happened to be in a different area or different room in the same area at the time. That's why my function only searches for pets belonging to the PC which the function has been given.
An alternative would be to use my GetTrueMaster() function to find the "owner" of the pet and only jump it to the new location if the master is the PC who jumped.
(If you attempt to get the "master" of a creature which has no master, GetMaster() will return the same creature)
The reason for this function existing is that in two cases, the GetMaster() function will not return the PC. The first case is where a summon in turn calls a second summon. In that case, the second summon's master is the first summon. The second case is where the module permits multiple summons of the same type. The second summon automatically becomes a summon of your first summon, and a third summon automatically becomes a summon of your second summon. This function will automatically go up through the chain of "masters" until it finds the ultimate master, regardless of whether that's a PC or a NPC.
Also as per the remarks on the GetMaster() funtion on the Lexicon: "This can be used in a loop to find the PC who ultimately controls the associate (for instance, if there are multiple henchmen, or if the henchman has summoned a creature)"
Doing it that way takes care of the nested associate-of-associate cases without any special code. For example, henchman horses, familiars, etc
While that looks right at first glance, at second glance it appears to me that it will skip all the summons of summons if this is an intra-area jump rather than an inter-area jump. This is because all of the summons of summons will not have a PC as their master and therefore they will be skipped. But I haven't tested it to be sure. Perhaps the auto-catchup code used for summons will kick in and send the summons of summons to the destination?
So the lexicon remarks about GetMaster() are not correct? It says that it should get summons and summons' summons.
If a PC has a henchman who has a summons, the summons is a member of the PC faction, but their master is the henchman, not the PC.
if you want this to be for a multiplayer module, the best way to do it is probably to either use GetFirst/NextFactionMember along with GetTrueMaster() to ensure that you only jump the pets belonging to the PC who made the transition, or use PetsJumpToo() so that all of the pets of the PC who made the transition get jumped.
Anything else in a multiplayer module is going to cause problems, I believe.
Z
This worked well for open-air transitions. The hell hound is now following me promptly through to the other side. I didn't realize there was an option in the script generator to send your associates when you jump.
Hence the iterative method in my nw_g0_transition, or the GetFirst/NextFactionMember method (for single-player, at least).