Author Topic: Introduction to SCM coding VC\LC camera moves  (Read 8406 times)

0 Members and 1 Guest are viewing this topic.

Offline Neo Anderson

  • ATS precision whore
  • Veteran Member
  • Posts: 5079
  • Registered on: April 16, 2004
    • View Profile
Introduction to SCM coding VC\LC camera moves
« on: June 04, 2007, 08:09:05 AM »
This again is a very basic tutorial on camera movement in SCM coding. This is the same script I used for the other SCM coding tutorial. I just added camera moves. I will attach this main.scm.TXT below. Again place this txt in your VC DATA folder, open Mission Builder, open this txt and press F7. It will over write the main.scm so BACKUP your main.scm.

There are two ways to do camera moves in game by coding them.

1. Using a preset camera move(already coded into the game and unchangable) This is the code for those.

0158: camera_on_vehicle  400??  3?  2?
0159: camera_on_ped  28??  4?  2?

First number (400?? or 28??)is either the ped or car you wish the camera to point at.
The second is the position of the camera relative to either the car or ped.
Third is whether the camera will "pan" to it's position(1?) or "jump" to it's position(2?)
Most of the precoded camera positions suck so I don't and haven't used them very much.
I dunno if there is a list of preset ones or not.

2. By using your own with the proper opcodes.

015F: set_camera_position 372.51!  244.48!  10.82!  0!  0!  0!
0160: point_camera 372.51!  238.48!  10.82!  1?
0460: set_camera_pointing_time  0!  5000&
0001: wait  5000& ms


First opcode 015F: set_camera_position 372.51!  244.48!  10.82!  0!  0!  0!
This is like car or ped position X! Y! Z!
The last 3 numbers 0! 0! 0! tilt the camera while it's in it's position. I've never played much with them.

Second opcode 0160: point_camera 372.51!  238.48!  10.82!  1?
This tells the camera to point somewhere X! Y! Z!
The last number in this code 1? tells the camera to "pan" over to this position

Third opcode 0460: set_camera_pointing_time  0!  5000&
Tells how long the camera will point at a given car, ped or spot. In this case it's 5 seconds.

And fourth opcode 0001: wait  5000& ms
This is just how long before the camera waits to make it's next move or before the next line of code begins.
If this opcodes time is "less" than the camera pointing time, the next camera move or line of code will begin before the camera finishes it movement.


-------------------------------------------------------------------------------------------------------------------------------

DEFINE VERSION VICE 0.22

0002: jump ££Label008620
DEFINE MEMORY  34329

:Label008620
0002: jump ££Label008644
DEFINE OBJECTS  1
DEFINE OBJECT DOOR                        \\ This is an unused object. You can put anything here.

:Label008644
0002: jump ££Label008658
DEFINE MISSIONS  0

;-------------MAIN---------------


:Label008658
03A4: name_thread "MAIN"
016A: fade  0? ()  0? ms
01F0: set_max_wanted_level_to  0?
03AD: toggle_rubbish  0?
03DE: set_pedestrians_density_multiplier_to  0?
01EB: set_car_density_to  0?
0111: set_wasted_busted_check_to  0? (disabled)
00C0: set_current_time  10?  0?
04E4: unknown_refresh_game_renderer_at  380.60!  253.15!
03CB: set_camera  380.60!  253.15!  15.43!
0053: $PLAYER_CHAR = create_player #NULL at  380.60!  253.15!  15.43!
01F5: $PLAYER_ACTOR = create_emulated_actor_from_player $PLAYER_CHAR
0330: set_player $PLAYER_CHAR infinite_run_to  1? (true)
0001: wait  0? ms
01B6: set_weather  0?
00D6: if  0?
8118:   NOT   actor $PLAYER_ACTOR dead
004D: jump_if_false ££Label0086EF
0352: set_actor $PLAYER_ACTOR skin_to "PLAYER"
038B: load_requested_models
0353: refresh_actor $PLAYER_ACTOR
0222: set_player  2228?? health_to  100!

