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

lock camera

Status
Not open for further replies.
Level 13
Joined
Nov 22, 2006
Messages
1,260
What is the best way to lock the camera to a certain point (so the player can't move it)? Is there a better way than creating an invisible unit and locking the camera to it? Other than that nothing is coming to my mind, except periodically setting the camera, but that's stupid.
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
Why is locking the camera to a hidden unit buggy? I didn't get that part....

@Megafyr
I think that counts as "periodically setting the camera :p"

The iritating part about periodically setting it is that the interval has to be 0.02 or even 0.01, because otherwise the panning is visible.
 
Level 19
Joined
Oct 29, 2007
Messages
1,184
I tried 0.035 already, it shows a bit (I don't know why exactly). Should I use "apply camera" action? Is there a way to instantly apply the camera? Without the panning, I mean.

try this:

JASS:
if ( GetLocalPlayer() == Player(YOURPLAYER) ) then
call SetCameraTargetController(YOURUNIT, 0, 0, false)
endif

and do it every 0.04 seconds. That really shouldn't show up. : <
 
Level 16
Joined
Mar 3, 2006
Messages
1,564
  • Initialization Copy
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Forget about the god-damn leak --------
      • Wait 5.00 seconds
      • Unit - Create 1 Peasant for Player 1 (Red) at ((Center of (Playable map area)) offset by (-256.00, -128.00)) facing Default building facing degrees
      • Set camTarget = (Last created unit)
      • Camera - Lock camera target for Player 1 (Red) to camTarget, offset by (0.00, 0.00) using Default rotation
      • Wait 2.00 seconds
      • Unit - Remove camTarget from the game
This worked with a dummy unit having locust ability and no model and shadows.
 
Level 16
Joined
Mar 3, 2006
Messages
1,564
Starquizer, press CONTROL + C ingame and feel free to move the camera again...
Edit: Maybe it was ALT + C

I made this
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Wait 5.00 seconds
      • Camera - Lock camera target for Player 1 (Red) to Paladin 0001 <gen>, offset by (0.00, 0.00) using Default rotation
And during the game I pressed CTRL+C and ALT+C but it did nothing ??!!


<< EDIT >>

Ohh ... bloody hell it worked, you were right.


<< SECOND EDIT >>

You were right about CTRL+C only when you select the unit that the camera is locked on but if a dummy unit with locust it will be unselectable and you can't press CTRL+C to reset the camera.
 
Yeah, so I told you to use periodic functions which will update the camera. Just use my answer of post this and you will have it.

You were right about CTRL+C only when you select the unit that the camera is locked on but if a dummy unit with locust it will be unselectable and you can't press CTRL+C to reset the camera.
Doesn't matter, as far as I know.
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
Tested, something is wrong with that "pan with 100000" method, at least when I was testing it. Locking the camera to an invisible unit, however, works fine.

Thanks for your effort guys.

EDIT: Lol, Megafyr and Anachron, I have to spread first :p
 
Status
Not open for further replies.
Top