Staredit Network > Forums > SC1 UMS Theory and Ideas > Topic: [EUD] Multiplayer Key Press Detection
[EUD] Multiplayer Key Press Detection
Feb 3 2019, 10:05 pm
By: Roy  

Feb 3 2019, 10:05 pm Roy Post #1

An artist's depiction of an Extended Unit Death

If you've read Section 5 of [EUD] A Mapmaker's Guide for Creating EUDs, you would know there are a lot of cool things we can do with EUDs, but some of them cause synchronization issues in multiplayer. One such feature is detecting keys pressed on a keyboard, which could be used for anything from custom menus to creating units.



Well, thanks to the MurakamiShiinaQC plugin available in EUD Editor 2, it is now possible to use such features in multiplayer games without desyncing.

Key Detection on Multiplayer

Prerequisites:
The following guide was tested and verified with euddraft 0.8.2.9 and EUD Editor2 0.17.8.2.

Bind Key Press to Unit Death Counter

Step 1:
With your map open in EUD Editor 2, click on the "Plugins" button



Step 2:
Enable the "MurakamiShiinaQC" plugin



Step 3:
(It is fine to leave the recognition unit as-is; it does not appear to be affected by actual in-game events like creating/killing the unit in question.)
Click on the "Insert" button that appears



Step 4:
Select the key you would like to capture (for example, 'W'), the unit to hold the death counter for it (for example, 'Goliath Turret'), and the value of the death counter when the key is pressed (for example, 1)


*Example: 'W' key is pressed = Death Counter 1 for Goliath Turret // 'W' key is not pressed = Death Counter 0 for Goliath Turret

After Completion it will look similar to:



Step 5:
Repeat steps 3 & 4 for each key you want to detect. Use a different death counter if you need the keys to work simultaneously (e.g., holding 'W' and 'D' to move up-right)



Key press capturing has now been set, and you can detect these by using the corresponding condition (from the example, "Player 1 has suffered exactly 1 deaths of Goliath Turret" means Player 1 is holding down the 'W' key)

Step 6:
Check the eudTurbo option, which will function like hyper triggers. (I'm not sure if this is absolutely necessary for key press detection, but it's a good thing to have selected regardless.)



Step 7:
Close the window and click the "Insert" button to compile the key press plugin into your map



That's it! Attached is a demo of being able to control units with the WASD keys. WASD_Demo.scx is the source map, WASD_Config.e2s is a loadable EUD Editor 2 settings file with the steps above followed and saved, and WASD_Demo_Compiled.scx is the resulting functional demo allowing players to move their Terran Marine around with the WASD keys.

Attachments:
WASD_Demo.scx
Hits: 4 Size: 51.59kb
WASD_Config.e2s
Hits: 2 Size: 2.58kb
WASD_Demo_Compiled.scx
Hits: 2 Size: 196.53kb

Post has been edited 2 time(s), last time on Feb 9 2019, 4:12 pm by Roy.




Feb 4 2019, 7:30 am NudeRaider Post #2

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

Okay, who is going to make the first (proper) 3rd person shooter for bnet?




Feb 4 2019, 11:53 am Oh_Man Post #3

Find Me On Discord (Brood War UMS Community & Staredit Network)

How can you have a third person shooter it HAS to be top down.




Feb 13 2019, 1:09 pm Swampfox Post #4



Hey thanks for this. Any insight into what the MouseLocationSet does in the plugin?



None.

May 20 2019, 10:56 am Arta(M) Post #5

Armoha

Quote from Swampfox
Hey thanks for this. Any insight into what the MouseLocationSet does in the plugin?
You need to fill all 8 Locations to enable MouseLocation feature. 1st location follows position of 1st human player mouse cursor (it says P1 but it doesn't).
2nd location follows mouse cursor position of 2nd human player, and so on.



maintainer of euddraft and eudplib.
Armo#6637 at Discord :teehee:

Sep 12 2020, 6:49 am Oh_Man Post #6

Find Me On Discord (Brood War UMS Community & Staredit Network)

Is there any way to make it so you can hold the button down to be continually setting the DC to 1, then letting go of the button sets the DC to 0?




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[12:30 am]
ClansAreForGays -- When you join a pub lobby because you see 7/8 players, but then realize host is bating you with computers. :flamer: :flamer:
[2024-10-30. : 11:48 pm]
O)FaRTy1billion[MM] -- :wob:
[2024-10-30. : 6:24 pm]
Ultraviolet -- :wob:
[2024-10-29. : 4:33 pm]
Vrael -- :wob:
[2024-10-29. : 1:32 pm]
Zoan -- :wob:
[2024-10-28. : 5:21 pm]
Ultraviolet -- :wob:
[2024-10-27. : 4:34 pm]
jjf28 -- :wob:
[2024-10-27. : 9:01 am]
Zycorax -- :wob:
[2024-10-27. : 3:31 am]
RIVE -- :wob:
[2024-10-26. : 7:12 pm]
Ultraviolet -- :wob:
Please log in to shout.


Members Online: Roy, RIVE