General - Cameras

Knights

You can change this now in User CP.
Reaction score
71
Cameras - From Basic to Advanced
Basics


Table of Contents:
[Goto=1]1.Preplaced Cameras[/Goto]
[Goto=2]2.Triggering your Preplaced Cameras[/Goto]
[Goto=3]3.Triggering Cameras with no Preplaced Cameras[/Goto]


---

[anchor]1[/anchor]
Preplaced Cameras

A preplaced camera is a camera which has been placed on the map previously. This type of camera will be placed within the Terrain Editor.

Here are the steps to placing a preplaced camera:
  • Go to the Terrain Editor
  • Find the Tool Pallette
  • Change it to a Camera Pallette
  • Press CTRL while Right Click dragging, to find the angle and point you wish the camera to be at.
  • Press "Create Camera".

Now we have a preplaced camera, but what if we didn't like where it went?
  • Press CTRL while Right Clicking and dragging, to find the angle of the new point you wish the camera to be at.
  • Press "Set Camera to Current View".

And now, we have moved the camera to a new position.

To change your current view in the World Editor, select the camera you wish to see, and press "View Selected Camera". This will change your current view to the exact angle of the selected camera.

At any time, press Mouse3, the scroll button on your mouse, to return to Game View. Game View is the exact angle which you see by default in game.


---

[anchor]2[/anchor]
Triggering your Preplaced Cameras
So, now we have cameras on the map, so what?
Well, with triggers, we can do many things with those preplaced cameras.

For starters, let's try instantly moving the camera to the position of a camera, as soon as the game begins.

trigger12my1.png


We use Time - Elapsed game time is 0.00 seconds, as Map Initialization does not always work for every camera function.

trigger22jn0.png


There is our trigger.

What it does:
  • Waits for 0.00 seconds, (Basically, as soon as the map begins, and all initialization triggers have run)
  • Finds Camera 001, and Player 1
  • Moves Player 1's camera directly to Camera 001, over 0.00 seconds (Instantly)

Now we have a used camera in the game.

At this point, I advise you to test the map you have created, to see just exactly what happens, and if you get a glimpse of the original starting position and angle designed for Warcraft 3.

If you got a glimpse of the original starting position designed for Warcraft 3, you may want to make the transition smoother, as it may be odd for players to see the starting camera, then suddenly jerk to another area on the map, and a new angle.

How to go about doing this:
First, we need a preplaced camera, and why not use the same one as before.

Now, let's rebuild the old trigger.

trigger22jn0.png


What to change?
Well, to make it smoothly move over to Camera 001, we simply need to add a time other than 0.00 seconds!

trigger33on2.png


Why wait 5.00 seconds?
Because if you want to run an action after you have finished panning the camera for Player 1 to Camera 001, you will need to wait 5 seconds, which is the time it will take to pan there!

So, now you know how to simply activate a preplaced camera, but what use would you have from this?
Well, with this knowledge, you are able to move a players camera. This is very useful for cinimatics, and other things. Also, once the camera takes the position of another camera, you may move it around, but it will stay at the same angle, unless the player uses the scroll.

So how do I fix that?
It depends on what you're aiming for.
Let's do it so once it is finished moving to Camera 001, it waits 20 seconds there, then reverts back to the typical game settings.

So, let's pull our old trigger back again.

trigger33on2.png


What to change?
We will simply change the wait time, and add a new action.

trigger44xy1.png


What have we done?
Well, once it has applyed Camera 001 for Player 1, over 5.00 seconds, it waits 5+20 seconds, (25 seconds), and then resets the camera back to normal after 5 seconds.

Why wait 5.00 seconds at the end?
If you wished to add further actions after the camera is reset, you may want to wait for it to be perfectly normal - Not still changing to normal game camera - before you wish to do your next action.

Why is this useful?
This is useful, because if you wish for the player in game to be able to see a certain point, stay at that point for 20 seconds, then be able to move again, you can do that.

What if I didn't Reset the Camera
If you failed to reset the camera, the player would be stuck watching the game from the same angle as Camera 001, the same rotation as Camera 001, and the same height as Camera 001. The player WILL be able to move his camera, but may get annoyed at the angle.


All right, at this point, if you are lost, continue to read it over, but if you are honestly lost by now, I suggest stopping cameras, and merely doing other things.


---

