The Elder Scrolls Forums

TES Construction Set and Plugins >> General TES Construction Set

Pages: 1
Archived User Account

Flying companions...script help
      #2961668 - 08/23/04 12:39 PM

Hi scripting gurus!

I'm having a problem with my companions who fly (pixies) as a racial ability. Is there a way to get them to stay on the same level when we're just walking? Right now, when I walk down a hill, they just keep walking on the same level so they end up above me, but not far enough above me that the teleporting part of the companion script kicks in.

I don't want to remove their flying abilities because later in the TC the player will be able to levitate a lot, and I want the player to be able to keep the companions if they choose to.

I also don't want to set the teleport distance so ridiculously low that my companions will constantly be teleporting to me.

Is there a way to make them fly only when the player is levitating?

Here's the script I've been using...I'd like to improve it anyway because it's old and I didn't write it , so any suggestions would be helpful.

Code:
 Begin 0buddyScript
short companion
short Nolore
short float
float myx
float myy
float myz
float timer
AddTopic "Join My Big Adventure!"
;addspell 0buddylevitate

if ( GetCurrentAiPackage == 3 )
if ( GetWeaponDrawn )
elseif ( GetSpellReadied )
return
elseif ( GetDistance Player > 999 )
set timer to timer + GetSecondsPassed
if ( timer > 9 )
set timer to 0
set myx to ( Player->GetPos x )
set myy to ( Player->GetPos y )
set myz to ( Player->GetPos z )
SetPos x myx
SetPos y myy
SetPos z myz
endif
endif
endif


if ( GetCurrentAiPackage == 3 )
if ( Player->GetEffect, sEffectLevitate == 1 )
if ( GetEffect, sEffectLevitate == 0 )
Cast 0buddylevitate player
endif
if ( GetEffect, sEffectLevitate == 1 )
set myz to ( Player->GetPos z )
SetPos z myz
endif
endif
endif
endif

END



Post Extras: Print Post   Remind Me!   Notify Moderator  
Grumpy
Disciple

Reged: 08/02/02
Posts: 1590
Re: Flying companions...script help [Re: ]
      #2962237 - 08/23/04 04:23 PM

You'll have to play with the numbers, and all this does is keep them at a specified height:

(new short variable)

float play_z (represents the player's z axis height)

(In you're "GetCurrentAiPackage == 3" area:)

set play_z to ( ( Player->GetPos z ) + 60 )
SetPos z play_z

This needs to run every frame. 60 is the number you'll have to play with. If I'm not mistaken, the player's z axxis height is taken from a point near the feet, so you need to add to that to keep your fairy somewhere around the player's head (or lower). I did this once, and you may need to set them lower than you want to, cause if you don't, they'll get hung up going up stairs, etc..

--------------------
Grumpy
My mods

Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1


Extra information
0 registered and 2 anonymous users are browsing this forum.

Moderator:  Umrahel, Freddo, Pete, Hungry Donner, Attrebus, Miltiades, tegger 

Print Thread

Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Thread views: 55

Rate this thread
 
Jump to

The Elder Scrolls Homepage

*
UBB.threads™ 6.3

Click for Privacy Statement 2003 Bethesda Softworks LLC, a ZeniMax Media company. All Rights Reserved.
PRIVACY POLICY | TERMS & CONDITIONS | LEGAL INFORMATION | CONTACT US