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.
  • WildTurkey WildTurkey:
    is there a stephen green in the house?
    +1
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top