• 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.
  • 💡 We're thrilled to announce that our upcoming texturing contest is in the works, and we're eager to hear your suggestions! Please take this opportunity to share your ideas in this theme discussion thread for the Texturing Contest #34!
  • 🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen masterpiece! 🔗 Click here to enter!

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