Home   Help Search Login Register  

Author Topic: tracker for shaking  (Read 3501 times)

0 Members and 1 Guest are viewing this topic.

Offline Surdus Priest

  • Members
  • *
  • Only I can Forgive You!
Re: tracker for shaking
« Reply #15 on: 10 Jun 2007, 16:59:42 »
so how to i check the conditions?
Campaigns are hard, I'll stick with scripting for now!

Offline Surdus Priest

  • Members
  • *
  • Only I can Forgive You!
Re: tracker for shaking
« Reply #16 on: 10 Jun 2007, 17:06:45 »
actuualy, it would be all i need to know how to make the shaker, track the current position of the camera. so all i need to know, is what this does:

_ox = getPos _cam select 0
_oy = getPos _cam select 1
_oz = getPos _cam select 2
Campaigns are hard, I'll stick with scripting for now!

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: tracker for shaking
« Reply #17 on: 10 Jun 2007, 17:08:29 »
just punt a hint format["%1 %2 %3", _ox, _oy, _oz] and youll find out what that does

Offline Surdus Priest

  • Members
  • *
  • Only I can Forgive You!
Re: tracker for shaking
« Reply #18 on: 10 Jun 2007, 17:51:30 »
this is what i've done so far, this is the Movement Capsule, its the target for my shaker:

;==Movement Start==
x = ###
y = ###
z = ###
cam camsettarget ###
cam camsetrelpos [x,y,z]
cam camcommit ###
;==Movement End==

Use it as you would use any camera position.  what this does is sets the values to an alternative path.  This will allow you to use the shaker more effectively.

This is my shaker, i called it the Violence Factor:

; *****************************************************
; ** Violence Factor - Advanced Shake
; *****************************************************

;Execute = [Camera Name] exec "Advanced_Shake.sqs"

;--Do Not Modify--
_cam = _this select 0
_tshake = 0.1
;--Do Not Modify--

;Initial Pause - Required to Synchronize with Explosion
~0.5

;Duration - Time Until Shake Ends
_shake = 2

;Violence Level - Level of Shake Distance
_v = 0.8

;Positions - Standard x,y,z (According to Movement Capsules)
_x = x
_y = y
_z = z

;Loop Name
#shake1

;--Do Not Modify--
_shake = _shake - _tshake
_cam camSetRelPos [_x + random _v,_y + random _v,_z + random _v]
;--Do Not Modify--

;Cool Down - Fading Shake Duration (Use at own Risk)
_v = _v - 0.

;Loop Duration - Modifies the speed of shake (Use at own Risk)
_cam camCommit 0.025
~0.025

;End Loop - Modify "goto" target only (Use is Necessary)
? _shake > 0.1 : goto "shake1"





So far i have created a basic version which can be implemented directly into the camera script, but its not as effective with explosions as my advanced version.  this version allows a great amount of flexibility, and it automatically refers to the camera script, it is important however that if you use this shaker, you must use the movement capsule, but you only need to use them when you gonna do the shake (although the capsule may have other oppotunities)

The only problem with this shaker is that it doesnt work when the camera is moving from position to position.  How ever it does work with what i call a Follower, a Basic Tracker, this is a Follower:

;==TRACK START==
_tfollow = 0.1
_follow = 2

;Positions
_x = ###
_y = ###
_z = ###

#follow1
_follow = _follow - _tfollow
_cam camsetrelpos [_x,_y,_x]
_cam camcommit 0.01
~0.01
? _follow > 0.1 : goto "follow1"
;==TRACK END==

Because the positions are reset every 0.01 seconds, the shaker will work just fine with this.



My final goal now, is to make a shaker that can work on cameras which are moving positions.  Because what my shaker will do if the camera is not still (or not tracking), it will jump to the destinate position, and will not look that good.
Campaigns are hard, I'll stick with scripting for now!

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: tracker for shaking
« Reply #19 on: 10 Jun 2007, 19:04:39 »
Surdus Priest
- Like already said (in couple of other threads) use the code tags when posting long pieces of code.
- You have not only violated our double posting rule but you have triple posted.
   If you have something to add to your post after a short period of time (we'd prefer that about 3 days should pass), modify your post instead of replying
   to yourself.
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.