TranslateToRef and SplineTranslateToRef don't do rotation?

Post » Thu Jun 21, 2012 1:25 am

So, using the helpful page on the wiki here: http://www.creationkit.com/Complete_Example_Scripts#Making_a_Cool_Cut-Scene I'm trying to test out the two commands; http://www.creationkit.com/TranslateToRef_-_ObjectReferenceand http://www.creationkit.com/SplineTranslateToRef_-_ObjectReference as I'm making a trailer and using these would be perfect to get smooth camera movement and rotation. However I'm having some troubles.

First off, neither command seems to control the players rotation whatsoever. I've tried with looking enabled and disabled, and no matter what it only moves my position. It says on the wiki that it should control rotation. Am I messing something up, or is the wiki wrong?

I made a simple small cell to test this in. I have three triggers. One that simply tests a TranslateToRef from point A to B:
Spoiler
 [size="1"]Scriptname AlexTestScript1 extends ObjectReference [/size][size="1"]ObjectReference Property Point1 Auto[/size][size="1"]ObjectReference Property Point2 Auto[/size][size="1"]Event OnTriggerEnter(ObjectReference akActionRef)[/size][size="1"]If akActionRef == Game.GetPlayer()[/size][size="1"]Game.GetPlayer().SetAlpha(0)[/size][size="1"]Game.GetPlayer().SetGhost(True)[/size][size="1"]Game.DisablePlayerControls(True, True, True, False, True, False, True)[/size][size="1"]Utility.Wait(0.5)[/size][size="1"]Game.GetPlayer().TranslateToRef(Point1, 100)[/size][size="1"]Utility.Wait(3.0)[/size][size="1"]Game.GetPlayer().TranslateToRef(Point2, 100)[/size][size="1"]Utility.Wait(5.0)[/size][size="1"]Game.GetPlayer().SetAlpha(1)[/size][size="1"]Game.GetPlayer().SetGhost(False)[/size][size="1"]Game.EnablePlayerControls()[/size][size="1"]EndIf[/size][size="1"]EndEvent[/size]

One that tests a simple Spline move from point A to B:

Spoiler
 [size="1"]Scriptname AlexTestScript2 extends ObjectReference [/size][size="1"]ObjectReference Property Point1 Auto[/size][size="1"]ObjectReference Property Point2 Auto[/size][size="1"]Event OnTriggerEnter(ObjectReference akActionRef)[/size][size="1"]If akActionRef == Game.GetPlayer()[/size][size="1"]Game.GetPlayer().SetAlpha(0)[/size][size="1"]Game.GetPlayer().SetGhost(True)[/size][size="1"]Game.DisablePlayerControls(True, True, True, False, True, False, True)[/size][size="1"]Utility.Wait(0.5)[/size][size="1"]Game.GetPlayer().SplineTranslateToRef(Point1, 500, 100)[/size][size="1"]Utility.Wait(4.0)[/size][size="1"]Game.GetPlayer().SplineTranslateToRef(Point2, 500, 100)[/size][size="1"]Utility.Wait(4.0)[/size][size="1"]Game.GetPlayer().SetAlpha(1)[/size][size="1"]Game.GetPlayer().SetGhost(False)[/size][size="1"]Game.EnablePlayerControls()[/size][size="1"]EndIf[/size][size="1"]EndEvent[/size]

And one that tests are more complex Spline move from point A, to B, to C, to D. I wanted to see what would happen if you interrupted it and how the movement would behave:

