Graphics

 View Only
  • 1.  name and weight together.

    Posted 02-03-2014 19:44
    I, I want to do a program similar to "dance your fat off", so I can input player names and weights and the system will sort it out for me.. the problem is, I seem unable to link the name to the weight (the weight gets sorted, but not the names).

    example: I have

    tom = 100

    david = 20

    alfred = 75

    and I want the result to show

    tom 100

    alfred 75

    david 20

    _________________________________

    Dim A() as double = {p(1),p(2),p(3),p(4),p(5),p(6)}

    Array.Sort(A)

    r(1).text = A(A.Length - 1)

    r(2).text = A(A.Length - 2)

    r(3).text = A(A.Length - 3)

    r(4).text = A(A.Length - 4)

    r(5).text = A(A.Length - 5)

    r(6).text = A(A.Length - 6)

    __________________________

    I can do that to sort the numbers, but cant seem to find a proper way to link the names to the values of the weights.


  • 2.  RE: name and weight together.

    Posted 02-03-2014 20:24
    Hi Luis,

    Here is an example I made a long time ago that has a scoreboard (linked to a datalinq file). When the file is updated and the scene is placed on air (from the sequencer), it will automatically sort and dynamically create keyframes to move the names into the newly sorted order. The scene will remain paused, so you can edit the file and resume the pause to see the names resort again.

    https://na11.springcm.com/atlas/Link/Document/12442/9dafe6f2-2704-e311-a16d-d89d67143433/ce5b52d8-108d-e311-9b94-d89d67143430

    Brian

    #XPression


  • 3.  RE: name and weight together.

    Posted 02-11-2014 16:56
    thank you brian, I check your script but I dont have the knowledge yet to understand it. I have to learn more about VB, lucky for me I could do the animation: I will paste my script (I ended doing it the way I can):

    On Render:

    dim total(12), r(12), cr(12), jr(12), gr(12) as xpTextObject

    dim i, j as integer

    For i = 1 to 12

    Self.GetObjectByName("total" & i, total(i))

    Self.GetObjectByName("result" & i, r(i))

    Self.GetObjectByName("concursante" & i, cr(i))

    Self.GetObjectByName("jurado" & i, jr(i))

    Self.GetObjectByName("grasa" & i, gr(i))

    Next i

    i = 1

    Do while i
    #XPression