[anchor]3[/anchor]
Triggering with no Preplaced Cameras

What is the purpose of triggering with no preplaced camera, if we could just set a preplaced camera onto the map?
The idea of this, is if you wished to not always have the point in the same spot on the map, you can simply use this method. Also, it will enable you to be able to

Oooh! Show me! Show me how!
Calm down. Before we start this, let's learn about the triggers for cameras.

Apply Camera Object(Timed) - Will apply a preplaced camera from the editor.

Pan Camera(Timed) - Will pan the camera to a preset region over time.

Pan Camera with Interpolated Height - Pans the camera to a place with a preset height.

Pan Camera as Nessecary - Pans the camera if the player is close, else it will instantly move the camera to that location. This is a desync action, never use it in a multiplayer map.

Set Camera Field(Timed) - Sets a camera field over time.

Rotate Camera around point - Will rotate the camera around a point for (Number)°.

Lock Camera to Unit - Locks the camera to a unit.

Lock Camera Orientation to unit - Locks the camera to a unit offset by something.

Play cinematic sequence - Will play a premade cinimatic sequence (Unnessicary)

Stop Camera - Stops the camera for a player no matter where it is going.

Reset Game Camera - Resets the camera entirely for a player.

Change Camera Smoothing Factor - Will make the camera very smooth and nice if set to a high number.

Reset camera smoothing factor - Sets the cameras smoothing factor to normal.

Sway camera source - Sways the camera source for a player with a velocity and magnitude.

Sway camera target - Sways the camera target for a player with a velocity and magnitude.

Shake Camera - Will shake the camera up and down for a player with magnitude.

Stop Shaking/swaying camera - If the camera was Shaking or Swaying, it will stop.

Extend/shrink camera bounds - Will allow your camera to go farther around the map or less far around the map then before.

Set Camera Bounds - Locks the camera to a specific region, rendering you unable to move out of that region

Set Camera-Spacebar point - Sets the point where if you press spacebar it will take you there.


Look each of these over carefully, and try experimenting with them, before continuing.


---


Now that you have read each of those, and hopefully understand, let's go in deeper.

First off, let's determine exactly the Far Z of a preplaced camera which we wish to have, as well as the Distance to Target, Angle of Attack, Field of View, Rotation, and Height Offset.

For good practice, use this trigger:

trigger55hj6.png



Write down the order of those, so on a peice of paper, write something like this:

  • Distance to Target :
  • Far Z :
  • Angle of Attack :
  • Field of View :
  • Rotation :
  • Height Offset :

Then, once in game, fill out the paper, for example:

  • Distance to Target : 500.00
  • Far Z : 23.51
  • Angle of Attack : 96.12
  • Field of View : 125.32
  • Rotation : 126.43
  • Height Offset : 700

So, now we have all these things, but what do we do with them?
Basically, all this information the game has returned to us, is all the information the game uses, to store 3 simple things.

1. How high the camera is.
2. What the rotation of the camera is
3. The angle of the camera veiw.

With these things, we can watch the game from a new point of view!


So, now, let's take them, and make the camera look EXACTLY like your old camera, except in a random spot on the map.

First off, we are going to want to create a preplaced camera, called Camera 001.

We will then run the above trigger, to find out exactly how this Camera 001 is placed, except for the position on the map.

Then, we will want to create a trigger, which will find a point on the map, and set the angles/height/rotation to that of Camera 001.

So, start like this:

trigger6ef2.png


Woahwoahwoah! What's going on?!?
Well, basically, we will input the information we gathered before into the places which say 0.00. No, not the 0.00 seconds, but the value of 0.00.
Also, the camera will first "pan" or "move" instantly to a random point within the map. It is instant because it is 0.00 seconds.

But why do it so complicated, with so many steps?
Well, there is an alternate way to do it, but the above way will save you a bit of file size space, if you want to have a lot of imports, to say.

Alternate way:
trigger7um9.png



By now, you understand quite a bit about cameras.

Before you continue onto the next post, make sure you complete the following challenges:
  • Lock the camera onto a unit, and while having it locked, change the view to that of a preplaced camera.
  • Pan the camera around the map, using many points, with regions.
  • Create a Third person camera.

BEFORE CONTINUING, COMPLETE THESE CHALLENGES!
 

Knights

