def get_index(nodes, name):
    """
    Gets the index of the character based on name
    :param nodes: List of all character nodes
    :param name: Character name to get the index of
    :return: (int) index of the character name in nodes
    """
    index = 0
    for node in nodes:
        if node['name'] == name:
            return index
        index += 1
    return index