Companion frustration

Post » Tue May 17, 2011 3:51 am

My companion (mod) sometimes disappears in the transition from a cell to another cell. Usually it works fine for the majority of cells, but in certain cells it always happens. Strangely in some Vicec rooms. I use grumpy scripts.

:brokencomputer:
User avatar
Isaac Saetern
 
Posts: 3432
Joined: Mon Jun 25, 2007 6:46 pm

Post » Tue May 17, 2011 2:31 pm

Melian put this section into a companion script for me to reduce the lost problem - you could havea check through and see if there is something you could add to your companion script to help

;check for cell change - need to know if one or both; cells are interior. This triggers the door-fix wander;Problem is that on game load the x-pos is wrong value first time;  so also check for game load via startscriptset tmpS to 0set prevX to currXset currX to ( GetPos x )set tmpF to ( currX - prevX )if ( doorFix == -1 )  ;just warped, false alarm        set doorFix to 0elseif ( doorFix == 0 )        if ( followNow == 0 )        elseif ( mel_reload == 1 )  ;game load = false alarm        elseif ( tmpF > 512 )                set tmpS to 1        elseif ( tmpF < -512 )                set tmpS to 1        endifendifif ( tmpS >= 1 )        set oldCell to curCell        set curCell to ( GetInterior )        set swimChk to 0        if ( oldCell == 1 )  ;if a cell is interior, do the fix                set doorFix to 1        elseif ( curCell == 1 )                set doorFix to 1        elseif ( tmpS == 1 )  ;this will kick in with e.g. scripted teleports                set doorFix to 1        endifendifset pcDist to ( GetDistance player )set warpTmr to ( warpTmr + GetSecondsPassed )if ( wndrTmr < 500 )        set wndrTmr to ( wndrTmr - GetSecondsPassed )        set warpTmr to 0        if ( wndrTmr <= 0 )                set wndrTmr to 512                if ( followNow == 1 )                        AIFollow player 0 0 0 0                else                        AIWander 256 0 0 30 35 5 10 5 10 5 0 0  ;replace idles and distance with your defaults/whatever you want                endif        endifendifif ( doorFix > 0 )        if ( mel_reload != 0 )  ;if it got past the first check, catch it here                set wndrTmr to 0.1  ;this should hopefully put her back in follow mode                set doorFix to 0                return        elseif ( doorFix > 7 )                if ( wndrTmr > 500 )                        set doorFix to 0  ;all done                        return                endif        elseif ( doorFix == 4 )                if ( pcDist < 800 )  ;don't need to warp                        set doorFix to 6                elseif ( ScriptRunning illy_loaddoorfix == 0 )                        set doorFix to 5                        StartScript illy_loaddoorfix  ;warp companion back to player if she's got lost                endif        elseif ( doorFix == 5 )                if ( pcDist > 800 )  ;wait for script to do its job                        return                elseif ( ScriptRunning illy_loaddoorfix == 0 )                        set doorFix to 6                endif        elseif ( doorFix == 6 )                AIWander 512 0 0 0  ;this also helps get companion out of the post-door pile-up                set wndrTmr to 2                set doorFix to 7        else                set doorFix to ( doorFix + 1 )        endif        set warpTmr to 4        returnendif


Edit:

Game load detection (to stop companion wandering on game load as well). For this you need to add a global variable (called "mel_reload" here, you can use that or change it if you want). The variable should just have default settings (short, default 0).

begin mel_checkloadfloat timerif ( timer < 0.5 )        set timer to ( timer + GetSecondsPassed )        if ( mel_reload == 0 )                set mel_reload to 1        endifelse        set timer to 0        set mel_reload to 0        StopScript mel_checkloadendifend

User avatar
neil slattery
 
Posts: 3358
Joined: Wed May 16, 2007 4:57 am

Post » Tue May 17, 2011 1:11 pm

First, do you have Pursuit Enhanced? I know from first hand experience that this mod will make your companions disappear.
User avatar
Taylor Tifany
 
Posts: 3555
Joined: Sun Jun 25, 2006 7:22 am

Post » Mon May 16, 2011 11:19 pm

First, do you have Pursuit Enhanced?


No.



