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.
  • 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 The Helper:
    Happy Thursday!
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though

      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