wal@Posted: Sat Dec 22, 2007 7:09 pm :
I've been trying for days to get this to work and I'm so close but I can't get the last bit right.
Code:
      vector orientation = '0 90 0';
vector ang = $player1.getViewAngles();
      prop.setAngles( ang + orientation );

This (above) does what I want, but I just need to turn it 90 degrees.
Code:
      vector orientation = '0 90 0';
vector ang = $player1.getViewAngles();
      prop.setAngles( ang + orientation );

But if I do this, then it screws up the turning angle so that if you look up or down, it barrel rolls instead of changing it’s pitch like it does in the top example. So how do I change its angle without changing the angle that it moves? This is giving a headache. I tried changing its angle in the def, but for some reason nothing changed. I suppose the script is overruling it and I would have to use getKey, but that would just be a more complicated way of doing the same thing. Help!



Ivan_the_B@Posted: Sun Dec 23, 2007 1:52 pm :
You can get the player view angles
Code:
vector ang_fw = $player1.getViewAngles();

get the right direction (so it's rotated 90 degree)
Code:
vector dir_right= sys.angToRight( ang_fw  );

transfrom it back to angles
Code:
vector ang_right= sys.VecToAngles( dir_right );

and use the new vector
Code:
prop.setAngles(ang_right);


about the same for left, up, down direction...



wal@Posted: Sun Dec 23, 2007 4:56 pm :
Excellent, thanx Ivan.

Now I need a clever formula to change the origin distance depending and the view angle. Look up = move away/look down = move towards. I will probably need them to be different, so starting from a dead centre view, down doesn't change the distance as drastically as up. Figuring this out on my own is slightly out of my league, for now.

Also, the world model objects are huge up close. I think the view models are smaller, strange as that sounds, the scale's not consistent. To get round this I've moved certain objects further away from the player to make them look smaller, but to complete the illusion I need them to constantly draw, even if they're "behind" a wall ect. Can this be done :?: