Home   Help Search Login Register  

Author Topic: look at player.  (Read 552 times)

0 Members and 1 Guest are viewing this topic.

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
look at player.
« on: 31 Jul 2003, 01:38:08 »
ok... so i have this little part of the script which is pissing me off (suprise suprise)

Code: [Select]
_who = Uri_1;
   
_dx = 1;
_dy = 0;
_dz = 1.7;
   
   
#Loop
   
   
;=== 17:26:18
_camera camSetTarget gas
_camera camSetPos [(getpos _who select 0) + _dx * sin (getdir _who) - _dy *

cos (getdir _who), (getpos _who select 1) + _dx * cos (getdir _who) + _dy *

sin (getdir _who), (getpos _who select 2)+_dz]
_camera camSetFOV 0.700
_camera camCommit 0
@camCommitted _camera
   
? gaskameraend : goto "Next"

goto "Loop"

#Next

ok... so that code makes it look from the viewpoint of the guy - changing the _dx to -1 makes it look at the back of his head.... but i want it to look at the face... but every number i try in Y makes no difference and its really peeing me off...any1 know the combo of numbers to do this... i have literally tried all numbers.... aaaargh.
Proud Member of the Volunteer Commando Battalion

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:look at player.
« Reply #1 on: 31 Jul 2003, 01:56:49 »
Yikes... that's an awfully long camera pos line you've got there mate ;D

Try something like this instead:

Code: [Select]
_camera camSetPos [(getpos _who select 0) + (_dx * sin getdir _who), (getpos _who select 1) + (_dx * cos getdir _who), (getpos _who select 2)+_dz]
Now _dx will be the distance you want the camera to be from the player. That will will place the camera directed infront of their head...

If you'd like a slightly different angle, that can be done quite easily by simply adding a single number, but we'll only get into that if you need it.

Trig is confusing at the best of times... ;D

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:look at player.
« Reply #2 on: 31 Jul 2003, 02:03:30 »
cheers sui.... also might need to call on you for a little help in the voices department.... but thats later... just gonna test this out first.
Proud Member of the Volunteer Commando Battalion

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:look at player.
« Reply #3 on: 31 Jul 2003, 02:08:40 »
it doesnt work.... it just fades in again at the position it faded out but the camera follows the movements of the guy...

Code: [Select]
titleCut ["","BLACK OUT", 2]
titleCut ["","BLACK IN", 2]

_who = Uri_1;
   
_dx = 1;
_dy = 0;
_dz = 1.7;  

#Loop
   
   
;=== 17:26:18
_camera camSetTarget _who
camera camSetPos [(getpos _who select 0) + (_dx * sin getdir _who), (getpos

_who select 1) + (_dx * cos getdir _who), (getpos _who select 2)+_dz]
_camera camSetFOV 0.700
_camera camCommit 0
@camCommitted _camera
   
? gaskameraend : goto "Next"

goto "Loop"

#Next
« Last Edit: 31 Jul 2003, 02:10:29 by Messiah »
Proud Member of the Volunteer Commando Battalion

Offline .pablo.

  • Former Staff
  • ****
  • When in doubt, empty the magazine.
Re:look at player.
« Reply #4 on: 31 Jul 2003, 02:14:39 »
the reason its fading in at the same pos is because the camera doesn't exist yet when u fade back in.

and if it is stayin at the same pos but still following the guy, it looks like its because gaskameraend is = to true.  try takin out that line and try again

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:look at player.
« Reply #5 on: 31 Jul 2003, 02:18:41 »
that line doesnt exist.... and the camera has been created... i'm just taking a snippet from the whole script...

the camera did work before with the original lines i posted... but didnt view the player no matter what numbers i put in... but the camera essentially did follow the man.

here is the whole script as it stands:

Code: [Select]
_camera = "camera" camcreate [0,0,0]
_camera cameraeffect ["internal", "back"]

;=== 23:18:32 CHURCH TOWER
_camera camSetTarget [102530.38,6233.52,-12258.12]
_camera camSetPos [3321.11,6840.96,15.13]
_camera camSetFOV 0.700
_camera camCommit 0
@camCommitted _camera

titlecut ["", "Black in", 4]
~4

playmusic "churchbell"

~3

titlecut ["", "black out", 2]
;=== 23:25:32 CHURCH RUIN   
_camera camSetTarget [102519.12,11992.23,-10003.40]
_camera camSetPos [3181.15,6857.79,10.89]
_camera camSetFOV 0.700
_camera camCommit 0
@camCommitted _camera
titlecut ["", "black in", 2]

~5

titlecut ["", "black out", 2]
;=== 23:27:28 RUINS
_camera camSetTarget [16599.80,105747.80,4635.10]
_camera camSetPos [3296.89,6732.81,1.36]
_camera camSetFOV 0.700
_camera camCommit 0
@camCommitted _camera
titlecut ["", "black in", 2]

~5

titlecut ["", "black out", 2]
;=== 23:30:48 GRAVE
_camera camSetTarget [60952.29,88573.15,-209.25]
_camera camSetPos [3351.17,6830.37,1.42]
_camera camSetFOV 0.700
_camera camCommit 0
@camCommitted _camera
@camCommitted _camera
titlecut ["", "black in", 2]

~5

titlecut ["", "black out", 2]
;=== 23:33:39 WINDOWS
_camera camSetTarget [2992.27,-92902.16,-7173.28]
_camera camSetPos [3213.08,6820.33,5.78]
_camera camSetFOV 0.700
_camera camCommit 0
@camCommitted _camera
titlecut ["", "black in", 2]

~3

crow1 = true

~2

titlecut ["", "black out", 2]

