Author Topic: [VC] Camera Moves Tutorial  (Read 9678 times)

0 Members and 1 Guest are viewing this topic.

Offline Fugitive

  • Veteran Member
  • Posts: 4883
    • View Profile
    • http://www.fugitivesplace.3x.ro
[VC] Camera Moves Tutorial
« on: July 30, 2006, 09:17:54 AM »
[VC] Camera Moves Tutorial
Do you want to do an intro or a themed vid, but CamHack isn't enough?
Now you will learn how to code camera moves!



First of all make sure you make a backup of the original "main.scm" file, which is located in the "...\GTA Vice City\data" folder.
- this will help you if you won't code the scm propertly, and if the game will crash.

Second, you will need BW's GTA VC Mission Builder version v1.1 - you can download it HERE.
- this will help you to open and view the main.scm file.
- extract the "mission_builder_barton_waterduck.zip" file that you have just downloaded, somewhere in your computer.
- after the extraction completes, you should see a folder named "Stripped scripts". Open it, and copy-paste the "Totally_stripped.txt" file, in your "...\GTA Vice City\data" folder and rename it to "main.scm" - be sure to have the same txt extension! This will remove all scripted features available, like missions, saving and loading saved games, pay-n-sprays etc.

Third, you must have GTA Vice Ultimate Trainer By LithJoe - you can download it HERE.
- you will need a jetpack for your camera settings.

The third thing is to get Player Pos 1.3 - you can download it HERE.
- this will show you the world coordinates of the player (Tommy) in the game. There are more tools like this one, but this one is simple and very easy to use.


And if you want to learn something more, visit kaneda's "Basic Mission Scripting Tutorial" - click HERE.



After you have done all the steps above, the fun part will come.
Open the "ViceBuilder11.exe" file, and a window will appear. Select your GTA Vice City folder.
Now, go to 'File' -> 'Open file', and open the main.scm txt file that you copy-pasted some minutes ago.
Your camera moves code will be between those two lines.
Code: [Select]
; Put your create_thread commands here

:LabelMAIN3



This is how mine looks (I will explain step by step how to make it):
Code: [Select]
; Best for testing purposes, like MAP modding.
; No scripted features available, like no garages set up, saving and loading saved games not possible,
; no interiours, no doors on buildings, no pay-n-spray, no AmmuNations, no shops, no missions, no parked
; cars, no busses at bus stops, no securety.

; This file has been modified from a file I found somewhere. I don't know who's the original writer.

DEFINE VERSION VICE 1.1

0002: jump ££SecondSegment
DEFINE MEMORY 34329

:SecondSegment
0002: jump ££ThirdSegment
DEFINE OBJECTS 1
DEFINE OBJECT (no name)      \\ This is an unused object. You can put anything here.

:ThirdSegment
0002: jump ££LabelMAIN
DEFINE MISSIONS 0

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

:LabelMAIN
03A4: name_thread "MAIN"
016A: fade 0  0 ms
01F0: set_max_wanted_level_to 6
0111: set_wasted_busted_check_to 0 (disabled)  
00C0: set_current_time 12 0
04E4: unknown_refresh_game_renderer_at 83.0 -849.8
03CB: set_camera 83.0 -849.8 9.3
0053: $PLAYER_CHAR = create_player #NULL at 80.0 -849.8 9.3
01F5: $PLAYER_ACTOR = create_emulated_actor_from_player $PLAYER_CHAR
0001: wait 0 ms
01B6: set_weather 0
00D6: if 0
8118:   NOT   actor $PLAYER_ACTOR dead
004D: jump_if_false ££LabelMAIN2
0352: set_actor $PLAYER_ACTOR skin_to "PLAYER"
038B: load_requested_models
0353: refresh_actor $PLAYER_ACTOR

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

; Put your create_thread commands here





; -------------------- CAMERA MOVES CODE STARTS HERE --------------------
 
  
; --- Init scene ---                      
01B4: set_player $PLAYER_CHAR frozen_state  0 (frozen)
02A3: toggle widescreen  1 (on)
016A: fade  0 ()  1000 ms
0001: wait  1000 ms
016A: fade  1 ()  1000 ms
0460: set_camera_pointing_time  0.0  3000  
    
              
              
; --- Part 1 ---
015F: set camera position  507.909 -96.571 9.655  0.0  0.0  0.0
0160: point camera  502.396 -90.854 11.109  2
0001: wait  7000 ms
015F: set camera position  542.440 -103.905 23.590  0.0  0.0  0.0
0160: point camera  568.199 -93.754 30.975  1
    
            
            
