Queueing
Jul 25 2008, 3:02 am
By: Vrael  

Jul 25 2008, 3:02 am Vrael Post #1



I have a situation in my map as such: you go to a location, and a cutscene starts. Blah blah blah, then you're supposed to get an item. Now, after you "get" the item, there's an immediate fight with the guy you stole it from, as part of the cutscene. Now, my problem is, I only want 1 player to get it, the player that got there first, BUT, if he dies in the batte, I want the player who got there second to get it, then if he dies, the third, and if the third dies, then the fourth and last possible person to get it. In a sense, I need to "queue" the order the players got there in. I am going to try to figure this out myself, but I would like to hear any efficient and well know methods you guys already have. If possible, keep the death counts and switches to a minimum. Not because I don't know how to use them, but because I'm trying to conserve as many death counts and switches as I can. This is for my tenebrous rpg if any of you care to look up my old forum in map production.



None.

Jul 25 2008, 4:15 am MillenniumArmy Post #2



Pick some random corner of the map. Make a 8x1 terrain line with three locations. One on each (locations A and B respectively) end and one covering the whole 8x1 terrain slit (location C).

Then, simply make your trigger something like:

Conditions:
- Current player brings unit to "item location" or w/e
- All players bring 0 men to Location A.
Actions:
- Move your unit to Location A.
- w/e else you wanted
- preserve trigger

Condition:
Always
Action:
Issue order to all men at Location C, move to Location B
preserve trigger

Conditions:
- Current player brings at least 1 men to Location B
- Entire team brings 0 men to the fight scene
- w/e else is necessary to detect this fight scene
Actions:
- Move men for current player at Location B to fight scene
- preserve trigger


Something like that. But basically, what it does is it forms a queue. When a player brings his or her unit to that item location, it'll move his unit off to some queue area. The queue area will auto-move your guys so that they will be lined up and be in order. And so when the person who is fighting dies, the triggers will move the next unit to the fight arena.
Now I'm not exactly sure what else happens in this map, but instead of moving your current unit to that queue area, you could just simply create a unit, like a zergling or w/e instead (and make the necessary conditions and actions to accommodate that).



None.

Jul 25 2008, 6:12 am Falkoner Post #3



It's funny, but yeah, that's about as good as it gets, in one of my maps I used a system that used death counts though, and it worked pretty well, basically, what would happen is I had a death count that started at 1, and when a player died, I would transfer whatever number was currently at the death count, using a mini binary count-off, into the deaths of that player, and then add one into the original death count, then when all the players were dead, they had all been assigned one the numbers, and I could do my triggers based off of that.



None.

Jul 25 2008, 7:35 pm Vrael Post #4



Thanks guys, but neither of those will work. Milleniums won't work because it's the item-giving that I need to queue, not entrance into the battle, and because I may need to queue more than one item at a time in this map, so multiple units in the queuing area would screw things up, and Falkoner, yours won't work because my units aren't necessarily dying. In my original post, I may have expressed myself incorrectly, it's not that I don't want death counts or switches to be used, in fact it's better that way becasue it doesn't require locations and can all be done behind-the-scenes without the players knowledge, I was just hoping for a way with the minimum possible death counters/switches used.



None.

Jul 25 2008, 7:39 pm Demented Shaman Post #5



Quote from Vrael
In a sense, I need to "queue" the order the players got there in.

Quote from Vrael
Milleniums won't work because it's the item-giving that I need to queue, not entrance into the battle.
I don't understand. It seems like you're contradicting yourself.



None.

Jul 25 2008, 8:00 pm Falkoner Post #6



Quote
Thanks guys, but neither of those will work. Milleniums won't work because it's the item-giving that I need to queue, not entrance into the battle, and because I may need to queue more than one item at a time in this map, so multiple units in the queuing area would screw things up, and Falkoner, yours won't work because my units aren't necessarily dying. In my original post, I may have expressed myself incorrectly, it's not that I don't want death counts or switches to be used, in fact it's better that way becasue it doesn't require locations and can all be done behind-the-scenes without the players knowledge, I was just hoping for a way with the minimum possible death counters/switches used.

Killing was just the example, you can use it for just about anything else, each player could be a different item.



None.

Jul 25 2008, 9:52 pm Vrael Post #7



Quote from name:devilesk
Quote from Vrael
In a sense, I need to "queue" the order the players got there in.
Quote from Vrael
Milleniums won't work because it's the item-giving that I need to queue, not entrance into the battle.
I don't understand. It seems like you're contradicting yourself.

The way millenium described, would be queuing the players, yes, but after they're queued they are moved into the battle in his way. I don't need to queue them into battle because they can all fight the same battle simultaneously, I just need a way to tell which one got there first, so that AFTER the battle is over, I can determine which one gets the item. I suppose I could spawn an alternate unit there that wouldn't enter the battle and work it that way, but I don't want to waste the locations if I can do it with death counts.

Anyway, I think I figured this out on my own with death counts, so thanks for posting. If my way doesn't work, I'll come post again, thanks guys.



None.

Jul 25 2008, 10:58 pm Kaias Post #8