:Label0086EF
016A: fade  1? (back)  1000& ms
00D6: if  0?
0256:   player $PLAYER_CHAR defined
004D: jump_if_false ££Label0086EF
04BB: select_interiour  0?  \\ select render area
01B4: set_player $PLAYER_CHAR frozen_state  1? (unfrozen)
01B7: release_weather

:Label008700
0001: wait  1000& ms
0247: request_model #PCJ600
0247: request_model #INFERNUS
0247: request_model #UZI
0247: request_model #ARMY
0247: request_model #TEC9
0247: request_model #BKA
00D6: if  0?
8248:   NOT   model #PCJ600 available
8248:   NOT   model #INFERNUS available
8248:   NOT   model #UZI available
8248:   NOT   model #ARMY available
8248:   NOT   model #TEC9 available
8248:   NOT   model #BKA available
004D: jump_if_false ££Label008706
0001: wait  1000& ms
0002: jump ££Label008700

:Label008706
038B: load_requested_models
0001: wait  1000& ms
0002: jump ££Label008711

:Label008711
0001: wait  1000& ms
00A5:  400?? = create_car #INFERNUS at 338.58!  239.19!  11.37!
0175: set_car  400?? z_angle_to  270!
00AE: unknown_set_car  400?? to_ignore_traffic_lights  1?
00AD: set_car  400?? max_speed_to  0!
02AC: set_car  400?? immunities  1?  1?  1?  1?  1?
0129:  28?? = create_actor  4? #ARMY in_car  400?? driverseat
01B2: give_actor  28?? weapon  22? ammo  100&
02E2: set_actor  28?? weapon_accuracy_to  99?
0350: unknown_actor  28?? not_scared_flag  1?
0002: jump ££Label008717

:Label008717
0001: wait  1000& ms
00A5:  404?? = create_car #PCJ600 at 408.77!  239.58!  10.88!
0175: set_car  404?? z_angle_to  90!
00AE: unknown_set_car  404?? to_ignore_traffic_lights  1?
00AD: set_car  404?? max_speed_to  0!
02AC: set_car  404?? immunities  1?  1?  1?  1?  1?
0129:  32?? = create_actor  4? #BKA in_car  404?? driverseat
01B2: give_actor  32?? weapon  23? ammo  100&
02E2: set_actor  32?? weapon_accuracy_to  29?
0350: unknown_actor  32?? not_scared_flag  1?
0002: jump ££Label008722

:Label008722
0001: wait  2000& ms
0158: camera_on_vehicle  400??  3?  2?
02C2: car  400?? drive_to_point 372.51!  238.48!  10.82!
00AD: set_car  400?? max_speed_to  10!
0001: wait  1000& ms
02C2: car  404?? drive_to_point 381.83!  241.16!  10.61!
00AD: set_car  404?? max_speed_to  10!
0002: jump ££Label008729

:Label008729
0001: wait  7000& ms
015F: set_camera_position 372.51!  244.48!  10.82!  0!  0!  0!
0160: point_camera 372.51!  238.48!  10.82!  1?
0460: set_camera_pointing_time  0!  5000&
0001: wait  5000& ms

03E2: actor  28?? exit_car
03E2: actor  32?? exit_car
0001: wait  3500& ms
0211: actor  28?? walk_to 368.27! 242.45!
0211: actor  32?? walk_to 385.78! 236.38!
015F: set_camera_position 372.51!  244.48!  10.82!  0!  0!  0!
0160: point_camera 385.78! 236.38!  10.82!  1?
0460: set_camera_pointing_time  0!  5000&
0001: wait  8000& ms

020E: actor  28?? look_at_actor  32??
020E: actor  32?? look_at_actor  28??
015F: set_camera_position 370.27! 241.45!  11.32!  0!  0!  0!
0160: point_camera 368.27! 242.45!  11.32!  2?
0460: set_camera_pointing_time  0!  2000&
0001: wait  2000& ms
015F: set_camera_position 384.08! 237.38!  10.82!  0!  0!  0!
0160: point_camera 385.78! 236.38!  10.82!  2?
0460: set_camera_pointing_time  0!  2000&
0001: wait  2000& ms

