• 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.

[Trigger] How can i change the zoom of the ingame camera

Status
Not open for further replies.
Level 2
Joined
Oct 18, 2004
Messages
18
Not sure where else to put this, seems to fit in this forum section though...Either that or somewhere in triggers.. but all i saw were sections for spells.. and jass.. :S Sorry, if a mod sees this move it to where it should be.

Just recently got back into mapping, and let me say it's not like riding a bike -at least for me. I favorite system i like to put into my maps is the users ability to type -min, -med, -max, -reset, for different camera settings. I've completely forgotten how to make a trigger to zoom the camera out upon the user typing those exactly. I got the "Event" down, but not the "Action." Can anyone give me a hand here?

also, when the map finishes loading and the game starts, i like it to go into cinematic mode for several seconds, and then start. I feel so newb :(
 
Level 3
Joined
Sep 20, 2007
Messages
37
trigger - cameraToggler
player enters chat mesage "-" as a substring
action - ifthenelse:
if substring (entered chat string, 1, 5) equal to "-cam1"
then set variable cam[1] to true
else set variable cam[1] to false

action - ifthenelse:
if substring (entered chat string, 1, 5) equal to "-cam2"
then set variable cam[2] to true
else set variable cam[2] to false

trigger - cam1
timed event (every 5 seconds)
conditions -boolean comparison: cam[1] equalto true
set camera field (timed)
player - field - value - ovrtime:
set camera field (timed)
player - field - value - ovrtime:

i suggest you make a camera object of what you want it to look like in the editor and then open it's properties and copy+paste the values Distance and Angle of Attack using the setcamerafield function
(cam is being used a boolean array (4))

if this doesnt make sense let me know and ill go through it step by step
edit: changed cam1 trigger for anti-playermade camera'ing changes
edit2: this is the most effective way i can thihnk of right now, if anyone has a less mamory consuming way to do it go ahead :p im no alberteinstein.... yet...
 
Level 2
Joined
Oct 18, 2004
Messages
18
woah, little too fast for me there. where is this stuff in action? I swore, I did it before. Ive got the event down, but boolean condition and action are kicking my ass.
 
Level 2
Joined
Oct 18, 2004
Messages
18
:S.. I swear there was a simpler way of doing this lol. I'm not THAT pro at triggering.. i still don't really understand /selffacepalm.


It used to be like "Camera Distance" or something :S I found out how to do it in a simpler way i believe. Setting players field of view, and increasing / decreasing that. No conditions required
 
Level 8
Joined
Feb 20, 2007
Messages
338
Two triggers:

  • Zoomin
    • Events
      • Player - Player 1 (Red) types a chat message containing Zoom in as An exact match
      • Player - Player 2 (Blue) types a chat message containing Zoom in as An exact match
    • Conditions
    • Actions
      • Camera - Set (Triggering player)'s camera Distance to target to 350.00 over 1.50 seconds
If you have all 12 players then your events are going to have to be set for all 12

the distance of 350 is really, really close.

  • Zoomout
    • Events
      • Player - Player 1 (Red) types a chat message containing Zoom out as An exact match
      • Player - Player 2 (Blue) types a chat message containing Zoom out as An exact match
    • Conditions
    • Actions
      • Camera - Reset camera for (Triggering player) to standard game-view over 1.50 seconds
Camera properties will allow you to do a lot. You may want to zoom in close and change the angle of attack or the roll to face the direction of the selected unit I don't know what all you want.
 
Level 2
Joined
Oct 18, 2004
Messages
18
Thanks bob.


Wraith, I owe you man. That's exactly what I was looking for.

You mean i can change the angle of which you look? Like being ingame and pressing insert/delete or what ever buttons it is over there?
 
Level 8
Joined
Feb 20, 2007
Messages
338
Thanks bob.


Wraith, I owe you man. That's exactly what I was looking for.

You mean i can change the angle of which you look? Like being ingame and pressing insert/delete or what ever buttons it is over there?

Yes you can change a lot of camera stuff without a camera object to pan to/from:

The basic function: Camera - Set Player 1 (Red)'s camera Distance to target to 0.00 over 0.00 seconds

The option of distance is changeable to other things:

Distance to target: How close the camera is to the target.
Far Z - how far one can see in the game - mind values over 5000 tend to lag the game on huge and epic sized maps. This function sets the "skybox" further away from the camera the default setting is really close and the world is cut off with the sky.
Angle of Attack: A lower number raises the camera thus 318 is steeper than 340 (which is about ground level).
Height Offset: which raises the camera up and down (without changing its AoA).
Roll: How the camera rolls back and forth
Rotation: Which direction the camera looks.

There is another one I can't recall what it is.

There are a few other camera features that do not need a camera object placed on the map. Such as locking to a specific unit a great one for a mini-cinematic where you want the camera to follow X Unit into a cinematic.

However locking to a specific unit turns off the ability to click on the minimap to send the unit anywhere beyond the current camera bounds.

I have seen maps which "lock" the camera at a greater distance with a shallower angle of attack. This is done by using the trigger function: Camera - Set Player 1 (Red)'s camera Distance to target to 0.00 over 0.00 seconds

Usually in a loop sequence with the event of :Time - Every 0.01 seconds of game time:

  • For each (Integer A) from 1 to 12, do (Actions)
    • Loop - Actions
      • Camera - Set (Picked player)'s camera Angle of attack to 330.00 over 0.20 seconds
Basically no matter what the players do, use the mouse wheel, use the delete and insert key, etc the camera goes back the the locked position that the map author desires.
 
Status
Not open for further replies.
Top