The Companion Levitation Problem

Post » Wed Aug 26, 2009 9:32 am

I'm just wondering if there have been any recent advances in companion scripting that make the issues with companion levitation a little more stable.

The biggest problem is still companion death while entering another cell while levitating, but I also noticed that they can also disappear forever.

I recently had an issue where I was levitating with one of my companions in tow, and used scripted teleportation to get to Balmora. Now she was set to teleport along with the player using an MWSE script that allows her to follow anywhere. I heard the mysticism hit, so her script executed, but she was nowhere to be seen. Calling her with the telepathy ring revealed her to be in the same cell in wall examining mode, but calling her to initiate her warp script did nothing. Sending her home did nothing. Using a manual positioncell in the console could not even bring her to me. She was gone for good.

Now, I usually know better than to levitate while teleporting with a companion, but it just sometimes happens when you forget to let it wear off before leaving an area. It doesn't always cause trouble, but is there anything that can be done to minimize the risk?
User avatar
BaNK.RoLL
 
Posts: 3451
Joined: Sun Nov 18, 2007 3:55 pm

Post » Wed Aug 26, 2009 2:31 am

All I can say is do the soul-trap glitch on your companion to give him or her a constant slow fall so they don't fall and die during cell transition it's what I do and I never have a problem but then again I never teleport anywhere using any mark and recall or interventions even when I am dungeon crawling I just carry around a whole bunch of Sujjama lol.
User avatar
{Richies Mommy}
 
Posts: 3398
Joined: Wed Jun 21, 2006 2:40 pm

Post » Tue Aug 25, 2009 10:11 pm

Well, there's another problem here, and that's the companions sometimes vanishing forever. I'm afraid that one really can't be solved in that manner. I need to find a way to make them stop levitating before entering a new cell, if that's at all possible.

As a side note, I also need to find a way to make them stop hopping (because their AI is messed, nothing to do with encumberance).
User avatar
lillian luna
 
Posts: 3432
Joined: Thu Aug 31, 2006 9:43 pm

Post » Tue Aug 25, 2009 10:08 pm

hmmm well is it an NPC that you can share inventory with if so make a constant effect levitation ring and give it to him or her then when ever you want to leave the cell take it away (after doing the soul-trap glitch for slow fall).
User avatar
Dina Boudreau
 
Posts: 3410
Joined: Thu Jan 04, 2007 10:59 pm

Post » Wed Aug 26, 2009 12:14 pm

No, constant effect items do not work properly for npcs, and should never be given to a companion. This is well documented on Emma's forum by many advanced companion modders. They are very well known to bug out. It's also way too much messing around every time you want to walk through a teleporting door. The proper way to add levitation to a companion is by making a check for the player levitating and adding a levitation ability to the companion via script. This is a complicated issue that years of companion scripters have tried to address in one way or another. What I'm looking for is a scripted way to remove the spell when the player is traveling or walking through a teleporting door.

There is also no reason to use a glitch to give the companion slowfall. It can be better done via script. However if you can script slowfall onto a companion when teleporting, then why not just stop them levitating while teleporting, since it would require the same kind of scripting. Slowfall also doesn't solve the vanishing companion problem, only the dead companion problem.
User avatar
patricia kris
 
Posts: 3348
Joined: Tue Feb 13, 2007 5:49 am

Post » Wed Aug 26, 2009 8:43 am

yes that is true.... hmm well I am no scripter whatsoever but is there a oncellload or oncelltransition function?
User avatar
dav
 
Posts: 3338
Joined: Mon Jul 30, 2007 3:46 pm

Post » Tue Aug 25, 2009 9:30 pm

The biggest problem is still companion death while entering another cell while levitating

I just do: "companion->setacrobatics 999".
User avatar
Ashley Hill
 
Posts: 3516
Joined: Tue Jul 04, 2006 5:27 am

Post » Tue Aug 25, 2009 8:47 pm