You can change this now in User CP.
Reaction score
71
Cameras - From Basic to Advanced
Advanced


Table of Contents:
[Goto=4]1.Advanced - Introduction[/Goto]
[Goto=5]2.First Person Camera[/Goto]
[Goto=6]3.Rotating a Camera without using the GUI Action[/Goto]


---


[anchor]4[/anchor]
Advanced - Introduction

Now that we have completed the 3 challenges, we are ready to start advanced things.


Advanced?
Yes, advanced. Meaning more complicated than basic. A few examples of what we will be doing, are a First Person Camera, Rotating a camera without using the GUI (Graphic User Interface(The trigger Editor)) action, and Flipping a preplaced camera upside down.

WOAH! I'm not ready for this...I don't think...
If you completed the challenges, you are ready, if not, you should spend more time on the above tutorial.

Okay, I feel I am ready.
That is good, let's get started.

[anchor]5[/anchor]
First Person Camera

Firstly, for those who don't know what a first person camera is, it is a camera which makes it seem as if you are in the persons head.

Now, let's start off by creating variables. The variables are used so you can remove the leaks caused by this trigger, as it runs every 0.01 seconds of the game.

Variables Used:
Temp_Group - Unit Group
RandomUnit - Unit
Pos - Point
PoRu - Point
UnitAngle - Real

Okay, now, let's begin the trigger.

First off, an event, use Time - Periodic Event - 0.01 seconds.

Now, let's set our variables and remove the leaks.

trigger8px4.png


So, this will set every variable needed, simplify things, and remove leaks.

But, how do we make it a first person camera?!?!
Patience! :) Let's take it step by step.

First, we are going to Lock the camera for the player we wish, in this case, every player.

Then, we will set the rotation of their camera to that of RandomUnit, or the same as UnitAngle.

Finally, we will pan the camera to PoRU, which will make it seem as if you are in the units head.

Of course, if you want a leakfree trigger, you will want to use some custom script to remove them. I've added that where the finished triggers are.

Now, to make this work, we will need a preplaced camera on the map, which at the start of the map, we will set the player to veiw as if they were that camera, but have it moveable. We did this already, so it shouldn't be hard.

So here are our finished triggers:

First:
trigger7um9.png


Remember, the above trigger only works for Player 1, so you will need to use a loop to make it work for all players.

Second:
trigger9je8.png



[anchor]6[/anchor]
Rotating the Camera without using the GUI Action

So, as you should know, there is a GUI action for rotating the camera around a point.

But what if you want to move it in the middle of a rotation, for example.

This is what you would do.

Create a preplaced camera.

Now, rotating around the exact center of that camera, create a new preplaced camera.

So now, we have 2 preplaced cameras, both facing to the same point, but from different rotations.


Let's trigger this up now.

This one is a bit simpler than the first person camera.

We merely need a trigger like the following:

trigger10yd6.png


How it works:
  • First, it moves the camera for Player 1 to Camera 001.
  • Then, it moves to Camera 002 over 5 seconds.
  • After 5 seconds, it moves back to Camera 001 over 5 seconds.
  • Again, after 5 seconds, it moves back to Camera 002 over 5 seconds.
  • After this, it moves to a new camera, camera 3, which is set to be a shorter angle than the angle of 002-001. This will make it complete the rotation, and move back to what appears to be camera 001.

Here are some screenshots to clear up the last point:
cameraangleshg5.png


Basically, the angle between what Camera 001 is looking at, and Camera 002, whichever side is smaller, is the side the camera will pan around to.



This is wrong, the camera will pan the other way, not that way.


You have reached the end of the tutorial.

I hope you have learned a lot, and here are a few tips of the trade, and challenges:

Tips:
  • Smooth the camera with the GUI trigger. I hope you can find it...;)
  • A good idea for a fun camera, is changing the angle randomly, and it will annoy the players.
  • A smart camera command, is -shake, which shakes the camera wildly!
  • Use all these tips/what you've learned from the tutorial when you make cinimatics, and even if you simply want some neat features in your game.

Challenges
  • Create a preplaced camera, and have what it shows flip totally upside down
  • Make the camera rotate wildly around the map.
  • Smooth the camera. :D


Thanks for reading this tutorial, I hope you learned something,
Knights:cool:
 

Exide

