ds_priority_add

With this function you can add a value (either a real number or a string) to a priority queue, at the same time assigning it a priority value.

 

Syntax:

ds_priority_add(id, val, priority);

ArgumentTypeDescription
idDS PriorityThe id of the priority queue to add to.
valAnyThe value to add to the priority queue.
priorityRealThe priority of the value to add.

 

Returns:

N/A

 

Example:

ds_priority_add(ai_priority, AI_Search, 5);

The above code adds a script function to the priority queue indexed in the variable "ai_priority" and assigns it a priority of 5.