; --- Part 2 ---
015F: set camera position  542.440 -103.905 23.590  0.0  0.0  0.0
0160: point camera  568.199 -93.754 30.975  1
0001: wait  4000 ms
015F: set camera position  364.927 -184.847 54.475  0.0  0.0  0.0
0160: point camera  341.394 -234.935 35.997  1
        
                
                
; --- Part 3 ---
015F: set camera position  356.038 -178.472 48.471  0.0  0.0  0.0
0160: point camera  342.037 -218.214 34.900  1
0001: wait  4000 ms
015F: set camera position  119.070 -293.952 34.477  0.0  0.0  0.0
0160: point camera  107.932 -299.516 30.977  1
    
              
                  
; --- Back to normal game ---
0001: wait  5000 ms
016A: fade  0 ()  1000 ms
0001: wait  1000 ms
02A3: toggle widescreen  0 (off)
01B4: set_player $PLAYER_CHAR frozen_state  1 (unfrozen)
02EB: restore_camera_with_jumpcut
016A: fade  1 ()  1000 ms



; -------------------- CAMERA MOVES CODE ENDS HERE --------------------





:LabelMAIN3
0001: wait 2500 ms
0002: jump ££LabelMAIN3

; Put your mission mods here



Now you must read carefully, because any letter or any digit that you add in the incorrect place, will make the game to crash. However, if you want to add some notes in the script, use ";" before the line, so that line won't be red or executed by the game. Example:
Code: [Select]
0053: $PLAYER_CHAR = create_player #NULL at 80.0 -849.8 9.3;; this is the player's spawn coordinatesSo the "this is the player's spawn coordinates" text won't be read by the game.






Code: [Select]
; --- Init scene ---                      
01B4: set_player $PLAYER_CHAR frozen_state  0 (frozen)
02A3: toggle widescreen  1 (on)
016A: fade  0 ()  1000 ms
0001: wait  1000 ms
016A: fade  1 ()  1000 ms
01B4: set_player $PLAYER_CHAR frozen_state  0 (frozen) - This will freeze the player (Tommy), so you can't control him until an opcode to unfreeze it is wrote. 0 = frozen, 1 = unfrozen.
02A3: toggle widescreen  1 (on) - I think you already know what this opcode is doing. It switches to widescreen, and it won't be deactivated until you write an opcode to deactivate it. 0 = off, 1 = on
016A: fade  0 ()  1000 ms - This will start a fade out. 1000 is the fading's time in miliseconds. 1000 ms = 1 second. 0 = fade out, 1 = fade in.
0001: wait  1000 ms - This is the time till the fade in starts.
016A: fade  1 ()  1000 ms - This will start the fade in. 1000 is the fading's time in miliseconds. 1000 ms = 1 second. 0 = fade out, 1 = fade in.
0460: set_camera_pointing_time  0.0  3000 -  This is the time that the camera will need. 1500 = default. I added 3000 because I want slower camera moves.





Code: [Select]
; --- Part 1 ---
015F: set camera position  507.909 -96.571 9.655  0.0  0.0  0.0
0160: point camera  502.396 -90.854 11.109  2
0001: wait  7000 ms
015F: set camera position  542.440 -103.905 23.590  0.0  0.0  0.0
0160: point camera  568.199 -93.754 30.975  1
015F: set camera position  507.909 -96.571 9.655  0.0  0.0  0.0 - This will tell from where is watching. All you need to do is just to add your coordonaties (X,Y,Z) in the first three float numbers.
0160: point camera  502.396 -90.854 11.109  2 - Where is watching before the camera move starts.  Replace the coordonaties. DO NOT delete the "2" at the end of the line.
0001: wait  10000 ms - The time until the camera move starts. I've added 10s, so there will be enough time for the textures to load.
015F: set camera position  542.440 -103.905 23.590  0.0  0.0  0.0 - This will tell the camera where to go to watch from. Just replace the coordonaties with yours.
0160: point camera  568.199 -93.754 30.975  1 - This will tell the camera where to watch. The "1" at the end will tell the camera to do the move. If it was 0 instead of 1, the camera would instantly jump to the coordonaties.