(Do for all humans)
Player Queue is 0 for computer
Current Player Brings dude to item
Deaths of Player Queue is exactly 0 for Current Player
----
Add 1 deaths for Player Queue for computer
Set to 1 for deaths of Player Queue for Current Player

(Do for all humans)
Player Queue is 1 for computer
Current Player Brings dude to item
Deaths of Player Queue is exactly 0 for Current Player
----
Add 1 deaths for Player Queue for computer
Set to 2 for deaths of Player Queue for Current Player

Etc. Etc. Etc. Etc. AKA do up to number of possible humans who could get there.

This way, it will know which one to give the player and then give it. Then you can read for current player.

If (Do for Computer)
"find out who gets it!" is set.
----Then
Subtract 1 for Player Queue for all players

If (Do for Computer)
battle is over
----
Set "find out who gets it!"

If (Do For All Humans)
"Find out who gets it" is set
Current Player has exactly 1 deaths of Player Queue
Current Player is not dead
-----Then
Give item to current player.
Clear "Find out who gets it"

Summary:
Each player is assigned a value according to the order they got there.
It reads that if your number is 1 (first) and you aren't dead then you get the item.
Since it wont clear the switch if 1st is dead, it will knock everyone's order value down one.
This way 2nd player will read as 1st and the real 1st still won't get it since he's dead (if he is dead)
Same thing applies for all players. It will keep knocking them down one until someone gets it.

Ultimately: 1 switch, 1 Death Count unit

Post has been edited 2 time(s), last time on Jul 25 2008, 11:15 pm by Kaias. Reason: Explanation



None.

Jul 25 2008, 11:01 pm Ahli Post #9

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

store it into the different digits of a death count...
the one you need next should always be on the left side:
a=first
b=second
c=third
d=fourth
deathcount: abcd

you just need a few triggers to get the data. you can use some switches or another dc to store the information which was the latest position filled...




Jul 28 2008, 4:28 am Vrael Post #10



OK guys I figured out my own way.

I think it's my fault none of you guys could help me, I neglected to mention it had to be like an actual queue where you could exit and reenter, say there are 4 people in queue ad person 3 leaves, person 4 should slide up to person 3 and when the former person 3 reenters he should become person 4. It is very unlikely that a person would reenter the queue, but I can't go leaving glitches in my map can I? And sorry kais and ahli, I didn't read your guys posts until after I finished. But Ahli, what the heck do you mean?

What I ended up doing was this:
Since it was necessary to detect when a slot was occupied or vacant, I used 4 switches, cleared was vacant, set was occupied. If a player died, the switch for their position was cleared, and triggers moved whoever had the next higher slot into the lower slot. And eventually whoever had slot 1 after the fight got the item. It was necessary to use switches because you cannot use "all players has not suffered exactly 1 death of "Position Counter"" I could've made another string of triggers to detect if a person died which position to slide everyone too I suppose, but correlating a #dc with a switch globalized it. I'm still interested to hear an explaination of your method ahli, if you care to go further into it.



None.

Jul 28 2008, 9:18 am NudeRaider Post #11

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Ahli just presented an alternative method to save queue position.

Instead of spreding the death values among the player and assign a queue nr to their dcs he suggests to use a computer controlled dc where the queue position is marked by how far left the player nr stands in the 4 digit nr.

For example queue order is 1) P1, P3, P2, P4 the number would look like 1324, is the order 2) P4, P2, P1, P3 the number would be 4213.
This seems hard to read out but can be done via triggers like

If queue dc is at least 1000 and at most 2000
give item to P1
If queue dc is at least 4000
give item to P4




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[09:38 pm]
NudeRaider -- Ultraviolet
Ultraviolet shouted: NudeRaider sing it brother
trust me, you don't wanna hear that. I defer that to the pros.
[07:56 pm]
Ultraviolet -- NudeRaider
NudeRaider shouted: "War nie wirklich weg" 🎵
sing it brother
[06:24 pm]
NudeRaider -- "War nie wirklich weg" 🎵
[03:33 pm]
O)FaRTy1billion[MM] -- o sen is back
[2024-4-27. : 1:53 am]
Ultraviolet -- :lol:
[2024-4-26. : 6:51 pm]
Vrael -- It is, and I could definitely use a company with a commitment to flexibility, quality, and customer satisfaction to provide effective solutions to dampness and humidity in my urban environment.
[2024-4-26. : 6:50 pm]
NudeRaider -- Vrael
Vrael shouted: Idk, I was looking more for a dehumidifer company which maybe stands out as a beacon of relief amidst damp and unpredictable climates of bustling metropolises. Not sure Amazon qualifies
sounds like moisture control is often a pressing concern in your city
[2024-4-26. : 6:50 pm]
Vrael -- Maybe here on the StarEdit Network I could look through the Forums for some Introductions to people who care about the Topics of Dehumidifiers and Carpet Cleaning?
[2024-4-26. : 6:49 pm]
Vrael -- Perhaps even here I on the StarEdit Network I could look for some Introductions.
[2024-4-26. : 6:48 pm]
Vrael -- On this Topic, I could definitely use some Introductions.
Please log in to shout.


Members Online: Roy