Search the Community
Showing results for tags 'queue'.
Found 2 results
-
OO_QUEUE - PRIORITY QUEUE Lastest version: 0.3 by Code34 Download from : DropBox Like to Donate ? Donate with paypal Github: https://github.com/code34/oo_queue.vr Reference: http://forums.bistudio.com/showthread.php?167980-Object-Oriented-SQF-Scripting-and-Compiling Description In computer science, a priority queue is an abstract data type which is like a regular queue or stack data structure, but where additionally each element has a "priority" associated with it. In a priority queue, an element with high priority is served before an element with low priority. If two elements have the same priority, they are served according to their order in the queue (source: wikipedia) Features Add element in a priority queue according a priority Get the first element in the queue according its priority Applications Bandwidth management Discrete event simulation Dijkstra's algorithm Huffman coding Best-first search algorithms ROAM triangulation algorithm Prim's algorithm for minimum spanning tree Licence Under Gpl, you can share, modify, distribute this script but don't remove the licence and the name of the original author Example Documentation Readme
-
This is going to be one odd request... Here's the situation - I want a line of units to form a queue. The idea is that every 10 seconds the unit at the front of the line moves to the back, and the unit behind him moves forward to take his place. The units are forming the line, and the player is supposed to wait in the line for the scenario. Here's the script I have so far: queue.sqf private ["_front","_back"]; _front = _this select 0; _back = _this select 1; while {true} do{ sleep 10; _back doMove (_front modelToWorld [0,-0.3,0]); }; _front refers to the unit in front of the _back unit in the line. Each unit in the queue executes this script with nul = [civ_1, civ_2] execVM "scripts\queue.sqf"; depending on who is in front of them. The problem with this script is that the units can only form a straight line (not such an issue), but when the unit at the front of the line moves to the back, the unit behind them doesn't move to the front of the line. In essence, the 2nd in line doesn't move and the queue slowly shifts backwards. Any pointers or obvious mistakes I've made? Thanks everyone!