Home   Help Search Login Register  

Author Topic: sniper optics in cam script -- edited my last post  (Read 1658 times)

0 Members and 1 Guest are viewing this topic.

Offline nettrucker

  • Members
  • *
  • Too young to die-OFP Campaign by TOY & nettrucker
sniper optics in cam script -- edited my last post
« on: 25 Sep 2007, 21:53:33 »
Hi everybody

can someone point me in direction where to find some info on what different commands to use in camera script for eg for sniper optics. Binocular TV set etc. I'm really tired of searching I saw something which explained it but I'm damned if I remember where I saw it. :dunno:
Thanks for any hint.
regards
nettrucker :)

edit: forgot NVGoggles
« Last Edit: 29 Sep 2007, 22:49:17 by nettrucker »

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re: sniper optics in cam script
« Reply #1 on: 25 Sep 2007, 22:51:45 »
yeah heres wat u lokin 4

A thread :P

also... 2 use NVGs u can use da camusenvg command :D

LCD OUT
« Last Edit: 26 Sep 2007, 01:18:47 by Planck »
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline nettrucker

  • Members
  • *
  • Too young to die-OFP Campaign by TOY & nettrucker
Re: sniper optics in cam script
« Reply #2 on: 26 Sep 2007, 22:25:22 »
Hello LCD
thanks for pointing me to this thread. I'll downloaded the intro.zip and I gonna have a look at it right now. I'll hope that i'll be able to get it to work since i'm a real noob when it comes down to scripting. :D
nettrucker out!


Edit: 29/09/07 22.43


Hi everybody
I need some help. :dunno:
Still got some troubles with positioning the sniper scope towards the target. I would like to position the sniper scope at the position where I actually placed the sniper on the map. And it should seem that you actually would see through the sniper's scope. I would like to make the scope follow the target since it's  moving. I'm having some troubles though to understand what values and where to change them. i'm tweaking for 2 days now but I'm unable to achieve what I want.

1.)I need to run the sniper scope script so that it'll be placed on screen meanwhile the intro.sqs is already running

2.) it should be positioned at the snipers pos on map with distance and azimuth ( I mean by that the right angle ) towards the target, it's just a sequence of a couple of seconds that I need it to run, then it should turn to the default view.

3.) how can I make the scope following the target while moving?

4.) Can I run multiple scripts  executing them from the main script? (in this case I would have to execute the scope script within the intro.sqs )

5.) MySniper SwitchCamera "gunner" -- seems not to work for a single object, it might work for a vehicle crew though, I haven't tried it.

6.) I have only basic knowledge about camscripting.

7.) Moreover I have serious difficulties to understand the preparecam commands I'm doing something wrong can't get it to work. :dunno:

8.) I use mostly following commands

_cam camsettarget e1
_cam camsetrelpos [8,-12,1.8]
_cam camSetFOV 0.100
_cam camcommit 0
@camcommitted _cam
~8

I like them especially on moving targets because the angles of the camera are never the same they are always some slight changes and the intro's & outro's are always slightly different. For me it's never boring to watch them. One negative aspect is that you might have bad angles especially in Urban areas or when close to objects.

Thanks for some help and advice.
regards
nettrucker :scratch:

Edit: 10/01/2007 12.45
Hi everybody
I used this code from johnny boy. After a lot of tweakening the only way it would work is how johnnyboy did it. This is the code for the  description.ext

Code: [Select]
#define CT_OBJECT 80

class RscObject
{
type = CT_OBJECT;
scale = 1.0;
direction[] = {0, 0, 1};
up[] = {0, 1, 0};
};

class RscTitles {
titles[] = {M24};
class M24 {
idd=-1;
movingEnable = false;
duration=100;
name = "binocular";
objects[]= {binocular};
class binocular : RscObject {
model= "optika_sniperw.p3d";
idc= -1;
position[] = {0,0,0.063};
direction[] = {sin 0, sin 180 * cos 0, cos 180 * cos 0};
up[] = {0, cos 180, -sin 180};
};
};
};

Now I ran johnnyboys camscript (modified to my needs) within my intro.sqs

Code: [Select]
; intro.sqs
;
_e1 = _this select 0
_camera = "camera" camcreate [14590.00,12721.18,1.19]
_camera cameraeffect ["internal", "back"]

;===========================================
;=== Sniper scope on target
;===========================================
_campos = _e1 modelToWorld [0,9,3]
_camera camPrepareTarget (getpos _e1)
_camera camPreparePos _campos
_camera camPrepareFOV 0.174
_camera camCommitPrepared 0
@camCommitted _camera
cutrsc ["M24","PLAIN"]
~4
titleCut ["","BLACK IN",0.5]
~2
camdestroy _camera
;player switchcamera "INTERNAL";
ForceEnd
exit

How can I get the sniper scope to follow the target ( in this case e1 )?

Some help of you scripting aces would be really appreciated.
thanks in advance
nettrucker
« Last Edit: 01 Oct 2007, 13:03:14 by nettrucker »

Offline Luke

  • Members
  • *
  • Thank God! The OFPEC Staff are here!
Re: sniper optics in cam script -- edited my last post
« Reply #3 on: 18 Jul 2008, 00:21:59 »
How about camera camsettarget target?

Here's YOUR reply, as always.

Luke
Pesky Human!!
Wort Wort Wort.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: sniper optics in cam script -- edited my last post
« Reply #4 on: 18 Jul 2008, 00:56:10 »
Which is what is doing the script postead above but using cameraPrepareTarget (same effect that camSetTarget), and BTW the thread is now almost a year old.

Offline Luke

  • Members
  • *
  • Thank God! The OFPEC Staff are here!
Re: sniper optics in cam script -- edited my last post
« Reply #5 on: 18 Jul 2008, 00:59:37 »
Sorry.
Pesky Human!!
Wort Wort Wort.