I am amazingly focused right now!
Reaction score
448
It looks very advanced :) And I dont have time to read it atm, sorry.
But why do you have:

Time Elapsed in game time is: 0.00 seconds

-And not 'Map Initialazion' (ugh, spelling)?
Any special reason or am I just dumb? :p
 

R@d14nc3

New Member
Reaction score
49
>Time Elapsed in game time is: 0.00 seconds
It won't work if set that number, that's why :p
EDIT: Damn strechy pages...
 

Knights

You can change this now in User CP.
Reaction score
71
Exide said:
Time Elapsed in game time is: 0.00 seconds

-And not 'Map Initialazion' (ugh, spelling)?
Any special reason or am I just dumb?

Tutorial said:
We use Time - Elapsed game time is 0.00 seconds, as Map Initialization does not always work for every camera function.

youareanoob said:
any thing that is .01 is gonna lag espically if it is multi units

Not as much if you remove the leaks.

Keep up the excellent comments,
Knights:cool:
 

2-P

I will work hard tomorrow
Reaction score
325
Please decrease the size of some texts and cut off some pictures to avoid page stretching.


>"as it may be odd for players to see the starting camera, then suddenly jerk to another area on the map, and a new angle."

You don't see the starting camera if you pan the camera instantly.

>"Well, with this knowlage"

What? Knowledge? Know lag? :p

>"Though beware, once you use this trigger, the player is unable to move his/her camera."

A "click" with the mouse and the camera movement stops.

>"If you failed to reset the camera, the player would be stuck watching exactly what Camera 001 sees for the whole game."

The evil mousewheel changes it back to the normal view.

>"Challenges"

o_0 In a tutorial?
I'm lazy, that's why I'm reading tutorials. I don't want any challenges. :p


>"Not as much if you remove the leaks."

PoRU leaks.
 

phyrex1an

Staff Member and irregular helper
Reaction score
447
>Pan Camera as Nessecary - Pans the camera to a place ONLY IF NECESSARY, if you are already at the place, it will not try to pan there.

Pan Camera as Necessary pans the camera if the player is close else it will instantly move the camera to that location. You should also mention that this is a desync action, never use it in a multiplayer map.

Also, reduce the font, if it stretches the page then it is way to large. If you think that a text is important then just make it one size larger than normal or only bold it.
Imo centered text looks very bad and is a lot harder to read than left aligned text, even if this is only for a small section of the tutorial.
 

Knights

You can change this now in User CP.
Reaction score
71
phyrex1an said:
Pan Camera as Necessary pans the camera if the player is close else it will instantly move the camera to that location. You should also mention that this is a desync action, never use it in a multiplayer map.

Okay, thanks.

phyrex1an said:
reduce the font, if it stretches the page then it is way to large. If you think that a text is important then just make it one size larger than normal or only bold it.

Well, to me the font sizes are good, but the problem is the size of the triggers, and I'm workin' on fixing it.

2-P said:
You don't see the starting camera if you pan the camera instantly

You will if there are many map initialization triggers, or if your computer is laggy.

2-P said:
What? Knowledge? Know lag?

Hehe, thanks.

2-P said:
A "click" with the mouse and the camera movement stops.

Ah, but there is no movement. If it was instantly "applying" camera 001, it will move the camera to 001, and you cannot move the camera after that, though, true, a click or a scroll will fix the problem, but we don't want to rely on the players knowledge of being able to "unhook" the camera.

2-P said:
PoRU leaks.

Untrue, we removed it at the bottom.

Keep the comments up,
Knights:cool:

P.S, challenges are there so you can improve your skills with NO guidences, and I will probably add the answers to them after school.

EDIT: One problem...I can't find where I put knowlage in the tutorial...:( I want to fix the spelling :D...
 

phyrex1an

Staff Member and irregular helper
Reaction score
447
>Well, to me the font sizes are good, but the problem is the size of the triggers, and I'm workin' on fixing it.

You are right, it's the images that stretches the page and not the text.
However I still think that the font is way to huge, my first thought when I saw this tutorial was "Oh no, not another one who wants attention and rep without doing anything" (but in Swedish :p), huge fonts and a lot of colors are typical for those kinds of 'tutorials'. After reading I ofc changed my mind, you can actually learn stuff by reading this tutorial :)

