• 🏆 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!

[vJASS] Camera functions

Status
Not open for further replies.
Level 19
Joined
Oct 12, 2007
Messages
1,821
Hey there,

I'm having some trouble with the Spacebar snippet in combination with activating a specific camera object.

I'm using a 0.03 sec timer that pans the camera to my camera object but doing this every 0.03sec makes it harder to detect when im pressing the spacebar for some reason.
Is there a way to lock the camera to a camera object without using a timer loop? I must be able to use my space and arrow buttons without moving the camera.
 
Level 19
Joined
Oct 12, 2007
Messages
1,821
I tried locking it to a unit which resulted in the spacebar event not working at all.
I suppose that spacebar event requires movement to be allowed since it basically tracks if the camera moved or not.
Hmm kinda stuck now...
 
The reason for this not working is that the camera position is only updated once every 0.0x seconds. I don't know the correct interval, but I suppose it's something like 0.1 seconds.
I once wanted to create a mouse camera turning system (you know, moving the mouse to the border of the screen will turn the cam locked on a unit instead of swaying the camera), but this issue was the killer to my idea.
(Actually, it wasn't the killer, because it worked, but the turning speed differed depending on the unit movement - only if the unit was standing still, the camera turned at full speed)

On an unrelated note (might not be an issue for you, but it was for me, and this was the REAL killer for my idea):
There is also no way to instantly pan a camera to a point without also stopping the camera swaying caused by moving the mouse curser to the border of the screen. The only way to do this is by setting the camera bounds, but this was slow as hell so it wasn't smooth anymore.
 
Status
Not open for further replies.
Top