Spoiler
 [size="1"]Scriptname AlexTestScript3 extends ObjectReference [/size][size="1"]ObjectReference Property Point1 Auto[/size][size="1"]ObjectReference Property Point2 Auto[/size][size="1"]ObjectReference Property Point3 Auto[/size][size="1"]ObjectReference Property Point4 Auto[/size][size="1"]Event OnTriggerEnter(ObjectReference akActionRef)[/size][size="1"]If akActionRef == Game.GetPlayer()[/size][size="1"]Game.GetPlayer().SetAlpha(0)[/size][size="1"]Game.GetPlayer().SetGhost(True)[/size][size="1"]Game.DisablePlayerControls(True, True, True, False, True, False, True)[/size][size="1"]Utility.Wait(0.5)[/size][size="1"]Game.GetPlayer().SplineTranslateToRef(Point1, 200, 100)[/size][size="1"]Utility.Wait(1.0)[/size][size="1"]Game.GetPlayer().SplineTranslateToRef(Point2, 200, 100)[/size][size="1"]Utility.Wait(3.0)[/size][size="1"]Game.GetPlayer().SplineTranslateToRef(Point3, 200, 100)[/size][size="1"]Utility.Wait(3.0)[/size][size="1"]Game.GetPlayer().SplineTranslateToRef(Point4, 200, 100)[/size][size="1"]Utility.Wait(4.0)[/size][size="1"]Game.GetPlayer().SetAlpha(1)[/size][size="1"]Game.GetPlayer().SetGhost(False)[/size][size="1"]Game.EnablePlayerControls()[/size][size="1"]EndIf[/size][size="1"]EndEvent[/size]

None of those control rotation. In addition, the movement seems odd at times. The player will stop moving and abruptly shift or continue moving in the same direction shortly. I can't tell if it's because I'm issuing another command so it pauses to calculate or something, or what's going on. Also, the splines seem very odd and I'm having trouble understand how those work and what values will work. Is a spline a single curved trajectory, or does it wave?

Someone please explain this to me. :P

Thanks,
Alexander J. Velicky
User avatar
Steven Hardman
 
Posts: 3323
Joined: Sun Jun 10, 2007 5:12 pm

Post » Thu Jun 21, 2012 1:19 pm

1. instead of calling the GetPlayer function so many times, you could actually just use akActionRef, since it has been established that it == GetPlayer() in the condition (runs faster as it simply refers to the already grabbed value, rather than grabbing a new value each time, which would just wastefully return the same thing anyway)

2. i am not entirely sure that rotation works on the player (i havent yet delved deep enough into translating the player), but it does certainly work on statics
User avatar
Tyrel
 
Posts: 3304
Joined: Tue Oct 30, 2007 4:52 am

Post » Thu Jun 21, 2012 8:24 am

Function TranslateToRef(ObjectReference arTarget, float afSpeed, float afMaxRotationSpeed = 0.0)

The player will try to match the rotation of arTarget. If you want to control rotation, then you should either use http://www.creationkit.com/SetAngle_-_ObjectReference on arTarget before using http://www.creationkit.com/TranslateToRef_-_ObjectReference, or else you should use http://www.creationkit.com/TranslateTo_-_ObjectReference.

http://www.gamesas.com/topic/1353350-quick-ck-questions-thread-2/page__view__findpost__p__20590683 is all I know about the spline translate functions.

EDIT: Also, the translate functions will only rotate about the Z axis when called on actors, not the X or Y axes.
User avatar
phillip crookes
 
Posts: 3420
Joined: Wed Jun 27, 2007 1:39 pm

Post » Thu Jun 21, 2012 3:27 pm

1. instead of calling the GetPlayer function so many times, you could actually just use akActionRef, since it has been established that it == GetPlayer() in the condition (runs faster as it simply refers to the already grabbed value, rather than grabbing a new value each time, which would just wastefully return the same thing anyway)

2. i am not entirely sure that rotation works on the player (i havent yet delved deep enough into translating the player), but it does certainly work on statics
Ooh, I'll change that.

And if it doesn't work on the player, then the person clearly did their research on the cutscene script... Unless it's not supposed to control the player. (As they do say to leave looking enabled...)
The player will try to match the rotation of arTarget. If you want to control rotation, then you should either use http://www.creationkit.com/SetAngle_-_ObjectReference on arTarget before using http://www.creationkit.com/TranslateToRef_-_ObjectReference, or else you should use http://www.creationkit.com/TranslateTo_-_ObjectReference.

http://www.gamesas.com/topic/1353350-quick-ck-questions-thread-2/page__view__findpost__p__20590683 is all I know about the spline translate functions.