Melian put this section into a companion script for me to reduce the lost problem - you could havea check through and see if there is something you could add to your companion script to help


Just also I have a change cell fix added to the grumpy script.

Thanks, I'll give it a try. Can you put here the list of variables used in the script to put them into the header of the script, just after the begin clause?.
User avatar
Scott Clemmons
 
Posts: 3333
Joined: Sun Sep 16, 2007 5:35 pm

Post » Tue May 17, 2011 2:04 pm

I've had this happen in Vivec sometimes too. I remember losing Julan once when I left Jobasha's book store.
User avatar
Wayne Cole
 
Posts: 3369
Joined: Sat May 26, 2007 5:22 am

Post » Tue May 17, 2011 6:54 am

Do you have an active levitation effect when changing cells? This is a common problem with at least Julan. Not sure about other companions as I'm only using Julan.
User avatar
Dan Endacott
 
Posts: 3419
Joined: Fri Jul 06, 2007 9:12 am

Post » Tue May 17, 2011 2:18 am

Illuminel, it is necessary the "illy_loaddoorfix" script. Please, post it.

Game load detection (to stop companion wandering on game load as well). For this you need to add a global variable (called "mel_reload" here, you can use that or change it if you want). The variable should just have default settings (short, default 0).


Is this a startscript?
User avatar
Nathan Risch
 
Posts: 3313
Joined: Sun Aug 05, 2007 10:15 pm

Post » Mon May 16, 2011 11:46 pm

Illuminel, it is necessary the "illy_loaddoorfix" script. Please, post it.

Game load detection (to stop companion wandering on game load as well). For this you need to add a global variable (called "mel_reload" here, you can use that or change it if you want). The variable should just have default settings (short, default 0).


Is this a startscript?


No it wasn't a startscript - it was just a global

Here is the illy_loaddoorfix script

Load door fix/warp (this is called from the companion local script when you go through a loaddoor, use fast travel, teleport with the companion, etc)begin illy_loaddoorfix;quick warp, used for teleport door fix when companion ends up too far away (disappears);must be targeted script as local script setPos is not reliable here;this script can be used for other followers as well (but if there are many followers at;  once I'd have a few different scripts, since they'll have to wait til one's available)short statefloat timerfloat warpxfloat warpyfloat warpzif ( MenuMode == 1 )        returnelseif ( GetHealth < 1 )  ;mostly a check for script losing its target (GetHealth        set state to 0        ;   will return 0 if that happens)        set timer to 0        StopScript illy_loaddoorfix        returnelseif ( state == 0 )        if ( timer < 0.2 )                set timer to ( timer + GetSecondsPassed )                return        endif        set timer to 0        set warpx to ( player->GetPos x )        set warpy to ( player->GetPos y )        set warpz to ( player->GetPos z )        set state to 10elseif ( state == 10 )        SetPos x warpx        SetPos y warpy        SetPos z warpz        disable        enable        AIFollow player 0 0 0 0        set state to 20        returnelseif ( state == 20 )        if ( timer < 0.1 )                set timer to ( timer + GetSecondsPassed )                return        endif        set state to 0        set timer to 0        if ( ( GetDistance player ) > 2048 )  ;if still too far away, try again                if ( ( GetDistance player ) < 999999 )  ;but give up if actually in a different cell!                        return                endif        endif        StopScript illy_loaddoorfixendifend


What I recommend you do is download Melian's excellent http://planetelderscrolls.gamespy.com/View.php?view=Mods.Detail&id=113445&id=6969 companion mod - this was a much underrated companion mod that was designed to be used as a showcase of improving companion behaviour - a lot of the scripting is compiled on the fly in the results boxes of the dialogue however you can adapt the scripts very well for other characters - useful if you want a healer in your party or as a companion instead of the usual suicidal meat shield, excess luggage carriers.

What Melian was writing for me was a much lighter version of a companion - no leveling involved - for some of the character's in my Veloth's Child mod which is likely to be finished sometime before TES X :) I just thought the section I posted to begin with would be useful for you as it was something Melian had worked hard at ensuring the companion would not get lost
User avatar
lisa nuttall
 
Posts: 3277
Joined: Tue Jun 20, 2006 1:33 pm


Return to III - Morrowind