Post by Spirithawke on Dec 12, 2012 9:16:33 GMT
I have no idea where this should really be posted, and sadly I am not even sure if anyone still does anything with Morrowind here as the Morrowind section seems to have not been used in a long time and I recently started playing again. Anyways, I had my own wolf and other companions many years ago when I last played, sadly that computer is broken currently, so I went around looking for a mod I could just download and use which led me here to Emma & Grumpy's stuff (both names I remember vaguely from way back when) So I downloaded various companions to play around with. I noted the wolf never moves out of your way if he is say blocking a doorway. I went and looked at the script from him as I used to do my own scripting back then too and saw he did not have the bump code, so I added it. Back in game I ran across the same problem my old animal companions had, the fact that the default movement of them is flaky unless the ground is perfectly level (often still flaky even then). Being older and wiser now, I came up with a solution that so far seems to work. Have the script make him basically jump straight up for a distance of 150 so you can walk under him after it puts him into wander mode. As he wanders he goes back down to the ground and re-enters follow mode like he should. Here is a copy of how I changed his script:
Hopefully someone finds this useful.
Cheers
Spirithawke
Begin 1A_Spotscript2
; the script is based on Grumpy's work and includes parts of the scripting from Wolf Companion ver 2.1, Constance and Beryl. CdCooley and Peter have helped me
; - Emma - to optimize it for creature companions.
; I have done some more optimizing of the script, also added in code for him to move out the way if the PC is too close and to levitate with the player. - Spirithawke
short p_speed
short p_health
short p_strength
short p_agility
short p_endurance
short stayoutside
short talkie
short warp
short doOnce1
short doOnce2
short fcounter
short p_level
short no_warp_check
short flycheck ;Spirithawke change
short movecheck ;Spirithawke change
short noGreet ;Sprithawke change
float timer
float movex ;Sprithawke change
float movey ;Sprithawke change
float movez ;Sprithawke change
float px
float py
float ax
float ay
float az
float bx
float by
float bz
float t1
float t2
float t3
float t4
float coDist1
float coDist2
if ( MenuMode == 1 )
if ( GetPCSleep == 0 )
return
endif
endif
;Begin Spirithawke change
if ( fcounter < 20 )
set fcounter to ( fcounter + 1 )
return
endif
set fcounter to 0
;End Spirithawke change
if ( talkie < 2 )
AddTopic "-Follow..."
AddTopic "-Health..."
AddTopic "-Tricks..."
AddTopic "-Stay outside..."
AddTopic "-my wolf companion"
AddTopic "-Combat..."
set p_level to ( Player->GetLevel )
set p_health to ( 10 * p_level + 50 )
set p_strength to ( 2 * p_level + 50 )
sethealth p_health
setstrength p_strength
set talkie to 2
return
endif
;Begin Spirithawke change
if ( movecheck == 1 )
if ( GetDistance Player > 160 )
set noGreet to 0
AIFollow Player 0 0 0 0
set movecheck to 0
return
endif
endif
;End Spirithawke change
if ( GetCurrentAIPackage == 3 )
;Begin Spirithawke change
if ( GetDistance Player < 132 ) ;had to be more than standard 80 to work correctly
set movex to ( 1A_comp_wolfSpot->GetPos x )
set movey to ( 1A_comp_wolfSpot->GetPos y )
set movez to ( ( 1A_comp_wolfSpot->GetPos z ) + 150 )
set noGreet to 1
AIWander 300 0 0 0 0
SetPos X, movex
SetPos Y, movey
SetPos Z, movez
set movecheck to 1
endif
if ( GetPCSleep == 1 )
set p_level to ( Player->GetLevel )
set p_health to ( 10 * p_level + 50 )
set p_strength to ( 2 * p_level + 50 )
if ( p_strength > 100 )
set p_strength to 100
endif
SetHealth p_health
SetStrength p_strength
return
endif
if ( Player->GetEffect sEffectLevitate == 1 )
if ( flyCheck == 0 )
cast 1a_comp_wolf_lev_bogus player
addspell 1a_comp_wolf_lev
set flyCheck to 1
endif
elseif ( Player->GetEffect sEffectLevitate == 0 )
if ( flyCheck == 1 )
removespell 1a_comp_wolf_lev
set flyCheck to 0
endif
endif
;old code before change
;wait in place when player levitates
; if ( Player->GetEffect sEffectLevitate == 1 )
; AiWander 0 0 0 0
; set spot_flw to 0
; return ; So the following If won't hit
;endif
;End Spirithawke change
; Was not following before?
if ( spot_flw == 0 )
set spot_flw to 1
set p_speed to ( ( Player->GetSpeed ) + 70 )
set p_level to ( Player->GetLevel )
set p_endurance to ( 2 * p_level + 45 )
set p_agility to ( 1.5 * p_level + 45 )
if ( p_endurance > 100 )
set p_endurance to 100
endif
if ( p_agility > 100 )
set p_agility to 100
endif
SetSpeed p_speed
setEndurance p_Endurance
setAgility p_agility
return
endif
; No warp in combat
if ( no_warp_check > 0 )
if ( Player->GetSpellReadied )
return
endif
if ( Player->GetWeaponDrawn )
return
endif
endif
set px to ( Player->GetPos x )
set py to ( Player->GetPos y )
if ( doOnce1 == 0 )
set ax to ( Player->GetPos x )
set ay to ( Player->GetPos y )
set az to ( Player->GetPos z )
set doOnce1 to 1
endif
set t1 to ( px - ax )
set t1 to ( t1 * t1 )
set t2 to ( py - ay )
set t2 to ( t2 * t2 )
set t1 to ( t1 + t2 )
set coDist1 to ( GetSquareRoot, t1 )
if ( coDist1 > 360 )
set doOnce1 to 0
endif
if ( coDist1 > 180 )
if ( doOnce2 == 0 )
set bx to ( Player->GetPos x )
set by to ( Player->GetPos y )
set bz to ( Player->GetPos z )
set doOnce2 to 1
endif
endif
set t3 to ( px - bx )
set t3 to ( t3 * t3 )
set t4 to ( py - by )
set t4 to ( t4 * t4 )
set t3 to ( t3 + t4 )
set coDist2 to ( GetSquareRoot, t3 )
if ( coDist2 > 360 )
set doOnce2 to 0
endif
;OLD CODE before Ultimate Galleon fix
; if ( warp == 0 )
; if ( coDist1 > 300 )
; if ( GetDistance Player > 680 )
; SetPos x ax
; SetPos y ay
; SetPos z az
; AiFollow Player 0 0 0 0
; elseif ( warp == 0 )
; if ( coDist2 > 300 )
; if ( GetDistance Player > 680 )
; SetPos x bx
; SetPos y by
; SetPos z bz
; AiFollow Player 0 0 0 0
; endif
; endif
; endif
; endif
; endif
; New warp, compatible with the Ultimate Galleon door
if ( warp == 0 )
if ( GetDistance player > 680 )
if ( coDist1 > 300 )
if ( coDist1 < 680 ) ; this prevents the "warping back" effect
SetPos X, ax
SetPos Y, ay
SetPos Z, az
AiFollow player 0 0 0 0
endif
elseif ( coDist2 > 300 )
if ( coDist2 < 680 ) ; this prevents the "warping back" effect
SetPos X, bx
SetPos Y, by
SetPos Z, bz
AiFollow player 0 0 0 0
endif
endif
endif
endif
else ; AIPackage != 3
if ( movecheck == 0 ) ;no changing his speed while moving out of the way as he will be following once again - Spirithawke
if ( Spot_flw > 0 )
SetSpeed 30
set Spot_flw to 0
endif
endif
endif
end
Hopefully someone finds this useful.
Cheers
Spirithawke