• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Camera Locked to a unit

Status
Not open for further replies.
Level 1
Joined
Jan 21, 2012
Messages
6
Hi there. I am busy making a map where there are invisible platforms quite high up in the air as a walkway for players to cross this gorge on my map. Anyway, what i wanted to do was lock the camera to triggering unit crossing over the gorge and stay on him, even at that height. But what its doing is following the unit and as it begins to cross on the invisible platform, it ignores that and drops straight to the ground while still following the unit.

If this is making sense, any at all, i would really appreciate help. Cos I actually want players to *SEE* their units crossing over the platform instead of just the ground every time the unit tries to cross. Thank you.

Here are 3 images to describe what im saying:
 

Attachments

  • First Pic.png
    First Pic.png
    1.2 MB · Views: 85
  • Second Pic.png
    Second Pic.png
    1.2 MB · Views: 81
  • Third Pic.png
    Third Pic.png
    1.1 MB · Views: 79
Level 5
Joined
Jul 18, 2010
Messages
159
I know that isn't the best option, i'm not advanced in camera systems but:

You can make a camera object that will target the walkway and trigger, that will move the camera every 0.1 secodns (or less) to position of your unit( mb this will work)
Know it sucks but if you will not get any other ideas you can try.
sry for english
 
Level 1
Joined
Jan 21, 2012
Messages
6
Thank you for your reply. It is much appreciated. but wont this cause some major memory leaks or some lag in my map?

Hmm... when "camera lock onto unit" is applied, it seems to lock onto the unit's feet or path where the actual ground is (not the invisible platforms).

Is there no way to lock onto a unit, but keep the camera a certain distance/height from the ground and let it stay there while the unit is moving?
 
Level 1
Joined
Jan 21, 2012
Messages
6
Ah-Ha? hmm... i don't know how to access the game's custom script code :/

but anyway, what do I do afterwards? And will it be possible to only set those settings just for a particular region? I.e Just for the fiery Gorge of Death?
 
What Bribe is saying is that you're going to have to use custom scripts in GUI like this:
  • Custom script: lol hi this is a custom script, you can add custom code here
You should be calling the function PanCameraToWithZ like this:

  • Set x = the x of the target you want
  • Set y = the y of the target you want
  • Set z = the z of the target you want
  • Custom script: call PanCameraToWithZ(udg_x, udg_y, udg_z)
 
Level 1
Joined
Jan 21, 2012
Messages
6
Oh maaan! I am really naab at this. Im sorry but i tried but to no avail :'(

I tried this with variables; x, y, and z, with all variable types "Camera Object" and initial value "- none -"

Am i at least on the right path?
 

Attachments

  • Custom script Pic.jpg
    Custom script Pic.jpg
    27.3 KB · Views: 55
Level 7
Joined
Apr 30, 2011
Messages
359
the variables' type are all 'real' . . .
each represents coordinates . . .
x and y = unit location
z = height

you should use a looping trigger to make the camera (looks like) locked into the unit . .
the loop should be around 0.01 - 0.05 . . .
assign each variables' value, then use that custom script . . .
 
Status
Not open for further replies.
Top