Help with Camera Height

Do you need World Editor help? Ask here!
Forum rules
Before making a new topic:
First, check if your question has already been answered in the Tutorials section.
If you didn't find a solution, use the search function.
If searching didn't help either, you can make a new topic.

Topic title & content:
You must use a descriptive title. (Help plz is not good) (Need help with Dialog buttons is good)
Go into much detail when posting. You should post attachments. Like screenshots of the problem, the map you are making, replays of the error. Or you could even make a screencast (video) of your problem and upload it here.

Spelling:
Grammar seems to be a serious problem amongst teenagers, so use a spell checker or you will get no love.
Read your posts twice, before pressing the reply button.
And do not use profanity. Chatspeak (y r u nub) and Leetspeak (1 C4N S33 H4X) are not welcome here either.

Only World Editor related questions are allowed here!
(Click for Battle.net help) (Click for World Editor help)
imsohordee
Posts: 7
Joined: Tue Aug 09, 2011 1:35 pm
Realm: US East
Account: imsohordee
Clan: BHoR

Help with Camera Height

Unread post by imsohordee »

I would like to know how in-game a player can change their camera height from 600-2400?

User avatar
3ICE
Admin
Posts: 2629
Joined: Sat Mar 01, 2008 11:34 pm
Realm: Europe
Account: 3ICE
Clan: 3ICE
Location: Hungary
Contact:

Re: Help with Camera Height

Unread post 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.
ImageImageImageImageImage
Image
ImageImage

imsohordee
Posts: 7
Joined: Tue Aug 09, 2011 1:35 pm
Realm: US East
Account: imsohordee
Clan: BHoR

Re: Help with Camera Height

Unread post 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.

User avatar
3ICE
Admin
Posts: 2629
Joined: Sat Mar 01, 2008 11:34 pm
Realm: Europe
Account: 3ICE
Clan: 3ICE
Location: Hungary
Contact:

Re: Help with Camera Height

Unread post by 3ICE »

Or we can tell you how to do it step by step. :)
ImageImageImageImageImage
Image
ImageImage

User avatar
manstie
Posts: 310
Joined: Wed Jun 17, 2009 9:27 am
Account: manstie
Location: Perth, Australia
Contact:

Re: Help with Camera Height

Unread post by manstie »

or set camera distance to number specified... easier...
Image

User avatar
3ICE
Admin
Posts: 2629
Joined: Sat Mar 01, 2008 11:34 pm
Realm: Europe
Account: 3ICE
Clan: 3ICE
Location: Hungary
Contact:

Re: Help with Camera Height

Unread post 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.
ImageImageImageImageImage
Image
ImageImage

User avatar
manstie
Posts: 310
Joined: Wed Jun 17, 2009 9:27 am
Account: manstie
Location: Perth, Australia
Contact:

Re: Help with Camera Height

Unread post by manstie »

Use JassNewGen editor to get values higher or lower than original?
Image

User avatar
3ICE
Admin
Posts: 2629
Joined: Sat Mar 01, 2008 11:34 pm
Realm: Europe
Account: 3ICE
Clan: 3ICE
Location: Hungary
Contact:

Re: Help with Camera Height

Unread post 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?
ImageImageImageImageImage
Image
ImageImage

Candlejack
Posts: 26
Joined: Sat Jan 28, 2012 4:52 am
Realm: US East
Account: WaffleFace
Clan: TMMM

Re: Help with Camera Height

Unread post 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.

User avatar
3ICE
Admin
Posts: 2629
Joined: Sat Mar 01, 2008 11:34 pm
Realm: Europe
Account: 3ICE
Clan: 3ICE
Location: Hungary
Contact:

Re: Help with Camera Height

Unread post 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.
ImageImageImageImageImage
Image
ImageImage

Post Reply

Who is online

Users browsing this forum: No registered users and 53 guests