> EDIT: One problem...I can't find where I put knowlage in the tutorial... I want to fix the spelling ...
Hit Ctrl + F in your browser and search for "knowlage".
 

Knights

You can change this now in User CP.
Reaction score
71
Thanks, I will adjust some of the font sizes.

Also, the problem with font sizes, is it changes per browser, computer screen size, and text size settings...:(

phyrex1an said:
After reading I ofc changed my mind, you can actually learn stuff by reading this tutorial

#1, ofc?
#2, Thanks! :D

phyrex1an said:
Hit Ctrl + F in your browser and search for "knowlage".
Haha, smart, thanks.

Thanks,
Knights:cool:
 

2-P

I will work hard tomorrow
Reaction score
325
>"Ah, but there is no movement."

:confused: You were talking about applying a camera over 5 seconds at that part of the tutorial, so there is movement.

>"If it was instantly "applying" camera 001, it will move the camera to 001, and you cannot move the camera after that,"

Sure you can, and you don't even need to click or use the mousewheel.

>"Untrue, we removed it at the bottom."

Oh, right. Must have missed it. :eek:
 

Knights

You can change this now in User CP.
Reaction score
71
2-P said:
You were talking about applying a camera over 5 seconds at that part of the tutorial, so there is movement.

True, sorry I forgot exactly what I was saying...:banghead:

2-P said:
Sure you can, and you don't even need to click or use the mousewheel.

And yet again, you prove me wrong...:D I tested it, and you are correct.

I will update the tutorial with this new info..:D
Knights:cool:
 

Knights

You can change this now in User CP.
Reaction score
71
Outch. Some leaks. :p

For a camera, you should write it goes from left to right, and never the inverse.

Most of the leaks aren't in major places...If you see any in a major place, please notify me.


Left to right, and never the inverse? What do you mean? Panning the camera? Applying cameras? =/


Thanks,
Knights:cool:
 

Knights

You can change this now in User CP.
Reaction score
71
Bump!

Please further comment, rate, and read this tutorial..I hope it helps you in some way.

Knights:cool:
 

LoveTD's

New Member
Reaction score
34
For the guys who likes making a third person camera view here's a trigger:

Code:
Player 1 types 3rd person view
    Events
        Player - Player 1 (Red) types a chat message containing -third as An exact match
    Conditions
    Actions
        Trigger - Run third person view for player 1 <gen> (checking conditions)

And this one:

Code:
third person view for player 1
    Events
    Conditions
    Actions
        Player Group - Pick every player in Player Group - Player 1 (Red) and do (Actions)
            Loop - Actions
                Set NumUnitsSelected = (Number of units in (Units owned by (Picked player) matching (((Matching unit) is selected by (Picked player)) Equal to True)))
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        NumUnitsSelected Equal to 1
                    Then - Actions
                        Set CameraTarget = (Random unit from (Units owned by (Picked player) matching (((Matching unit) is selected by (Picked player)) Equal to True)))
                    Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        CameraTarget Equal to No unit
                    Then - Actions
                        Skip remaining actions
                    Else - Actions
                Camera - Pan camera for (Picked player) to (Position of CameraTarget) over 1.00 seconds
                Camera - Set (Picked player)'s camera Distance to target to 1100.00 over 0.75 seconds
                Camera - Set (Picked player)'s camera Angle of attack to -20.00 over 0.75 seconds
                Camera - Set (Picked player)'s camera Rotation to (Facing of CameraTarget) over 0.75 seconds
                Trigger - Run (This trigger) (checking conditions)
        Wait 0.50 seconds
        Camera - Lock camera target for (Picked player) to CameraTarget, offset by (0.00, 0.00) using Default rotation

B.t.w. don't know how to switch the third person mode off thought :p ow and you need to do this for each player....
 

Cilla

is watching you! Ahh, fresh meat!
Reaction score
39
This First Person Camera is only usable on a flat terrain :S
 

Knights

You can change this now in User CP.
Reaction score
71
This First Person Camera is only usable on a flat terrain :S

That is very true, if you wanted the terrain to be varied FP Camera may not be the best choice for you. Though it is possible with several camera angles, though is complicated.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/
  • The Helper The Helper:
    Decided to put up a healthier type recipe to mix it up - Honey Garlic Shrimp Stir-Fry https://www.thehelper.net/threads/recipe-honey-garlic-shrimp-stir-fry.193595/

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top