Home   Help Search Login Register  

Author Topic: get Z direction  (Read 462 times)

0 Members and 2 Guests are viewing this topic.

Screaming Point

  • Guest
get Z direction
« on: 03 Jan 2005, 17:01:11 »
I can use the "direction _unit" function to get a blokes direction of facing on the x/y plain. Is there a scripting command that allows me to find the Z component of a unit's direction of facing: eg: if my bloke is looking up a hill, can I find the angle he is looking at (there is probably a more concice method of expressing this question with reference to the hypetenus etc, but its been a long time since I did maths at school)  ???

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:get Z direction
« Reply #1 on: 03 Jan 2005, 17:39:12 »
no, there is no command
for units i don't think you can find it at all, but there are some functions that can find pitch, that work on vehicles, basically because a unit can look up without changing their position, if that makes any sense to you

Screaming Point

  • Guest
Re:get Z direction
« Reply #2 on: 03 Jan 2005, 18:09:20 »
Thanks, Triggerhappy, I understand. It's irritating, because the programme must store this information as a variable somewhere to know where people are looking and shooting. Ah, well, it looks like I'll have to come up with some other way around my problem.  :-\

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:get Z direction
« Reply #3 on: 03 Jan 2005, 18:40:12 »
well what are you trying to do? perhaps there is a work around

Screaming Point

  • Guest
Re:get Z direction
« Reply #4 on: 03 Jan 2005, 19:14:06 »
I'm messing around with a Jump Pack script (so I can wizz around the battlefield like the Starship Troopers in the book, or Dale Brown's Tin Men).

I've got a version cobbled together that just about works, however I was hopping to be able to select the jump height based on the elevation of the player's view: eg, the higher you look, the further you will jump.

I guess if I was a bit more clued in, I could use some code to pick a landing point and then calculate the vectors necessary to punt my guy to the chosen point (maybe like using the lazer rangefinder to pick targets).

The 'cunning' bit in my script is that it slows the jumper as he reaches the ground, otherwise taking long jumps tends to lead to terminal road rash.

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re:get Z direction
« Reply #5 on: 07 Jan 2005, 03:05:22 »
If you just need to know what is the elevation of a hill in front of the unit (the incline of the hill) use my NOE function.  It is desigend for for keeping AI aircraft to follow a tight nap of earth flight path, but it does so by "looking ahead" at the hills and valleys in front of the craft.  It can therefore be used to "see" the incline of a hill in front of a ground based unit.  In fact I use the function just for that at launch time in my Super Guided Missile Script.  It checks the incline in front of the missile launching vehicle to take that into account when figuring the optimum launch angle.  You can check out that script at the Editors depot, but here is the NOE function

Screaming Point

  • Guest
Re:get Z direction
« Reply #6 on: 07 Jan 2005, 23:36:24 »
Thanks, Raptorsaurus, I'll check it out.