• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Sticky Mouse Camera in MMORPG System. SOLVED

Level 4
Joined
Jun 28, 2010
Messages
38
While I can read and write Jass I'm not the best at it and instead prefer to use the bare minimum I have to in Jass and use gui for the rest. The result is what I feel a much more user friendly map for people who use gui and jass. I took the mouse camera system demo made by Brilock and broke it down into the base parts and remade it using only gui with the exception of declaring the frames that the mouse uses to control the camera and it all works as it does in his map with one issue.. The camera is prone to sticking; for example:

1. Player holds down either left or right mouse button
2. Mouse is hidden and then the player is able to move the camera via their mouse as long as it is held down.
3. Player releases mouse and the mouse will reappear and no longer control camera movement.

However sometimes on step three when the player lets go of the mouse button it just keeps controlling the camera as if the game never got the message that the mouse button is no longer held. You can click the mouse button a few times and it will then realize it is no longer beng held and stop contoling the camera. Everything seems to work right with my code but this is not an issue that appears in the demo map by Brilock.

So I have a trigger mouseDown that detects when and which player has issued either a right or left click and it sets the players leftClick or rightClick variable to true. It then moves the mouse to the center of the screen, hides it and enables the custom frames that detect mouse movement for the player. So as long as leftClick or rightClick is true it will move the camera using the mouse. Now when the player lets go of the mouse button it should run mouseUp which is the opposite of the mouseDown trigger. It will set the leftClick or rightClick variable to false and then unhide the mouse and disable the mouse capture frames.

Any ideas? I really want to submit this as a resource for other people to use but I don't want to throw it out there with this bug in it. The map also features a full wads movement system to mimic MMORPG play as faithfully as possible with my ability. My goal was to have a scaleable system that is as easy to use as possible for beginners and veterans alike.


-edit
Oof.. I think my problem lies with the periodic timer event in the trigger "Camera and Movement Timer"
Nope it was one improper condition in the mouse down. I am dumb.

The linked version should be bug free but I've never tested it in Multiplayer.

-- Fixed a bug where you would stutter walk when holding right and left mouse buttons
-- Changed the periodic timer for the "Camera and Movement Timer" trigger from .1 seconds to .2 seconds. Might be able to do .3 seconds but .5 is way too slow to update the players movement.
 

Attachments

  • MouseCam&WASDMovement_ver1.0.w3m
    435.7 KB · Views: 27
Last edited:
Level 4
Joined
Jun 28, 2010
Messages
38
What version are you on? It's using some of the new Reforged Jass calls so if you aren't on... whatever patch they added that it will probably crash. Also fixed a bug where holding left and right mouse buttons to move forward would stutter walk instead of walking straight.
 
Level 5
Joined
Apr 13, 2019
Messages
56
Just tested your map ITS FUCKING AWESOME looks very much like the 2010 ROC mod program where you could do similar things, but then i have a simple question HOW could i import the triggers on a new map and make it work, i tried i made the needed regions and unit but when i test it there are so many variables errors do you have a tutorial?
 
Level 4
Joined
Jun 28, 2010
Messages
38
Just tested your map ITS FUCKING AWESOME looks very much like the 2010 ROC mod program where you could do similar things, but then i have a simple question HOW could i import the triggers on a new map and make it work, i tried i made the needed regions and unit but when i test it there are so many variables errors do you have a tutorial?
Sorry about the late reply, October is my con month where I gotta finish my costume or cry. If you still need a hand I just rejoined the Hiveworkshop discord. Should be listed under Xain.

That being said you should just be able to import the triggers and the variables and then it should be ok. I can write up a tutorial if you need. Oh and you haev to enable vjass in the trigger option thing.
 
Top