0002: jump ££Label008733

:Label008733
015F: set_camera_position 382.60!  252.15!  14.43!  0!  0!  0!
0160: point_camera 378.80!  243.15!  10.82!  2?
0460: set_camera_pointing_time  0!  5000&
0001: wait  4000& ms

01C9: actor  28?? kill_actor  32??
0002: jump ££Label008738

:Label008738
0001: wait  5000& ms
0211: actor  28?? walk_to 383.93! 237.43!
0159: camera_on_ped  28??  4?  2?
0001: wait  14000& ms
015F: set_camera_position 385.43! 237.43!  10.82!  0!  0!  0!
0160: point_camera 382.93! 237.43!  10.82!  2?
0460: set_camera_pointing_time  0!  5000&
0001: wait  4000& ms

04EB: 28?? make_actor_crouch  1? 3000& ms
015F: set_camera_position 385.43! 237.43!  10.82!  0!  0!  0!
0160: point_camera 382.93! 237.43!  9.82!  1?
0460: set_camera_pointing_time  0!  500&
0001: wait  2000& ms

01D5: actor  28?? go_to_and_drive_car  404??
00AD: set_car  404?? max_speed_to  0!
0158: camera_on_vehicle  404??  3?  2?
0001: wait  4500& ms
02C2: car 404?? drive_to_point 319.93! 244.77! 11.45!
00AD: set_car 404?? max_speed_to 30!
0002: jump ££Label008743

:Label008743
0001: wait  1000& ms
0002: jump ££Label008743
« Last Edit: June 11, 2010, 03:05:22 PM by Neo Anderson »

Offline VenomX

  • Veteran Member
  • Posts: 4294
    • View Profile
Introduction to SCM coding VC\LC camera moves
« Reply #1 on: June 04, 2007, 09:28:14 AM »
Quote
Third opcode 0460: set_camera_pointing_time 0! 5000&

Nice little tutorial there, I didn't know about the actor following thing.

Doesn't opcode 0460: work if you only type it once for successive camera moves of the same time?  I was trying to input it twice, but my main didn't like it .

Offline JayFoxRox

  • Posts: 2221
    • View Profile
    • Homepage
Introduction to SCM coding VC\LC camera moves
« Reply #2 on: June 04, 2007, 10:11:51 AM »
VenomX: Check vc-db.webtools4you.net for updates on opcodes
there is also camera_on_actor or something, just try typing camera_on, then hit F1, it should look for commands having the text camera_on in them

Offline DJS

  • Veteran Member
  • Posts: 755
  • Click my sig yo
    • View Profile
    • YouTubz
Introduction to SCM coding VC\LC camera moves
« Reply #3 on: June 22, 2007, 08:57:24 AM »
Quote
0158: camera_on_vehicle 400?? 3? 2?

First number (400?? or 28??)is either the ped or car you wish the camera to point at.
The second is the position of the camera relative to either the car or ped.
Third is whether the camera will "pan" to it's position(1?) or "jump" to it's position(2?)
Most of the precoded camera positions suck so I don't and haven't used them very much.
I dunno if there is a list of preset ones or not.

What do you mean? Does it change like a the normal camera like if you press "home" (default)

EDIT: help would be nice
« Last Edit: June 22, 2007, 09:32:24 AM by DJS »

Offline Neo Anderson

  • ATS precision whore
  • Veteran Member
  • Posts: 5079
  • Registered on: April 16, 2004
    • View Profile
Introduction to SCM coding VC\LC camera moves
« Reply #4 on: June 22, 2007, 02:23:29 PM »
What I mean is where the camera is in relation to either the car or ped. Like the camera will be behind, infront, 10 ft away or 50 ft away. This is an in game code for the camera (0158: camera_on_vehicle 400?? 3? 2?) meaning it is preset to be where the game makers wanted it. First number in this case is the car(400?), the second number(3?) is the postion of the camera and the third number(2?) tells the camera to pan to this location instead of jumping. Just a note about these "built in" camera postions, 98% of them suck anyways.  