Setting it to 200 is sufficient. As for the cell change, I dunno. I guess you could check the distance from the player on a cell change & warp if necessary. BTW, what companion is it?
User avatar
El Khatiri
 
Posts: 3568
Joined: Sat Sep 01, 2007 2:43 am

Post » Tue Aug 25, 2009 11:49 pm

No, constant effect items do not work properly for npcs, and should never be given to a companion. This is well documented on Emma's forum by many advanced companion modders. They are very well known to bug out. It's also way too much messing around every time you want to walk through a teleporting door. The proper way to add levitation to a companion is by making a check for the player levitating and adding a levitation ability to the companion via script. This is a complicated issue that years of companion scripters have tried to address in one way or another. What I'm looking for is a scripted way to remove the spell when the player is traveling or walking through a teleporting door.

There is also no reason to use a glitch to give the companion slowfall. It can be better done via script. However if you can script slowfall onto a companion when teleporting, then why not just stop them levitating while teleporting, since it would require the same kind of scripting. Slowfall also doesn't solve the vanishing companion problem, only the dead companion problem.


The only way to test for moving to a new cell is getCellChanged which it triggered after the cell change. I suppose it could be possible to script every door but scripted doors are another buggy issue all together & that won't help at all with mark/recall/intervention/etc. Short answer is that it hasn't been done because it can't be done.
User avatar
jesse villaneda
 
Posts: 3359
Joined: Wed Aug 08, 2007 1:37 pm

Post » Wed Aug 26, 2009 8:10 am

Setting it to 200 is sufficient. As for the cell change, I dunno. I guess you could check the distance from the player on a cell change & warp if necessary. BTW, what companion is it?


I did set their acrobatics very high. I'm not sure I set it as high as 200 though. I'll have to check. In any case, I've not encountered the death problem in over a year of working on this mod, only the vanishing problem. This is for my three companions in UL, which has an added MWSE patch. This patch makes things like Improved Teleportation unnecessary for the companions because it's built right in. I believe this levitation vanishing bug is somehow related, because it's never been encountered in the regular mod as far as I know. Well, the companions have vanished, but using a manual positioncell in the console has always been able to bring them back. This permanent disappearance is something new.

I noticed that Melian uses GetPCTraveling, to initiate a teleport fix for Comes-by-Road instead of CellChanged. Since my mod requires all three expansions, adding this Bloodmoon only function would not be a problem. But the documentation in MWSE only states it's used for siltstrider travel and such. Does it work for teleporting doors as well? I'm really curious about this teleporting door fix, because I noticed my companions are not following me through doors properly when they bug out. Instead they're initiating the warp in their FollowPort scripts. Melian is using some kind of silent warp, which I assume is to solve this problem, but I'm still trying to figure it out.

I'm definitely not going to script all the doors in the game.

