Can you script movement?

Post » Tue Jun 19, 2012 5:30 pm

Such as a spell that has a script that launches the player in the air?
User avatar
meg knight
 
Posts: 3463
Joined: Wed Nov 29, 2006 4:20 am

Post » Tue Jun 19, 2012 10:30 am

Yes, you can check critter.psc and critterbird.psc. But basically I think you need these functions:

http://www.creationkit.com/SetMotionType_-_ObjectReference if you want to disable Havok so they do not fall

http://www.creationkit.com/TranslateTo_-_ObjectReference and the other versions in the See Also part of the page.
User avatar
Emily Graham
 
Posts: 3447
Joined: Sat Jul 22, 2006 11:34 am

Post » Tue Jun 19, 2012 5:02 pm

Ah I see but in the example of the script it refers to a bird. How do I teach the script to get the player?
User avatar
Vicki Gunn
 
Posts: 3397
Joined: Thu Nov 23, 2006 9:59 am

Post » Tue Jun 19, 2012 7:51 am

I have reread your post. If you just want to launch the player in the air, you can use ApplyHavokImpulse or PushActorAway.

If you want script movement, you can use the functions I said before as in this:
Spoiler
scriptName ShanaMovesUpEffectScript extends ActiveMagicEffect{Scripted magic effect blablabla.};====;  VARIABLES   /=============/objectReference CastFromHereReffloat Xfloat Yfloat Zfloat height = 600.0;===============   EVENTS	 /=============/Event OnEffectStart(Actor Target, Actor Caster)  Debug.Trace(" OnEffectStart ")  CastFromHereRef = Target as ObjectReference  CastFromHereRef.setMotionType( CastFromHereRef.Motion_Keyframed )  X = CastFromHereRef.X  Y = CastFromHereRef.Y  Z = CastFromHereRef.Z  CastFromHereRef.SplineTranslateTo(X, Y, Z + height, CastFromHereRef.GetAngleX(), CastFromHereRef.GetAngleY(), CastFromHereRef.GetAngleZ(), 300, 200)EndEventEvent OnEffectFinish(Actor Target, Actor Caster)  Debug.Trace(" OnEffectFinish")  CastFromHereRef.setMotionType( CastFromHereRef.Motion_Dynamic )EndEvent

When using TranslateTo instead of SplineTranslateTo, I tend to get stuck in the midair...
User avatar
Eric Hayes
 
Posts: 3392
Joined: Mon Oct 29, 2007 1:57 am


Return to V - Skyrim