Code: [Select]
; --- Part 2 ---
015F: set camera position  542.440 -103.905 23.590  0.0  0.0  0.0
0160: point camera  568.199 -93.754 30.975  1
0001: wait  4000 ms
015F: set camera position  364.927 -184.847 54.475  0.0  0.0  0.0
0160: point camera  341.394 -234.935 35.997  1
015F: set camera position  542.440 -103.905 23.590  0.0  0.0  0.0 - From where is watching...copy-pasted from above. (the last but one coordonaties set of 'Part 1')  
0160: point camera  568.199 -93.754 30.975  1 - Where is watching before the second camera move start...copy-pasted from above. (the last coordonaties set of 'Part 1')  
0001: wait  4000 ms - The waiting time before the camera move starts. It must be equal or greater with the camera pointing time. I've added 4s to have a better result.
015F: set camera position  364.927 -184.847 54.475  0.0  0.0  0.0 - This will tell the camera where to go to watch from. Just replace the coordonaties with yours.
0160: point camera  341.394 -234.935 35.997  1 - This will tell the camera where to watch.





Code: [Select]
; --- Part 3 ---
015F: set camera position  356.038 -178.472 48.471  0.0  0.0  0.0
0160: point camera  342.037 -218.214 34.900  1
0001: wait  4000 ms
015F: set camera position  119.070 -293.952 34.477  0.0  0.0  0.0
0160: point camera  107.932 -299.516 30.977  1
015F: set camera position  356.038 -178.472 48.471  0.0  0.0  0.0 - From where is watching...copy-pasted from above. (the last but one coordonaties set of 'Part 2')  
0160: point camera  342.037 -218.214 34.900  1 - Where is watching before the second camera move start...copy-pasted from above. (the last coordonaties set of 'Part 2')  
0001: wait  4000 ms - The waiting time before the camera move starts. It must be equal or greater with the camera pointing time. I've added 4s to have a better result.
015F: set camera position  119.070 -293.952 34.477  0.0  0.0  0.0 - This will tell the camera where to go to watch from. Just replace th
0160: point camera  107.932 -299.516 30.977  1 - This will tell the camera where to watch.





Code: [Select]
; --- Back to normal game ---
0001: wait  5000 ms
016A: fade  0 ()  1000 ms
0001: wait  1000 ms
02A3: toggle widescreen  0 (off)
01B4: set_player $PLAYER_CHAR frozen_state  1 (unfrozen)
02EB: restore_camera_with_jumpcut
016A: fade  1 ()  1000 ms
0001: wait  5000 ms - The time till the fade start. It must be equal or greater than the fading time.
016A: fade  0 ()  1000 ms - This will start a fade out.
0001: wait  1000 ms - This is the time till the fade in starts.
02A3: toggle widescreen  0 (off) - This will swich back to normal screen mode.
01B4: set_player $PLAYER_CHAR frozen_state  1 (unfrozen) - This will unfreeze the player (Tommy), so now you will be able to control him.
02EB: restore_camera_with_jumpcut - This will restore the camera, right behind the player (normal camera).
016A: fade  1 ()  1000 ms -  This will start the fade in.



After you have finished your scripting, press F7 to compile in the main.scm
That's all, I tried to explain it as well as I could. I hope this will help you, and if you followed this guide carefully, you will succes in your scripting.
Now go and play with it, and remember: scripting needs alot of writing, so you must have patience.
Feel free to post your camera moves here if you want.
Shoutout to Fox for teaching me all that I know about scripting in SCM. Thanks again man.
« Last Edit: May 05, 2007, 03:43:50 PM by Fugitive »

Offline Brulla

  • Veteran Member
  • Posts: 3257
  • Chris
    • View Profile
[VC] Camera Moves Tutorial
« Reply #1 on: July 30, 2006, 09:20:32 AM »
Dude this is a interesting tutorial, now im off to read it  

Offline JayFoxRox

  • Posts: 2221
    • View Profile
    • Homepage
[VC] Camera Moves Tutorial
« Reply #2 on: July 30, 2006, 09:20:35 AM »
Nice tut man

Its kinda the work of us both. But you typed alll the clean stuff again. Thx for showing this to every1... Will come usefull to every1 1 day. =)

Offline Greendead

  • Veteran Member
  • Posts: 2055
    • View Profile
    • http://
[VC] Camera Moves Tutorial
« Reply #3 on: July 30, 2006, 09:21:16 AM »
That's a lot to read...*reading*

Offline NuclearDeath

  • TMS Member
  • Veteran Member
  • Posts: 4194
    • View Profile
[VC] Camera Moves Tutorial
« Reply #4 on: July 30, 2006, 09:21:46 AM »
Awesome tut man,but i'm not really on vc

Offline Greendead

  • Veteran Member
  • Posts: 2055
    • View Profile
    • http://
