Reavers are being given Scarabs via triggers; they're not building them. Therefore, the add 0 hangar is useless.
Player 1 owns the reaver. Player 1's Reaver fires a Scarab. Both the scarab and reaver are now given to Player 2.
Player 1 owns up to 100 Reavers. One random Reaver fires a Scarab. You give one random Reaver to Player 2? There's a 99% chance you gave the wrong Reaver unless you have some system for determining which Reaver fired the Scarab.
While Player 2 has ownership of the reaver 1 scarab is added to the hanger and then the reaver is returned to player 1 (not the scarab, just the reaver).
You can't give Scarabs to other players; you have to give the Reaver that owns the Scarab. Giving the Reaver also gives the Scarab. This works the same way with Interceptors and Carriers.
Use the give all command so that all scarabs and reavers are given and this trigger will only fire one time per release of Player 1's scarab.
I assume you mean this specifically for the give back only, so that means you still haven't mentioned how to individually select the firing Reaver out of a group of many Reavers.
...My initial post stated the scarab ownership is transferred and only the reaver is given back to its original owner. Pretty sure scarabs only transfer ownership automatically while theyre inside the reaver. When theyre on the field they have to be given via trigger.
You may want to back up your certainty with evidence. I've attached a map proving that using "Give Unit" on Scarabs doesn't do anything. Feel free to do more research on it if you'd like (in fact, I encourage it, and would suggest you make a similar test to see that Scarabs are given automatically when the Reaver is given, even if the Scarab is deployed; again, it's the same relationship an interceptor has to a Carrier).
Agreed. However, i'm unsure of how his/her map works. whether all 100 reavers will be constantly firing or only a few at a period of time. This is why i posted the one that will add 1 to all but also stated if theres a need to individualize then you can use center location. Location size would be the key in only affecting 1 reaver at a time.
If they were all firing at the same time and/or constantly, we could just replenish hangar count based on a timer. Unfortunately, this doesn't seem to be the case.
I'd still like to hear how you would center a location on the correct Reaver. Are you going to cycle through all Reavers and somehow figure out when to stop, or are you taking a similar approach to my idea of just grabbing the nearest Reaver to a fired Scarab?
Edit: Here's a possible solution you could use for this problem, AIGG, but it's expensive:
Check when Player A brings at least 1 Scarab to Anywhere. When this happens, cycle through Player A's Reavers by giving to Player B, and if Player B brings at least 1 Scarab to Anywhere during this cycle, give the last given Reaver to Player C. When you finish cycling through Player A's Reavers, give all Reavers owned by Player B back to Player A. Remove all Scarabs for Player A via the "Remove Unit" action, which will remove Scarabs from the hangar. Now give Player C's Reavers back to Player A.
In the above scenario, you can reuse Player B for different players, and if this is done in the same trigger cycle, you can reuse Player C for different players as well. However, doing this many gives every trigger cycle is likely to cause performance issues, so you can modify the above to not give Player C's Reavers back to Player A for a certain amount of time (preferably using a death count timer). The drawback to this is that it forces Player C to be unique to Player A.
As for the cycling bit, it's ugly. You're gonna have to do this:
Trigger #1:
C: Current Player suffered exactly 0 deaths of Stage
C: Current Player brings at least 1 Scarab to Anywhere
A: Set deaths of Stage for Current Player to 1
A: Preserve Trigger
Trigger #2a:
C: Current Player suffered exactly 1 deaths of Stage
C: Current Player brings at least 1 Reaver to Anywhere
A: Move Location CurrentReaver on Reaver owned by Player A at Anywhere
A: Give 1 Reaver owned by Player A at Anywhere to Player B
A: Preserve Trigger
Trigger #2b:
C: Current Player suffered exactly 1 deaths of Stage
C: Player B brings at least 1 Scarab to Anywhere
A: Give all Reaver owned by Player B at CurrentReaver to Player C
A: Preserve Trigger
... Then you repeat Trigger #2 (both parts a and b, in alternation) n times, where n is the max number of Reavers the player can have. At some point, Player A will no longer have any Reavers to give, and the process continues:
Trigger #3
C: Current Player suffered exactly 1 deaths of Stage
C: Current Player brings exactly 0 Reaver to Anywhere
A: Set deaths of Stage for Current Player: Set to 2
A: Give all Reaver owned by Player B at Anywhere to Current Player
A: Remove all Scarab for Current Player
A: Add at most 1 unit hangar for all Reaver owned by Current Player
A: Set deaths of Wait for Current Player: Set to 12 (Optional)
A: Preserve Trigger
Trigger #4 (Optional)
C: Always
A: Set deaths of Wait for Current Player: Subtract 1
A: Preserve Trigger
Trigger #5:
C: Current Player suffered exactly 2 deaths of Stage
C: Current Player suffered exactly 0 deaths of Wait (Optional)
A: Give all Reaver owned by Player C to Current Player
A: Set deaths of Stage for Current Player: Set to 0
A: Preserve Trigger
Post has been edited 5 time(s), last time on May 23 2012, 12:56 am by Roy.