Sorry I should have specified this earlier but I want another player to be able to command the unit as normal, so would your suggestion be possible on a per-user basis?
afaik, canceling an order does not have the same effect as not issuing an order. Let's say an SCV is mining and I order it to move away from the minerals. If I cancel that move order, he'll stop and not mine. I want him to keep mining (taking on the previous order).
You're actually adding to the confusion. Here, I'll quote my first post: "How can you detect which player was the Host in the Lobby via triggers during runtime?"
Can you be more specific about the Data Editor? I'd need an Ability that would cancel *any* order at all. Is that even possible? All the built-in Cancel abilities refer to specific unit abilities. I don't want to issue a "Cancel" command. I want to prevent the Order from reaching the unit. Probably not possible, huh.
I'm struggling with unit selections myself. afaik, your only option here is to have a trigger that runs either when you select a unit or periodically. It would check all of Player 1's selected units and if any are found also in Player 2's selected units, then remove from Player 1's selection group.
In more detail: Pick each unit in Player 1's selected units, then inside that loop pick each unit in player 2's selected nits. Compare the units. If they are equal, remove from player 1's selection and break out of the loops. There might be a more efficient algorithm but that should do it.
I'd like to intercept an order given to a unit by a player and cancel it. In other words, I need some code in a Trigger that will prevent the unit from receiving or carrying out the order. This facility exists in other event-based environments such as Javascript where you can return false on a link click and it won't follow the link (it cancels the event).
Hmm...I'm not seeing any triggers that enable me to read what units Player X's control groups contain. If that data is sent to all clients, how can I get at it? Otherwise I'll have to have triggers for Cntrl-1 thru Cntrl-0 and Shift-1 thru Shift-0 that record the currently selected units for Player X and store that separately.
A separate problem is that you can't add units to control groups or even player selection group unless you have Control of those units. Anyone know how to override this?
I feel the confusion is coming from your posts, actually...I'm not sure where you got the ideas to mention (2) and (3) from my original post. It's pretty clear that I'm interested in (1). Also, two of your posts contain vague or factually incorrect statements (specifically your first and third posts), thus adding to confusion and reducing the usefulness of this thread. I do appreciate your comments, however.
Yeah I was hoping to avoid all the manual dialog creation and trigger code if it was supplied for free somehow (as it seems it should be). Note that I believe you can get at player control groups by integer, so you wouldn't have to manually store the control group selections when they hit Ctrl...you'd just have to refresh the icons when Ctrl was pressed by a player I suppose.
Hopefully someone knows how to do this in an easier way...?
I just tested and if Player A comes into the lobby, then Player B, Player A will be Player 1 in the game. If Player A comes into the game, then Player B, then player A leaves, then comes back, he is still set as Player 1 even though Player B is the Host in the lobby. Conclusion: you cannot rely on lobby slot position to determine game host.
I totally agree that the concept of Game Host is a bit misplaced in the modern SC2. However, under Game Attributes, you can create a new attribute in the Lobby and lock it so only the Game Host can change it (the host is marked with "HOST" in the player list in the Lobby). This seems like a fairly commonly employed technique so I thought I'd try it with my map as well. However, not being able to detect who this special player is once in-game is another sadly absent feature in the editor/API.
The only method I have found to allow proper control is to Change Owner. Based on my tests, there is no possible way to duplicate what happens in a standard melee game where, when an ally is defeated, all of his units transfer to your control while maintaining their color and ability to react to enemies correctly. You actually have to transfer those units to your ownership, thus changing their color. If you manually switch the color of those units back to their old color, the units that get produced from a building will be *your* color, not their color. Hope that helps.
Is there a panel template or some other facility that will automatically display the resources (supply, minerals, vespene) for a subset of players? This would be similar to the LeaderPanel, which is the standard replay panel that appears in upper-left portion of screen. I'm looking for upper-right display that appears in replays, but live during gameplay.
I already implemented a voting system and now would like to implement an alternate mode where the player who has privileges as Game Host in the Lobby also has special privileges in-game. Your statement "B.net is host" seems misplaced here...I understand bnet is hosting the game but that has nothing to do with this issue, which involves detecting who was set as Game Host in the Lobby (not what service/network/computer is "hosting" the game). Apparently it is not possible to detect who was game host in lobby then. Another shortcoming of b.net.
0
@Trieva: Go
Sorry I should have specified this earlier but I want another player to be able to command the unit as normal, so would your suggestion be possible on a per-user basis?
I started a new thread at http://www.sc2mapster.com/forums/development/triggers/28857-select-multiple-units-not-allowed-to-control-them/ clarifying my broader problem.
0
@Trieva: Go
afaik, canceling an order does not have the same effect as not issuing an order. Let's say an SCV is mining and I order it to move away from the minerals. If I cancel that move order, he'll stop and not mine. I want him to keep mining (taking on the previous order).
0
@playpong: Go
You're actually adding to the confusion. Here, I'll quote my first post: "How can you detect which player was the Host in the Lobby via triggers during runtime?"
Host != First Player in the case you stated.
0
@Trieva: Go
Can you be more specific about the Data Editor? I'd need an Ability that would cancel *any* order at all. Is that even possible? All the built-in Cancel abilities refer to specific unit abilities. I don't want to issue a "Cancel" command. I want to prevent the Order from reaching the unit. Probably not possible, huh.
0
@playlessNamer: Go
I'm struggling with unit selections myself. afaik, your only option here is to have a trigger that runs either when you select a unit or periodically. It would check all of Player 1's selected units and if any are found also in Player 2's selected units, then remove from Player 1's selection group.
In more detail: Pick each unit in Player 1's selected units, then inside that loop pick each unit in player 2's selected nits. Compare the units. If they are equal, remove from player 1's selection and break out of the loops. There might be a more efficient algorithm but that should do it.
0
I'd like to intercept an order given to a unit by a player and cancel it. In other words, I need some code in a Trigger that will prevent the unit from receiving or carrying out the order. This facility exists in other event-based environments such as Javascript where you can return false on a link click and it won't follow the link (it cancels the event).
0
@StragusMapster: Go
Hmm...I'm not seeing any triggers that enable me to read what units Player X's control groups contain. If that data is sent to all clients, how can I get at it? Otherwise I'll have to have triggers for Cntrl-1 thru Cntrl-0 and Shift-1 thru Shift-0 that record the currently selected units for Player X and store that separately.
A separate problem is that you can't add units to control groups or even player selection group unless you have Control of those units. Anyone know how to override this?
0
@Enexy: Go
I feel the confusion is coming from your posts, actually...I'm not sure where you got the ideas to mention (2) and (3) from my original post. It's pretty clear that I'm interested in (1). Also, two of your posts contain vague or factually incorrect statements (specifically your first and third posts), thus adding to confusion and reducing the usefulness of this thread. I do appreciate your comments, however.
0
@ZealNaga: Go
Yeah I was hoping to avoid all the manual dialog creation and trigger code if it was supplied for free somehow (as it seems it should be). Note that I believe you can get at player control groups by integer, so you wouldn't have to manually store the control group selections when they hit Ctrl...you'd just have to refresh the icons when Ctrl was pressed by a player I suppose.
Hopefully someone knows how to do this in an easier way...?
0
I just tested and if Player A comes into the lobby, then Player B, Player A will be Player 1 in the game. If Player A comes into the game, then Player B, then player A leaves, then comes back, he is still set as Player 1 even though Player B is the Host in the lobby. Conclusion: you cannot rely on lobby slot position to determine game host.
0
@Trieva: Go
Right, but I'm trying to avoid having to setup dialog items and the supporting code if it's already provided in a Panel Template.
0
@peranzormal: Go
I totally agree that the concept of Game Host is a bit misplaced in the modern SC2. However, under Game Attributes, you can create a new attribute in the Lobby and lock it so only the Game Host can change it (the host is marked with "HOST" in the player list in the Lobby). This seems like a fairly commonly employed technique so I thought I'd try it with my map as well. However, not being able to detect who this special player is once in-game is another sadly absent feature in the editor/API.
0
The only method I have found to allow proper control is to Change Owner. Based on my tests, there is no possible way to duplicate what happens in a standard melee game where, when an ally is defeated, all of his units transfer to your control while maintaining their color and ability to react to enemies correctly. You actually have to transfer those units to your ownership, thus changing their color. If you manually switch the color of those units back to their old color, the units that get produced from a building will be *your* color, not their color. Hope that helps.
0
Is there a panel template or some other facility that will automatically display the resources (supply, minerals, vespene) for a subset of players? This would be similar to the LeaderPanel, which is the standard replay panel that appears in upper-left portion of screen. I'm looking for upper-right display that appears in replays, but live during gameplay.
0
@SouLCarveRR: Go
I already implemented a voting system and now would like to implement an alternate mode where the player who has privileges as Game Host in the Lobby also has special privileges in-game. Your statement "B.net is host" seems misplaced here...I understand bnet is hosting the game but that has nothing to do with this issue, which involves detecting who was set as Game Host in the Lobby (not what service/network/computer is "hosting" the game). Apparently it is not possible to detect who was game host in lobby then. Another shortcoming of b.net.