Offline DJS

  • Veteran Member
  • Posts: 755
  • Click my sig yo
    • View Profile
    • YouTubz
Introduction to SCM coding VC\LC camera moves
« Reply #5 on: June 23, 2007, 07:32:33 AM »
Ok but is there anyway to tell whatt number does what? That would be nice
« Last Edit: June 23, 2007, 07:33:01 AM by DJS »

Offline Neo Anderson

  • ATS precision whore
  • Veteran Member
  • Posts: 5079
  • Registered on: April 16, 2004
    • View Profile
Introduction to SCM coding VC\LC camera moves
« Reply #6 on: June 23, 2007, 09:16:34 AM »
Nope, you just have to try them. I think there's maybe....4 or 5 out of about 50 that even do anything. Sooooo it's just a waste of time to even bother with them.

Offline Labiloute

  • Veteran Member
  • Posts: 2502
    • View Profile
    • YouTube Channel
Introduction to SCM coding VC\LC camera moves
« Reply #7 on: July 19, 2007, 12:48:53 PM »
Hi Neo nice tutorial for the forum but, i want to know how can i do my main scm for my intro video  

During 20 days i search how can i change it but now im so lazy to find how can i just do nice camera moves  


Please if you are here can u show me and show at all with the same tutorial of vice very thanks


TUTORIAL VIDEO  OMG  


Bye Neo
« Last Edit: July 20, 2007, 01:47:55 AM by Labiloute »

Offline DJS

  • Veteran Member
  • Posts: 755
  • Click my sig yo
    • View Profile
    • YouTubz
Introduction to SCM coding VC\LC camera moves
« Reply #8 on: July 19, 2007, 01:45:21 PM »
I messed up , i thought you posted in the part wihtout camera moves
just dont read this
« Last Edit: July 19, 2007, 01:47:44 PM by DJS »

Offline Neo Anderson

  • ATS precision whore
  • Veteran Member
  • Posts: 5079
  • Registered on: April 16, 2004
    • View Profile
Introduction to SCM coding VC\LC camera moves
« Reply #9 on: July 19, 2007, 02:07:46 PM »
I'm kinda lost as to what you need man.  

Offline Labiloute

  • Veteran Member
  • Posts: 2502
    • View Profile
    • YouTube Channel
Introduction to SCM coding VC\LC camera moves
« Reply #10 on: July 20, 2007, 02:04:59 AM »
I would like to make cameras moves in san andreas for my future intro video

por exemple this intro is awesome

http://fr.youtube.com/watch?v=2EIk0txXxPg

I just want to know how can i do that in san andreas not in VC

Offline Neo Anderson

  • ATS precision whore
  • Veteran Member
  • Posts: 5079
  • Registered on: April 16, 2004
    • View Profile
Introduction to SCM coding VC\LC camera moves
« Reply #11 on: July 20, 2007, 05:58:57 AM »
Oh ok. I've never coded in SA though so I'm unsure how things work in that particular GTA game.

Offline Labiloute

  • Veteran Member
  • Posts: 2502
    • View Profile
    • YouTube Channel
Introduction to SCM coding VC\LC camera moves
« Reply #12 on: July 20, 2007, 06:43:04 AM »
So ok but i think J.Fox know how can make some camera moves in SA.
But don't found any tutorial for SA  

Offline Archeon

  • Posts: 47
    • View Profile
Introduction to SCM coding VC\LC camera moves
« Reply #13 on: March 23, 2008, 03:21:20 PM »
I think someone should make a tut for sa SCM coding its confusing even though the codes are same as vc... @ lab just watched the intro to new XSA i loved the intro i would like to code like that but don't know where to start  

Offline Pendji

  • Veteran Member
  • Posts: 5646
    • View Profile
Introduction to SCM coding VC\LC camera moves
« Reply #14 on: March 23, 2008, 03:26:43 PM »
This bump (in a sticky thread ) reminds me i wanted to get into this.. i look closer when all my vid projects is over

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal