Difference between revisions of "0136"

From GTAMods Wiki
Jump to navigation Jump to search
(Created page with "{{OpCode | games = {{Icon|3}} | command = SHAKE_CAM_WITH_POINT | description = Shakes the in-game camera | syntax1 = 0136: shake_camera [''int''] with_point [''f...")
 
(highlight)
Line 18: Line 18:
 
== For Vice City ==
 
== For Vice City ==
 
This opcode does not exist in Vice City but it is possible to recreate this opcode since camera shaking based on location is already featured in the game (like when cars explode). Vice City improved upon this feature in that the initial duration and intensity of the shaking is dependent on the camera's distance from the point. The following example, using Sanny Builder with [[CLEO]] for Vice City in an external script (not the main one) and tested on US v1.0, should work similarly to this opcode. Place this at the end of the file:
 
This opcode does not exist in Vice City but it is possible to recreate this opcode since camera shaking based on location is already featured in the game (like when cars explode). Vice City improved upon this feature in that the initial duration and intensity of the shaking is dependent on the camera's distance from the point. The following example, using Sanny Builder with [[CLEO]] for Vice City in an external script (not the main one) and tested on US v1.0, should work similarly to this opcode. Place this at the end of the file:
<syntaxhighlight lang="scm">
+
{{Pre|class=sb-code|1=
:opcode_0136
+
<span class="nl">:opcode_0136</span>
// 0@ - input param (intensity/duration)
+
<span class="c1">// 0@ - input param (intensity/duration)</span>
// 1@ - input param (x-coordinate)
+
<span class="c1">// 1@ - input param (x-coordinate)</span>
// 2@ - input param (y-coordinate)
+
<span class="c1">// 2@ - input param (y-coordinate)</span>
// 3@ - input param (z-coordinate)
+
<span class="c1">// 3@ - input param (z-coordinate)</span>
0093: 0@ = integer_to_float 0@
+
0093: <span class="nv">0@</span> = integer_to_float <span class="nv">0@</span>
0@ *= 0.001
+
<span class="nv">0@</span> *= <span class="m">0.001</span>
05E3: call_method 0x46FF21 0x7E4688 num_params 4 pop 0 z 3@ y 2@ x 1@ time 0@
+
05E3: call_method <span class="m">0x46FF21</span> <span class="m">0x7E4688</span> num_params <span class="m">4</span> pop <span class="m">0</span> z <span class="nv">3@</span> y <span class="nv">2@</span> x <span class="nv">1@</span> time <span class="nv">0@</span>
05F6: ret 0
+
05F6: ret <span class="m">0</span>
</syntaxhighlight>
+
}}
  
 
Use this line as a substitute for opcode 0136. This can be placed anywhere within the external script:
 
Use this line as a substitute for opcode 0136. This can be placed anywhere within the external script:
<syntaxhighlight lang="scm">
+
{{Pre|class=sb-code|1=
05F5: call_scm_func @opcode_0136 inputs 4 time [int] x [flt1] y [flt2] z [flt3]
+
05F5: call_scm_func <span class="nl">@opcode_0136</span> inputs <span class="m">4</span> time [int] x [flt1] y [flt2] z [flt3]
</syntaxhighlight>
+
}}
  
 
== Keywords ==
 
== Keywords ==
Line 40: Line 40:
 
== See also ==
 
== See also ==
 
* {{Icon|t}} [[0003]], shake camera without point
 
* {{Icon|t}} [[0003]], shake camera without point
 
[[Category:Code Snippets]]
 

Revision as of 04:54, 7 December 2016

GTA III SHAKE_CAM_WITH_POINT


Description
Shakes the in-game camera
Syntax
0136: shake_camera [int] with_point [flt1] [flt2] [flt3]
Parameter
[int]
Intensity and duration of the shaking
[flt1]
X-coordinate
[flt2]
Y-coordinate
[flt3]
Z-coordinate

This opcode shakes the in-game camera for a while. The higher the integer value is, the more and the longer the camera shakes. The shaking of the camera depends if the camera's location, not the player's location, is within 100 units of the specified coordinates point. The duration and intensity is independent of that point. Leaving or entering the area after the opcode is called does not change the behavior of the shaking. This opcode was never called in the original script of GTA III.

For Vice City

This opcode does not exist in Vice City but it is possible to recreate this opcode since camera shaking based on location is already featured in the game (like when cars explode). Vice City improved upon this feature in that the initial duration and intensity of the shaking is dependent on the camera's distance from the point. The following example, using Sanny Builder with CLEO for Vice City in an external script (not the main one) and tested on US v1.0, should work similarly to this opcode. Place this at the end of the file:

:opcode_0136
// 0@ - input param (intensity/duration)
// 1@ - input param (x-coordinate)
// 2@ - input param (y-coordinate)
// 3@ - input param (z-coordinate)
0093: 0@ = integer_to_float 0@
0@ *= 0.001
05E3: call_method 0x46FF21 0x7E4688 num_params 4 pop 0 z 3@ y 2@ x 1@ time 0@
05F6: ret 0

Use this line as a substitute for opcode 0136. This can be placed anywhere within the external script:

05F5: call_scm_func @opcode_0136 inputs 4 time [int] x [flt1] y [flt2] z [flt3]

Keywords

shake, jostle, cam, camera, point

See also

  • GTA III Vice City San Andreas 0003, shake camera without point