• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

Mouse Clicked

Status
Not open for further replies.
Level 8
Joined
Jun 20, 2004
Messages
229
Think this would work with multiple players? Using locals in GUI still feels a bit weird to me so just asking. Just a simple mouse click and mouse release test for something like shooting an automatic weapon. I am also aware of the timer problem but not worrying about specifics. Just curious if this would be sufficient for multiple players. Maybe I should just stick with writing it myself...

I probably don't need a boolean for the mouse, but EventMouseClicked() doesn't work like EventKeyPressed() does as an integer. I think someone listed all the functions somewhere but I can't remember?

Code:
Left Click
    Events
        UI - Player Any Player clicks Left mouse button Down.
    Local Variables
        player = (Triggering player) <Integer>
        i = 0 <Integer>
    Conditions
    Actions
        Variable - Set mouseLeft[player] = true
        General - While (Conditions) are true, do (Actions)
            Conditions
                mouseLeft[player] == true
            Actions
                Variable - Set i = (i + 1)
                Debug - Display ("Shoot Cycle " + (Text(i))) as debug output using Type 1, and Do display it in the game window
                General - Wait 0.01 Real Time seconds

Code:
Left Release
    Events
        UI - Player Any Player clicks Left mouse button Up.
    Local Variables
        player = (Triggering player) <Integer>
    Conditions
    Actions
        Variable - Set mouseLeft[player] = false
 
Level 8
Joined
Jun 20, 2004
Messages
229
Thanks, I guess I will stick to just doing periodic events this way instead. Theres much better ways but this seems the most simple and seems to work okay. On a less related note, I have been noticing many people using booleans with WASD movement but have been using a boolean for every key. Just having a few 16 array booleans makes the map huge right now. Wonder if its better to just use an integer instead.
 
Status
Not open for further replies.
Top