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

Smooth Camera movement ?

Status
Not open for further replies.
Level 9
Joined
Apr 28, 2009
Messages
538
Can somebody tell me how can i make a smooth camera movement?

I've seen such thing in some maps which name i cannot remember except for one: GotA (not dota)

If you played this map you know how nice the camera moves.

If you don't know what i'm talking about, test it (version 0.56b at least) and you'll see.
 
Level 11
Joined
Jun 21, 2007
Messages
505
I think that when a player presses a key, you make triggers move player's camera to where it was before player moved it, and then you pan the camera to a side depending on the key pressed. And about mouse I think, that you can store in a variable the target of player's camera and check everyone 0.01 second whether player's current camera target matches the point in the variable, if not then do the same thing as when player presses keys.
 
Level 9
Joined
Apr 28, 2009
Messages
538
kktos no, this smooth camera it's not made by triggers. Why? Because i checked GotA (unprotected map) and it has no triggers, not atleast one, not even the default triggers. Not even custom code.
You can check it, like i saied: it's unprotected.
 
Level 9
Joined
Apr 28, 2009
Messages
538
lol, a map without triggers (even without the default ones) WILL WORK!

If you do not believe me, just make a new map and delete all the triggers, you`ll see.
 
Level 9
Joined
Apr 28, 2009
Messages
538
kkyos, yes, i know this, and i know this map uses this method.

And by the way..i did not deprotected the map. I don't do such things.
 
Level 11
Joined
Jun 21, 2007
Messages
505
So you got to make your own trigger system for panning the camera smoothly.
I have to notice that may annoy some users. For example, I get very annoyed when my camera doesn't listen my orders and goes smoothly, because I'm not used to that. You should take that into account.
EDIT: Okay the system. Here's a savage example of it.
  • Use CameraPos as camera position
  • Events
    • Player - Player presses Up Arrow key
  • Conditions
  • Actions
    • Custom script: if GetLocalPlayer() == Player(0) then
    • Camera - Pan Camera to CameraPos over 0.00 seconds
    • Camera - Pan camera to CameraPos offset by (Xvalue; Yvalue)
    • Custom script: endif
  • Track CameraPos
  • Events
    • Time - Every 0.01 seconds
  • Conditions
  • Actions
    • Custom script: if GetLocalPlayer() == Player(0) then
    • Set CameraPos = Target of Current Camera
    • Custom script: endif
 
Level 9
Joined
Apr 28, 2009
Messages
538
ok i'm not a noob triggerer but even so i don't know what i have to do.

Do i have to make a "Use CameraPos as camera position" trigger for each player?

and do i have to make this for each navigation key too ("player presses Up, Down, Left, Right") ?
 
Level 5
Joined
May 31, 2009
Messages
122
KK, trigger:


Event:
Map initialization

Conditions:
None

Action:
Player - Pick Every Player in (All Players) and do (Camera - Change camera smoothing factor to <x>)


Change x to any number. The higher it is, the smoother. Personally, I'll use something like 5 to 8.

I'm not sure what settigns Gods of the Arena is on; too lazy to check.
 
Level 19
Joined
Feb 25, 2009
Messages
2,004
KK, trigger:


Event:
Map initialization

Conditions:
None

Action:
Player - Pick Every Player in (All Players) and do (Camera - Change camera smoothing factor to <x>)


Change x to any number. The higher it is, the smoother. Personally, I'll use something like 5 to 8.

I'm not sure what settigns Gods of the Arena is on; too lazy to check.

Camera smooth applies on all players in-game, no need to pick them.
 
Level 9
Joined
Apr 28, 2009
Messages
538
Lulz, this is solved since 06.02. What's the problem with you dudes?

And by the way, no vJass is needed to do that.

You only have to make a simple trigger like that:

Event - Whatever
Condition - Whatever
Action - Change camera smoothing factor to <value>
 
Status
Not open for further replies.
Top