ds_priority_find_max


Description

With this function you can find the value stored in the priority queue with the highest priority, and if more than one value has the same priority then any one of them could be returned in any order. However, unlike ds_priority_delete_max, this function will not remove the value from the queue.


Syntax:

ds_priority_find_max(id);

Argument Description
id The id of the priority queue to use.


Returns:

Real or String


Example:

if ai_move
    {
    script_execute(ds_priority_find_max(ai_priority);
    }

The above code checks an instance variable and if it returns true it will execute a script indexed in the priority queue with the highest priority value.