Page 1 of 2

Help with Camera Height

Posted: Mon Aug 15, 2011 9:43 pm
by imsohordee
I would like to know how in-game a player can change their camera height from 600-2400?

Re: Help with Camera Height

Posted: Mon Aug 15, 2011 9:44 pm
by 3ICE
Via triggers.
Easy: chat commands -close -mid -far etc.
Hard: camera system that detects the user's current camera distance and multiplies it by a percentage to allow for more extreme values.

Re: Help with Camera Height

Posted: Mon Aug 15, 2011 9:53 pm
by imsohordee
That may be a little to difficult for me yet, as i am partially new to world editor. Later on maybe ill try and figure out the triggering for it.

Re: Help with Camera Height

Posted: Mon Aug 15, 2011 9:59 pm
by 3ICE
Or we can tell you how to do it step by step. :)

Re: Help with Camera Height

Posted: Thu Aug 18, 2011 5:29 am
by manstie
or set camera distance to number specified... easier...

Re: Help with Camera Height

Posted: Thu Aug 18, 2011 2:29 pm
by 3ICE
No, he wants a range of possibilities (600-2400) and that requires a system. The original camera has a much smaller range (800-1200) and he is looking to extend that.

Re: Help with Camera Height

Posted: Fri Aug 19, 2011 3:08 am
by manstie
Use JassNewGen editor to get values higher or lower than original?

Re: Help with Camera Height

Posted: Fri Aug 19, 2011 4:21 am
by 3ICE
Thank you for trying to help him, but this is not useful. If you have the solution then post it, but random vague ideas will not bring this issue forward.
What values?
Why NewGen?
Do you really think they are gameplay constants?

Re: Help with Camera Height

Posted: Wed Feb 01, 2012 12:32 am
by Candlejack
I'm not aware of how good you are at using the World Editor so I have made the Steps to this tutorial very short and easy to follow.


Step 1: Create a new Variable and name it whatever you want but make sure the Variable Type is set to "Real".

Step 2: Create a new Trigger called "CameraHeight" (Or whatever you want, doesn't matter).

Step 3: Make a new a event and select "Player - Chat Message".

Step 4: Edit the information so it says "Player 1 (Red) types a chat message containing -cam as A Substring". NOTE You will have to create this event for each player (In the same trigger).

Step 5: Create a new Action and select "Set Variable".

Step 6: Select the red underlined "Variable" and set it to "CameraHeight" (Or whatever you labeled your Real Variable in Step 2) and click Okay.

Step 7: Select the red underlined "Value" and under the "Fuction" dropdown list select "Conversion - Convert String to Real".

Step 8: Click on "Entered Chat String" and under the "Function" dropdown list select "Substring".

Step 9: Click on the red underlined "String" and under the "Function" dropdown list select "Event Response - Entered Chat String" and click Okay.

Step 10: Click on the blue underlined "1" and change the value to "6" and click Okay.

Step 11: Click on the blue underlined "5" and change the Value to "9" and click Okay.

Step 12: Click Okay, click Okay again, and click Okay Once more to finally finish that event.

Step 13: Create another Action under the one you just finished and select "Camera - Set Camera Field (Timed)".

Step 14: Select the blue underlined "Player 1 (Red)" and under the "Function" dropdown list select "Event Response - Triggering Player" and click Okay.

Step 15: Select the red underlined "Value" and under the "Variable" dropdown list select "CameraHeight" (Or whatever you named your Variable in Step 2) and click Okay.

Step 16: Click the blue underlined "0.00" and change the value from 0.00 to 1.00. (This step is unimportant, but it makes the camera height transition much nicer, rather than just instantly switching heights.

Now, you can test your command by testing the map and typing "-cam XXXX" into the chat, if everything worked correctly it should lower or raise your cameras height over a period of 1 second.
Even if you type "-cam 2500000000000" it would only change your camera's height to 2500 for reasons explained in the Note for steps 10 and 11 below.

NOTE FOR STEPS 10 AND 11: Changing the two values to 6 and 9 tells the game to only read the characters in the 6th, 7th, 8th and 9th spaces of the message. I have chosen 6 and 9 because of our original command "-cam" which is 4 character long. but if you add a space after that it becomes "-cam " which is 5 spaces long. the next space (being the 6th) is the start of the Camera Height that you want, and the 9th will be the last. (This is because the best camera heights can be found between 2000 and 4000.)
If your original command was not the same as mine you would have to edit the values from steps 10 and 11 to correctly reflect your command. (If your command was "-camera" you would use "9" for step ten and "12" for step eleven.

If you were unsuccessful in creating this trigger I attached a map with a working Camera Adjustment trigger that you should feel free to use, but I would recommend trying to do it yourself by reading the steps to get a better feel for how the more advanced things like Variables work.

I hope this helps you and anyone else who may be having the same trouble.

Re: Help with Camera Height

Posted: Wed Feb 01, 2012 6:13 am
by 3ICE
Excellent guide. It will surely help a lot of people, as this topic is now the #3 result on Google for the Warcraft III tutorial change player camera height in-game query. (This topic had 180 hits from Google so far.)

Saving the camera height in a variable is unnecessary. But it does simplify things. (Easier to see what the trigger does.)

But if you are looking to limit the possible values to 600-2400, then the variable comes in handy. Also saves processing time as we don't have to convert string to integer three times.