lock camera

  • Thread starter Thread starter abou15
  • Start date Start date
A

abou15

Guest
I wanted to lock the camera on my witch doctor and this camera view will be in 3d and if the unit turn left the camera follow him and turn left. I want always to see the back of this witch doctor. I don't know how I do the camera view 3d and i don't know how the camera view follow the doctor. Please can someone help me, I'm not the best in the camera part.
 
Every .5 seconds of the game use 'Camera - Rotate camera' and rotate it to the facing degrees of the unit (Might need some type of +90/45 if its crooked) along with lock/pan to the unit
 
Try the 'Preview camera motion' button when you use a camera action (With no variable targets)

Sometimes it bugs and doesnt show right so you might need to test that to
 
reply

Sorry but I don't undertsnad what do you mean. Do you mean

Events : Map initialization
Conditions : ----
Actions : Camera - Rotate camera 90.00 degrees around (Position of Troll Witch Doctor 0032 <gen>) for Player 1 over 5.00 seconds

Camera - Lock camera target for Player 1 (Red) to Troll Witch Doctor 0032 <gen>, offset by (XXX, YYY) using Default rotation

I understood that.


And sorry I don't know how to adjust the angle and the range-Z. I'm really bad.
 
I was working on an RPG a while ago, and came up with this trigger. It's for "first-person" view, but if you don't want any of that just use the Lock Camera and the Rotation part of the trigger. You can set it to the unit through variables (if you need help with that too, I can answer that). Feel free to alter this any way you would like:

Code:
Events: 
Time - every .20 seconds o' game time 

Conditions: 
NONE 

Actions: 
Camera - Apply Camera 1 <gen> for Player 1 (Red) over .20 seconds 
Camera - Set Player 1 (Red)'s camera Rotation (Facing of (unit)) over .20 seconds 
Camera - Set Player 1 (Red)'s Height offset ((Real((Terrain cliff level at (position of (Last created unit))))) x (90.00 - 50.00)) over 0.00 seconds 
Camera - Lock camera target for Player 1 (Red) to (unit), offset by (0.00, 0.00) using Default rotation 
Camera - Set Player 1 (Red)'s camera Height offset to 200.00 over 0.00 seconds 
Camera - Set Player 1 (Red)'s camera Angle of Attack to 200.00 over 0.00 seconds 
Camera - Set Player 1 (Red)'s camera Field of View to 100.00 over 0.00 seconds

EDIT: I'll explain what each part does-

"Camera - Apply Camera 1 <gen> for Player 1 (Red) over .20 seconds" - Applies the camera to the player, and the .20 seconds provides a smooth transition as opposed to instantly jumping to the unit.

"Camera - Set Player 1 (Red)'s camera Rotation (Facing of (unit)) over .20 seconds" - Sets the players camera rotation to the angle of the unit. Once again, .20 adds smoother transition (and looks more appealing than constantly jumping x degrees when the unit moves).

"Camera - Set Player 1 (Red)'s Height offset ((Real((Terrain cliff level at (position of (Last created unit))))) x (90.00 - 50.00)) over 0.00 seconds
Camera - Lock camera target for Player 1 (Red) to (unit), offset by (0.00, 0.00) using Default rotation" - This is mainly for the "first person" aspect. It helps raise the camera as your unit moves up on terrain. Other wise the unit runs off of the camera and the player cannot follow the unit.

"Camera - Set Player 1 (Red)'s camera Height offset to 200.00 over 0.00 seconds" - This makes the camera higher or lower, and I find 100-300 a good value that still keeps the unit on the screen.

"Camera - Set Player 1 (Red)'s camera Angle of Attack to 200.00 over 0.00 seconds" - This is the angle of the camera. 360 is lined up perfectly with the ground. I believe if the value goes below 300-320 (somewhere in there), the camera turns upside down, so watch out for that. This is generally the main part of the view when it comes to the camera.

"Camera - Set Player 1 (Red)'s camera Field of View to 100.00 over 0.00 seconds" - Self explanatory, how much the player sees, I could be wrong though...I never actually fiddled around with this much.

When you make the camera, you can double-click on it and fix it's distance. Distance can be played around with, but it basicly means how far away the camera is from the targeted unit.
 
