Hi!
I'm trying to build a chess evaluation bar that updates based on new values from a datalinq.
I have a script that works to set the right keyframes as the scene is taken online, but I'm at a loss for how to script live updates.
I tried to put it the script on the text object recieving the value at the OnSetText, but understand that that wil only run before the new value is set.
I have this script on the text object datalinqed to the desired end value:
dim arrow as xpBaseObject
dim ValueOld as xpTextObject
dim ValueNew as xpTextObject
dim MoveArrow as xpAnimController
Scene.GetObjectByName("White Bar M2", arrow)
Scene.GetObjectByName("M2VOld", ValueOld)
Scene.GetObjectByName("M2VNew", ValueNew)
Scene.GetAnimControllerByName("MoveBarM2", MoveArrow)
MoveArrow.SetKeyFrameValueTCB(arrow, 0,"Scale.X",(ValueOld.text),0.9,-15.0,-0.950)
MoveArrow.SetKeyFrameValueTCB(arrow, 23,"Scale.X",(ValueNew.text),0.9,-15.0,-0.950)
dim MoveBar as xpSceneDirector
Scene.GetSceneDirectorByName ("MoveBarM2", MoveBar)
MoveBar.Play
Where do I put the script to trigger the animation each time there is an new value from the datalinq? It pulls every 960 ms, so it shouldn't get a new value before the animation is done.
Maybe there is a much simpler way to do this?
Do I need to take the datalinqed values and put into another text object or could I just use the input texts as the values called upon by the script?
We have had a version where visual logic triggers the SceneDirector, but it would freeze after being on air for some time, so trying to both do a cleanup (there's a new design style) and simplify the scene. We will have a total of 3 bars on the same scene going simultaneously.
Is there a command to run the script when a new value is input?
I have attached a project with this scene, if anyone is able to give some insights I would be very grateful.
All the best!
Oda
------------------------------
Oda Skavlid
------------------------------