HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Player specific selection has arrived!

08-02-2002, 12:08 AM#1
dataangel
..OK, sorta.

In case you don't already know, doing a select action in multiplayer selects it for ALL players, this lets you do it for just one player.

I've got a trigger fix, and there's an example map attached to this post, but it has some limitations:

-Having on player select something deselects everything for all other players.
-If you have, for example, Player2, select something that belongs to Player6, both Player2 and Player6 will select it, but none of the other players will. In other words, the Player you specify and the player that owns what you're selecting both select it. The example map gets around this by changing the owner of the building to the other player, but there are still ways this could be useful (neutral passive owner for instance).

Ok, whatcha do is, you create a visibility modifier emmitting black mask over the unit you want to select for all player EXCEPT the one you want to select it, and create a second visibility modifier emmitting visibility for the unit for the player you want to select it, then you do the selection action on it. The part where visibility is given for the selecting player isn't in the example map because the unit to be selected is already visible to both players.

OK, now that you know how I did it, here's all the other ways I tried that don't work:

-Changing the camera bounds
-Disabling user control
-Turning on cinematic mode
-Turning on letterbox mode
-Changing owner
-Setting up triggers to detect non-selecting player selecting and to remove unit from selection
-Forcing UI Key F1 (I tried a dozen different ways, but there's no character equivalent of 'F1' and Force UI Key only reads the first character. Virtual Keyboard didn't work even.)

I also tried to get around the whole ownership thing by turning off shared vision for the unit to its own owner (the reason the owner of the unit selects it too is because the unit itself defeats the black mask by having its own visibility for the player), but that doesn't work either.

Now, there's also some other stuff you could try, that I haven't, because I'm either too lazy, it'd take too long to do, or I just don't have the motivation:

1) Try continuously (like every .5 seconds) creating a black mask visibility modifier over the unit to be selected for the owner of the unit. You'll need to setup a system to add the visibility modifiers to an array so you can delete them later.

2) Give all units a sight raidus of zero, and with triggers create a region giving visibility around every unit that follows them and put in array, and disable it for the unit to be selected for the owner during the selection time.

3) Try experimenting with hiding/unhiding the to be selected unit such that its hidden when player1 is set to select but not when player2 is, and vice versa, cuz the code is probably running top down and not simultaneously inside war3. (the timing for this maybe so miniscule that it's impossible with periodic events)

Have fun :)

Edit: To use the map, load it up, and type select as a chat message. You will select the barracks, but the other player will not, and vice versa.

Edit2: A possible way to make this more useful is to make the unit to be selected neutral passive or an unused computer, and have it turn on full shared unit control with you. This way you can still do stuff with it once its selected, but the owner doesn't select (they aren't in game)