man1 removeweapon "nvgoggles"

;=== 23:36:51 MEN UP
_camera camSetTarget [2445.28,95549.97,46460.22]
_camera camSetPos [3300.73,6864.81,0.05]
_camera camSetFOV 0.700
_camera camCommit 0
@camCommitted _camera
titlecut ["", "black in", 2]
~3

titletext ["It's sure getting cold now", "plain down"]
~4

titletext ["Yeah... Sheesh... I'm sure it was warmer only a minute ago.", "plain down"]
~5

titletext ["Well, it's midday. Guess it's time to go on patrol. See you in a few minutes", "plain down"]
~3

manmove1 = true

;=== 23:40:14
_camera camSetTarget [17439.53,105858.75,853.34]
_camera camSetPos [3300.21,6865.15,1.88]
_camera camSetFOV 0.700
_camera camCommit 3
@camCommitted _camera

titletext ["Ok Uri, see you back here soon", "plain down"]
~3

;=== 23:40:34
_camera camSetTarget [18257.35,-92008.19,853.13]
_camera camSetPos [3300.21,6865.15,1.88]
_camera camSetFOV 0.700
_camera camCommit 4
@camCommitted _camera

6 setfog 1
~10

titleCut ["","BLACK OUT", 2]
titleCut ["","BLACK IN", 2]

_who = Uri_1;
   
_dx = 1;
_dy = 0;
_dz = 1.7;

   
#Loop
   
   
;=== 17:26:18
_camera camSetTarget _who
camera camSetPos [(getpos _who select 0) + (_dx * sin getdir _who), (getpos _who select 1) + (_dx * cos getdir _who), (getpos _who select 2)+_dz]
_camera camSetFOV 0.700
_camera camCommit 0
@camCommitted _camera
   
? gaskameraend : goto "Next"

goto "Loop"

#Next


Proud Member of the Volunteer Commando Battalion

Offline .pablo.

  • Former Staff
  • ****
  • When in doubt, empty the magazine.
Re:look at player.
« Reply #6 on: 31 Jul 2003, 02:35:06 »
ok what's this:
Quote
titleCut ["","BLACK OUT", 2]
titleCut ["","BLACK IN", 2]

and this:
Quote
? gaskameraend : goto "Next"

?

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:look at player.
« Reply #7 on: 31 Jul 2003, 02:44:07 »
that fades out from the last scene into the follow scene - that part is fine, since it worked before i tried what Sui said..

the condition gaskameraend is one which is activated by a trigger (which hasnt been placed yet) that ends the loop
Proud Member of the Volunteer Commando Battalion

Offline .pablo.

  • Former Staff
  • ****
  • When in doubt, empty the magazine.
Re:look at player.
« Reply #8 on: 31 Jul 2003, 02:46:55 »
Quote
the reason its fading in at the same pos is because the camera doesn't exist yet when u fade back in.

and if it is stayin at the same pos but still following the guy, it looks like its because gaskameraend is = to true.  try takin out that line and try again


and by camera not existing i mean the camera's position has not been changed yet
« Last Edit: 31 Jul 2003, 02:47:30 by .pablo. »

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:look at player.
« Reply #9 on: 31 Jul 2003, 02:52:55 »
it has... since there is no time gap between the fae in and fade out it doesnt make a difference... listen... ive tried the script i posted first AND EVERYTHING WORKED but the position of the camera... now after trying Suis script, nothing works...   ::)
Proud Member of the Volunteer Commando Battalion

Offline .pablo.

  • Former Staff
  • ****
  • When in doubt, empty the magazine.
Re:look at player.
« Reply #10 on: 31 Jul 2003, 03:23:22 »
well the only difference i see between his and yours is the placement of 1 set of ( ).

your old one:
_dx * sin (getdir _who)

your new one:
(_dx * sin getdir _who)

maybe sin is expecting getdir to be a variable or something and so the setpos command isn't working...

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:look at player.
« Reply #11 on: 31 Jul 2003, 03:26:24 »
i'll try that..... cheers  ;D
Proud Member of the Volunteer Commando Battalion

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:look at player.
« Reply #12 on: 01 Aug 2003, 03:39:46 »
Hmm... Your code:

Code: [Select]
_camera camSetTarget _who
camera camSetPos [(getpos _who select 0) + (_dx * sin getdir _who), (getpos _who select 1) + (_dx * cos getdir _who), (getpos _who select 2)+_dz]
_camera camSetFOV 0.700
_camera camCommit 0
@camCommitted _camera

Take a long hard look at your camsetpos line, and tell me what the difference is between that and your other lines....

Let me give ya a hint... _ !!! ;D ;D

Sorry for not picking that up, I'm getting old ;)


Oh, Pablo:

The difference between Messy's original line and the one I fed him was much larger than that, as you'd see if you went back and had a look ;)

Sin will always want a number, in degrees. Getdir _who will give it the direction as a bearing, that _who is facing.
It's basic trigonometry... in other words: A pain in the arse ;D

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:look at player.
« Reply #13 on: 01 Aug 2003, 12:01:08 »
lol.... ffs... how did i miss that.... i'm getting old as well  ::)
Proud Member of the Volunteer Commando Battalion

Offline Burn

  • Members
  • *
Re:look at player.
« Reply #14 on: 02 Aug 2003, 13:22:01 »
 ???...18 ...is old :-\...  ::)I think it's just to much booze ;D, all that drinking with Wolfsbane is startin to take it's price?! lol ;D ...Soon you will become as slow and brainless as me :P ...well maby not as slow as me, wus getting alitle carried away there ::)...
 :cheers:
« Last Edit: 02 Aug 2003, 13:27:23 by Bizon »