[VC] Camera Moves Tutorial
« Reply #5 on: July 30, 2006, 09:22:57 AM »
I'm lost in this codes  But do you have any example or somethin...

Offline Fugitive

  • Veteran Member
  • Posts: 4883
    • View Profile
    • http://www.fugitivesplace.3x.ro
[VC] Camera Moves Tutorial
« Reply #6 on: July 30, 2006, 09:26:21 AM »
Quote from: greendead
I'm lost in this codes  But do you have any example or somethin...
Yeah, you can just copy-paste my code that I posted there in your main.scm... read all to find it... meh.
« Last Edit: July 30, 2006, 09:26:40 AM by Fugitive »

Offline BurnoutLS13

  • Posts: 1557
    • View Profile
    • http://
[VC] Camera Moves Tutorial
« Reply #7 on: July 30, 2006, 09:32:51 AM »
sweet man, im the jebus of camhack, lets see what i can do with this

Offline Fugitive

  • Veteran Member
  • Posts: 4883
    • View Profile
    • http://www.fugitivesplace.3x.ro
[VC] Camera Moves Tutorial
« Reply #8 on: July 30, 2006, 09:45:19 AM »
Scripting is harder than using CamHack, but scripting gives much better results.

For some examples of camera moves, watch "GVT-ZS: Opposide" and "VH DevetoriX" intros.

Please try my tutorial, and post your outcome if you want!
« Last Edit: July 30, 2006, 09:48:53 AM by Fugitive »

Offline Tackleberry

  • Veteran Member
  • Posts: 7402
    • View Profile
[VC] Camera Moves Tutorial
« Reply #9 on: July 30, 2006, 10:12:33 AM »
Great tut, now I just wait for the SA version...

Offline Xtramus

  • Technical Addict
  • Veteran Member
  • Posts: 5860
    • View Profile
    • http://www.gtastunting.net/forums
[VC] Camera Moves Tutorial
« Reply #10 on: July 30, 2006, 10:16:08 AM »
After reading that, I have one question: How do you set camera moving speed? I already understood most of that (partly due to the fact I've read about every coding FAQ at GTAF(which didn't help that much )), but the speed thing always remains uncovered

Offline JayFoxRox

  • Posts: 2221
    • View Profile
    • Homepage
[VC] Camera Moves Tutorial
« Reply #11 on: July 30, 2006, 10:25:55 AM »
Speed in SA can be controlled by 2 special opcodes (move camera from to and rotate camera from to)

But in VC its a bit tricky... I used an thread loop all the time for this until fugitive made me looking more into cam stuff. Set camera pointing time seems to control spin and vel ammount of camera. But yesterday i used another opcode in GUS. I will look for it later and will mention it in my basic SCM tutorial

Offline Kingjad

  • Veteran Member
  • Posts: 6071
  • Fat Bastard
    • View Profile
    • YouTube
[VC] Camera Moves Tutorial
« Reply #12 on: July 30, 2006, 10:26:40 AM »
With Fugitive's help I made a short camera-work thingy with scripting, and he also told me about putting actors and vehicles in too!  Awesome tut fungi.

EDIT: Post edited with attached clip!  I altered the opening shot from what fungi had given me (just switched the cam position and the direction it faced), and also added a completely new bit where I go off and view the lighthouse.  I'm vewy pwoud  thanks fungi!  This guide is very helpful for newbies like me.

[attachmentid=2421]
« Last Edit: July 30, 2006, 10:38:48 AM by Kingjad »

Offline Fugitive

  • Veteran Member
  • Posts: 4883
    • View Profile
    • http://www.fugitivesplace.3x.ro
[VC] Camera Moves Tutorial
« Reply #13 on: July 30, 2006, 10:26:50 AM »
Quote from: Xtramus
After reading that, I have one question: How do you set camera moving speed? I already understood most of that (partly due to the fact I've read about every coding FAQ at GTAF(which didn't help that much )), but the speed thing always remains uncovered
0460: set_camera_pointing_time 0.0 3000 - This is the time that the camera will need. 1500 = default. I added 3000 because I want slower camera moves.

I thought you red it all.
« Last Edit: July 30, 2006, 10:27:12 AM by Fugitive »

Offline Kingjad

  • Veteran Member
  • Posts: 6071
  • Fat Bastard
    • View Profile
    • YouTube
[VC] Camera Moves Tutorial
« Reply #14 on: July 30, 2006, 10:40:10 AM »
I edited my last post with a video attachment!

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal