• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Mouse Clicked

Status
Not open for further replies.
Level 9
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
 
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.
Back
Top