Edit: Another interesting development. I managed to replicate the companion vanishing bug by levitating while using scripted teleportation (Trunksbomb's modtesting mod). My companion vanished, but the MWSE FollowPort script is still running, and npcCell returns 0! My companion is literally nowhere! If she was anywhere it would be a nine digit cell ID number.
User avatar
courtnay
 
Posts: 3412
Joined: Sun Nov 05, 2006 8:49 pm

Post » Tue Aug 25, 2009 10:22 pm

I've never really experimented with companions, but you could use GetInterior and GetExterior to detect when the player moves from one to the other, and (if I understand the issue correctly), script the companion to teleport next to the player or something like that.
User avatar
djimi
 
Posts: 3519
Joined: Mon Oct 23, 2006 6:44 am

Post » Wed Aug 26, 2009 5:20 am

For the MWSE patch, the companion is already scripted to teleport to the player if they don't follow the player into the cell like they're supposed to. It detects the cell of the player and the cell of the companion, and if they don't match, the companion is teleported there if they're supposed to be following. The problem is, if it does this while they're levitating, they vanish forever, and no amount of scripting and consoling can seem to bring them back. I was going to try removing the levitation spell in their warp script before it teleports them, but one of my testers has reported that strange things happen using the non-MWSE version if you walk through a door while levitating as well. It's a case where the script wouldn't be executing, so it wouldn't solve that problem at all. I might be able to solve it in the MWSE version in the cell comparison block, but the non-MWSE version would not be able to be fixed that way. It's not even guaranteed to work, if the levitation spell effect is not removed until after the NPC is loaded in the cell.

Also, for the non-MWSE version, sometimes you're moving between one interior cell to another, in which case, using a getexterior/getinterior comparison wouldn't work. :/
User avatar
kelly thomson
 
Posts: 3380
Joined: Thu Jun 22, 2006 12:18 pm

Post » Wed Aug 26, 2009 5:38 am

You could always start a global script that checks to see where the NPC is in relation to the player & move them if necessary.
User avatar
~Sylvia~
 
Posts: 3474
Joined: Thu Dec 28, 2006 5:19 am

Post » Wed Aug 26, 2009 12:50 am

The FollowPort script is a global that does exactly that. The regular script can only do this in exteriors, but the MWSE script does this anywhere. I haven't had time to test if this script can remove the levitation effect before teleporting them, but it's the next step in my attempt to fix the problem, at least for the MWSE version. I'm still not sure how to fix levitation bugs in a non-MWSE script for regular following through doors, since I can't do a cell comparison check.

Edit, my levitation removal does not work, so that's out.

I'm going to try adding something like Melian's door fix warp script, since my single warp attached to the followport script does not work because it only executes once and doesn't continue to execute if the npc is not positioned properly.
User avatar
Far'ed K.G.h.m
 
Posts: 3464
Joined: Sat Jul 14, 2007 11:03 pm

Post » Wed Aug 26, 2009 12:48 am

It detects the cell of the player and the cell of the companion, and if they don't match, the companion is teleported there if they're supposed to be following.

What I meant to suggest was to try removing the levitation effect before the companion is teleported, but by the sounds of this:

if this script can remove the levitation effect before teleporting them


You've already tried it...

And you're right, there'd still be the issue of moving interior -> interior.
Still, it would be a start, and like you asked, could "minimize the risk".
User avatar
IsAiah AkA figgy
 
Posts: 3398
Joined: Tue Oct 09, 2007 7:43 am

Post » Wed Aug 26, 2009 7:07 am

I've been speaking with Melian via. PM and I'm starting to come up with a solution. I left the levitation removal so that the companion is not levitating while the warp script is executing, just as a safeguard. The warp script then has to position the NPC and will continue executing until they're properly in range, since the problem is mainly with the companion being stuck far underground. It then makes an AI check and warps them again and does an AI fix to get their AIPackage to reset properly. My tests are going well so far. I've only been working on the MWSE version at the moment, but Melian's CBR also has a non-MWSE solution that I'm going to try. It's similar, but can't use the MWSE cell comparison as a check. I'll work on figuring that out after I make sure the MWSE version is working 100%. The problem is far more dangerous with the MWSE version, because the companion can be warped under a greater range of circumstances, so I've been focusing on that version to test out the scripts before trying to do the same without the aid of MWSE.

The non-MWSE solution looks far more complicated, and seems to use a distance check instead of CellChanged. If it's < 99999 then the companion is in the same cell, and it executes a silent warp script, otherwise the companion is not in the same cell. If the player is in an interior cell and the companion doesn't follow, then the non-MWSE version can't teleport the companion there because it can't read the cell the player is currently in and set the companion to teleport there. However, most cases of disappearances are due to the companion being teleported to the wrong location of a cell if they are levitating while walking through a teleporting door, so the distance check should work.
User avatar
Joanne Crump
 
Posts: 3457
Joined: Sat Jul 22, 2006 9:44 am


Return to III - Morrowind