Here is the script I used to move the Jazz Bear along a line between 0 and 25. I then Rotated this group on the Z axis so that he is driving up a hill. The main workhorse is the lower third of the script. The rest is just positioning camera and the "Bear". This script assigns values to set the end keyframe.
dim bs as integer
dim bf as integer
dim cXf as integer
dim cYf as integer
dim sd as xpSceneDirector
dim obj as xpBaseObject
dim AC as xpAnimController
dim cam as xpCameraObject
if text = "0" then
bf = -833
cXf = 108
cYf = 22
else if text ="1"
bf = -782
cXf = 90
cYf = -54
else if text ="2"
bf = -740
cXf = 143
cYf = -29
else if text ="3"
bf = -702
cXf = 190
cYf = -7
else if text ="4"
bf = -656
cXf = 249
cYf = 18
else if text ="5"
bf = -615
cXf = 300
cYf = 47
else if text ="6"
bf = -577
cXf = 345
cYf = 67
else if text ="7"
bf = -536
cXf = 394
cYf = 93
else if text ="8"
bf = -491
cXf = 451
cYf = 117
else if text ="9"
bf = -451
cXf = 502
cYf = 142
else if text ="10"
bf = -407
cXf= 556
cYf= 147
else if text ="11"
bf = -368
cXf = 602
cYf = 190
else if text ="12"
bf = -325
cXf = 655
cYf = 213
else if text ="13"
bf = -286
cXf = 704
cYf = 233
else if text ="14"
bf = -242
cXf = 757
cYf = 258
else if text ="15"
bf = -203
cXf = 806
cYf = 281
else if text ="16"
bf = -161
cXf = 857
cYf = 306
else if text ="17"
bf = -119
cXf = 910
cYf = 331
else if text ="18"
bf = -76
cXf = 965
cYf = 354
else if text ="19"
bf = -37
cXf = 1014
cYf = 377
else if text ="20"
bf = 5
cXf = 1066
cYf = 402
else if text ="21"
bf = 47
cXf = 1117
cYf = 426
else if text ="22"
bf = 88
cXf = 1168
cYf = 450
else if text ="23"
bf = 130
cXf = 1220
cYf = 475
else if text ="24"
bf = 173
cXf = 1273
cYf = 499
else if text ="25"
bf = 214
cXf = 1325
cYf = 523
end if
if Scene.GetObjectByName("Bear",obj) then
Scene.GetAnimControllerByName("go bear", AC)
Scene.GetObjectByName("Camera",cam)
AC.clearKeyFrames
AC.SetKeyFrameValue(obj, 200, "Position.X", bf)
AC.SetKeyFrameValue(cam, 200, "Position.X", cXf)
AC.SetKeyFrameValue(cam, 200, "Position.Y", cYf)
Scene.GetSceneDirectorByName("set keys", sd)
end if
sd.play
------------------------------
Malcolm Thorpe
Free Lance Xpression Designer/Carbonite TD
------------------------------
Original Message:
Sent: 07-31-2022 21:00
From: Todd Wenger
Subject: Scripting help: Extract a value from a text field and apply it to an X or Y position of on screen object at a given keyframe position
I'm looking to do something similar with scripting keyframes but am at the limits of my knowledge. The download link from post 2 is not working for me. Is that example still available somewhere?
Original Message:
Sent: 06-19-2019 22:17
From: Malcolm Thorpe
Subject: Scripting help: Extract a value from a text field and apply it to an X or Y position of on screen object at a given keyframe position
Brian,
We have resurrected this project and I am moving along well. My next hurdle: I need to run the script AFTER the scene is already on line and paused. Can I move the scripting from a text object to an event on a scene director? I can only assume that I would then have to getObject by name and grab the text objects that hold the scripting now. #InOverMyHead
#XPression