EDIT: Also, the translate functions will only rotate about the Z axis when called on actors, not the X or Y axes.
arTarget is an XMarkerHeading, so it has a rotation. The player, therefor, should technically try to match it. But they don't at all... And yeah, I would have to manually control the X axis somehow... Crap, that would mean I'd be moving the camera anyway.

I may have to just move it myself and use the spline to get smooth movement; while angling manually... which will look real great on a mouse. -_-
User avatar
Javaun Thompson
 
Posts: 3397
Joined: Fri Sep 21, 2007 10:28 am

Post » Thu Jun 21, 2012 2:19 pm

I can confirm that Actors do not get rotated by Translate commands.
User avatar
vanuza
 
Posts: 3522
Joined: Fri Sep 22, 2006 11:14 pm

Post » Thu Jun 21, 2012 4:16 am

I can confirm that Actors do not get rotated by Translate commands.
Crap. Okay, is there any other way to rotate the camera? Other than SetAngle() since that would require far more calibration that necessary.

Looks like I'll be borrowing a friends 360 controller... I just seriously doubt my abilities to make mouse panning look good. :P
User avatar
Invasion's
 
Posts: 3546
Joined: Fri Aug 18, 2006 6:09 pm

Post » Wed Jun 20, 2012 11:13 pm

I can confirm that Actors do not get rotated by Translate commands.

Looks like I was wrong when I said that the player will try to match the rotation. The player never rotates from the translate functions, but other actors do.

The following script would be attached to a target actor spell which causes the target to glide forward 256 units and turn 180 degrees.

Scriptname Example extends ActiveMagicEffectEvent OnEffectStart(Actor akTarget, Actor akCaster)    float Distance = 256.0    float AngleZ = akTarget.GetAngleZ()    float PosX = (Distance * Math.Sin(AngleZ)) + akTarget.X    float PosY = (Distance * Math.Cos(AngleZ)) + akTarget.Y    akTarget.TranslateTo(PosX, PosY, akTarget.Z, 0, 0, AngleZ - 180.0, Distance)EndEvent
User avatar
Jamie Lee
 
Posts: 3415
Joined: Sun Jun 17, 2007 9:15 am

Post » Thu Jun 21, 2012 8:30 am

but other actors do.

I tried with two other actors, they did not rotate either.
User avatar
Nathan Risch
 
Posts: 3313
Joined: Sun Aug 05, 2007 10:15 pm

Post » Thu Jun 21, 2012 12:34 am

I don't know why then, but it works for me.
User avatar
Emma-Jane Merrin
 
Posts: 3477
Joined: Fri Aug 08, 2008 1:52 am

Post » Thu Jun 21, 2012 5:48 am

have you tried this:
http://www.creationkit.com/SetLookAt_-_Actor

i dunno if it will work but maybe its worth a shot
User avatar
Talitha Kukk
 
Posts: 3477
Joined: Sun Oct 08, 2006 1:14 am

Post » Thu Jun 21, 2012 9:00 am

have you tried this:
http://www.creationkit.com/SetLookAt_-_Actor

i dunno if it will work but maybe its worth a shot
Hmmm, I haven't tried that, but I doubt it would work. Not only can the player's head (As far as I know) not turn independantly of your facing, but I would assume it would do nothing to the player just like the translates. Also, if it did somehow work, it would be instant or near instant... Good suggestion though. Maybe there's something around I could use. I'll keep looking.
User avatar
Hairul Hafis
 
Posts: 3516
Joined: Mon Oct 29, 2007 12:22 am

Post » Thu Jun 21, 2012 7:11 am

have you tried this:
http://www.creationkit.com/SetLookAt_-_Actor

i dunno if it will work but maybe its worth a shot
This actually comes in very handy for the other half of what I'm filming, so thanks for posting that. :D
User avatar
JeSsy ArEllano
 
Posts: 3369
Joined: Fri Oct 20, 2006 10:51 am

Post » Thu Jun 21, 2012 2:21 am

oooooooowwww... this will be good for my 1st person view of being swatted into the air from the attack of a giant (feature). Where were you when I was asking for camera controls for the past few days? :tongue:
User avatar
Tessa Mullins
 
Posts: 3354
Joined: Mon Oct 22, 2007 5:17 am


Return to V - Skyrim