#Getting a value from nested array

1 messages · Page 1 of 1 (latest)

honest light
#

I am attempting to create a function that sets up the initial turn order in my turn-based combat scene. I started with an Array, then realized that I needed something more due to some characters having the same speed value. Each array within the array contains a texture, and an int value.

    var speed_list: Array = []
    if encounter_type == 1:
        speed_list = [
            [%FelixFrame.texture, %PartyFrames.felix_current_speed],
            [%AmeliaFrame.texture, %PartyFrames.amelia_current_speed],
            [%RowanFrame.texture, %PartyFrames.rowan_current_speed],
            [%AngelFrame.texture, %PartyFrames.angel_current_speed],
            [%EnemyLarge.texture_normal, %EnemyLarge.speed]
            ]
        speed_list.sort_custom(func(a, b): return a[1] > b[1])
        print(speed_list[0])```

Print output: ``[<CompressedTexture2D#-9223371980063898109>, 30]``

I need to be able to get the first value in the print output, so that I can assign that value somewhere else. How would I do that?
worldly palm
#

var texture = speed_list[0][0]

honest light
#

It can't be that easy... trying it now

#

Welp

honest light