Detect Pathing for camera zooming Possible?

Tooblet

Active Member
Reaction score
6
Heya, I'm pretty new at jass, but I'm toying around with AceHearts Third Person Camera system and was planning on making it so it detects unwalkable pathing.

What I want is for the camera to auto-zoom in when the camera is "over" a piece of unwalkable pathing.
I'm not really sure on how to solve this problem and I bet it requires a bit of math. but anyways...

I've been trying to add some sort of location to where the current distance to target for my camera is, and then reducing it.
But I never get it to work and my brain is melting trying to do this :p
I've seen systems changing Angle of attack when the unit is near a cliff or a high hill.
That's sort of what I'm looking for, exept I want it to zoom in and detect if terrain is walkable in some way.
So I can make buildings u can walk inside of and when nearing a wall and turn so the units back is against the wall, the camera will zoom in,
so u cant see throught the wall. :)

I guess it may be too complicated at my stage of Jassing, but I find I learn best when taking really BIG challenges early on. makes me learn more than one thing at a time.

So, anyone has a solution or any idéa if this is possible and if so, how?

I thank in advance

EDIT: I found a way to detect pathing in SOME way in a knockback system.
But I wouldn't know how to apply that to a camera.
 

Tooblet

Active Member
Reaction score
6
yeah I tried that, but it only detects Z offset for cliff heights and such.
and also changes the Angle of Attack.

I want it to detect if there is unwalkable pathing and zoom in if detected.

whatever, I'll figure it out as I learn more jass :)
 

Viikuna

No Marlo no game.
Reaction score
265
Well, you can use native IsTerrainPathable to find out if terrain has some spesific pathingtype. ( this is usefull when you try to check if some point is in water or not )

Then again, if you need to know if some unit can walk to some point, you can use IsTerrainWalkable -library by Anitarf.
It detets cliffs and doodads and other types that can limit your units movement, expect other units.
 

xxxtrickyxxx

(o Y o)
Reaction score
64
well, the actual point your camera would be at to check for pathability would be...

cos(Angle of Attack) = Unknown X/Distance To Target
so if your camera angle is 5 degrees upward, and the distance to target is 500:

cos(5) = x/500
x = 500 * cos(5)
x = 498

less obvious example would be:

cos(35) = x/250
x = 250 * cos(35)
x = 204

Then again, I might be off on my whole calculation so someone feel free to correct me but I think this should find the exact distance behind the unit where you should check for pathability or at least check within that distance for pathability. An example would be a for loop checking every say 8 distance so you would have a 25 count loop checking the second example and if that point was not pathable, then set the distance to target to that value.
 

Tooblet

Active Member
Reaction score
6
thanks for replies,
That was what I was looking for.
although I don't really understand the calculation 100%, I understand what I need in order to achieve this thing.

I'll go and try some things out trying to solve this thing, If I do, I'll post it somewhere.
If I don't, I'll start whining here again :p
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top