Code:
Melee Initialization
    Events
        Map initialization
    Conditions
    Actions
        Melee Game - Use melee time of day (for all players)
        Melee Game - Set starting resources (for all players)
        -------- - --------
        Visibility - Disable fog of war
        Visibility - Disable black mask
        -------- - --------
        Wait 0.10 seconds
        Trigger - Run Periodic Adjustment <gen> (checking conditions)

Code:
Periodic Adjustment
    Events
    Conditions
    Actions
        Player Group - Pick every player in (All players) 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 - Lock camera target for (Picked player) to CameraTarget, offset by (0.00, 0.00) using Default rotation
                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
        Wait 0.50 seconds
        Trigger - Run (This trigger) (checking conditions)
 
Triple, actually.
 
Pft, I like mine better, it's less complex.

(noob, there is an edit button you know..)

EDIT: Somebody gave me negative feedback for this post. THE GUYS NAME IS NOOB, I WAS NOT CALLING HIM ONE. Actually read what's going on before giving out negative repuation.
 
Set CameraTarget = (Random* ___* unit from (Units owned by ^
THERE IS A NUMBER THERE | WHAT IS THIS NUMBER?
(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)

*THEN* GO BEFORE THE *ELSE* IS IT IMPORTANT?

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 - Lock camera target for (Picked player) to CameraTarget, offset by (0.00, 0.00) using Default rotation
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
Wait 0.50 seconds
Trigger - Run (This trigger) (checking conditions)
[/code][/QUOTE]
 
Your *CameraTarget* varible is an integrer or a unit group type of varible?
 
Oh! I understand now forget my last reply =). I did all that you do the 2 variable...but and that's not work thats don't lock the camera and its not in 3d vision. Nothing work. =(
 
I did all that you do the 2 variable...but and that's not work thats don't lock the camera and its not in 3d vision. Nothing work. =(
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    Happy Thursday!
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    we were down for a minute - think a log file or something got too big
    +1
  • Ghan Ghan:
    The alerts say it was down for a while unfortunately.
  • Ghan Ghan:
    Didn't know what was going on while I was at work.
  • Ghan Ghan:
    Disk filled up with logs. Fixed now.
    +1
  • The Helper The Helper:
    not a problem at all thanks for getting us back up
  • The Helper The Helper:
    I think the bots are finding a way to get through the anubis
  • The Helper The Helper:
    Happy Wednesday Everyone! Hope everyone has a Fantastic Day!
    +1
  • The Helper The Helper:
    Yeah, stats are showing big bot influx like 12k page views.
  • Wizard Wizard:
    :wave:
    +1
  • Ghan Ghan:
    TH changed his avatar again. 6 more weeks of summer.
    +3
  • Wizard Wizard:
    lol
    +1
  • The Helper The Helper:
    Guys just a heads up I am going to be shutting the site down soon. I am just waiting on the NUON people to decide whether they want to transfer forum data and keep the discord. My email is [email protected] for anyone that wants to keep in touch and I have a facebook too. I will make an official post later. Love you guys and will miss everyone!
    +1
  • V-SNES V-SNES:
    Sent a pm @The Helper
  • Stephen Stephen:
    Oh no - please don't lose the Nuon content
    +1
  • The Helper The Helper:
    Someone email AtariAge and see if they want me to transfer the forum data over to it
  • Ghan Ghan:
    Could probably keep NUON stuff around here if we wanted.
  • Ghan Ghan:
    Hmm what to do about the World Editor site though?
  • Stephen Stephen:
    I'd rather personally just own a backup of the Nuon data than see it go to AtariAge honestly. If it gets enshittified as per usual, or if some of the "regular" Jaguar folks get there, it's not gonna be fun
  • The Helper The Helper:
    There will be a github of the forum data so the NUON Forum Data I guess would be available there
  • The Helper The Helper:
    World Editor is technically Ryoko stuff not mine you guys can keep that I am not in that even
  • jonas jonas:
    :( end of an era :(
  • The Helper The Helper:
    Dont think of it as an end jonas - think of it as a beginning, because really my friend that is what it is.

The Helper Discord

Members online

No members online now.

Affiliates

Hive Workshop NUON Dome World Editor Tutorials
Back
Top