Tutorials

 Reply to this postStart new topic

How to make custom cutscenes.

Arijit Sen
post Oct 4 2012, 12:50 PM
Post #1


Trained Member

Posts: 85
Joined: 21-September 12



The basic method for scripted cutscenes:
fade in
load, create and arrange stuff
enable widescreen
set camera
fade out


try the simple example below
press backspace to show player with mobile phone
CODE
{$CLEO .cs}
:CUTSCENE_Template
03A4: name_thread 'CUTSCEN'

:CUTSCEN_11
wait 0
if
0256:   player $PLAYER_CHAR defined
jf @CUTSCEN_11
if
0AB0:   key_pressed 8 // press Backspace
jf @CUTSCEN_11
0247: load_model #CELLPHONE

:CUTSCEN_13
wait 0
if
0248:   model #CELLPHONE available
jf @CUTSCEN_13

01B4: set_player $PLAYER_CHAR can_move 0
fade 0 1000
wait 1000
0729: AS_actor $PLAYER_ACTOR hold_cellphone 1
067C: put_camera_on_actor $PLAYER_ACTOR with_offset 0.0 1.5 0.6 rotation 0.0 0.2 0.6 0.0 2
02A3: enable_widescreen 1
wait 250
fade 1 1500
33@ = 0 // reset timer

:CUTSCEN_25
wait 0
if
0256:   player $PLAYER_CHAR defined
jf @CUTSCEN_25
if or
33@ > 5000// check timer if 5 seconds are passed
00E1:   player 0 pressed_key 14
00E1:   player 0 pressed_key 15
00E1:   player 0 pressed_key 17
00E1:   player 0 pressed_key 6
jf @CUTSCEN_25
jump @CUTSCEN_cleanup

:CUTSCEN_cleanup
0729: AS_actor $PLAYER_ACTOR hold_cellphone 0
fade 0 500
wait 500
02A3: enable_widescreen 0
fade 1 1500
0373: set_camera_directly_behind_player
02EB: restore_camera_with_jumpcut
01B4: set_player $PLAYER_CHAR can_move 1
jump @CUTSCEN_11


the variable 32@ and 33@ are reserved as internal timer
try the little script below to understand
press Backspace to reset timer
CODE
{$CLEO .cs}
thread 'timer'
while true
wait 0
03F0: enable_text_draw 1
045A: draw_text_1number 300.0 200.0 GXT 'NUMBER' number 33@  // ~1~
    if
        0AB0:   key_pressed 8 // press Backspace
    then
        33@ = 0
    end
end



Example for a cutscene with talking actor
Go into red marker in Grovestreet
CODE
{$CLEO .cs}
:CUTSCENE_Template
03A4: name_thread 'CUTSCEN'
0@ = 0

:CUTSCEN_11
wait 0
if
0256:   player $PLAYER_CHAR defined
jf @CUTSCEN_11
if
0@ == 0// check for a var to let the cutscene only run for one time
jf @CUTSCEN_11
if
00FE:   actor $PLAYER_ACTOR sphere 1 in_sphere 2480.134 -1665.475 13.3348 radius 3.5 3.5 5.5
jf @CUTSCEN_11
00BA: show_text_styled GXT 'LG_37' time 1000 style 2
023C: load_special_actor 'TRUTH' as 1 // models 290-299
04ED: load_animation "GHANDS"

:CUTSCEN_12
wait 0
if and
023D:   special_actor 1 loaded
04EE:   animation "GHANDS" loaded
004D: jump_if_false @CUTSCEN_12

0247: load_model #spraycan

:CUTSCEN_13
wait 0
if
0248:   model #spraycan available
jf @CUTSCEN_13

01B4: set_player $PLAYER_CHAR can_move 0
fade 0 1000
wait 1000
009A: 10@ = create_actor_pedtype 24 model #SPECIAL01 at 2477.5356 -1663.0228 13.3359
060B: set_actor 10@ decision_maker_to 32
01B2: give_actor 10@ weapon  41 ammo  9000  // Load the weapon model before using this
02E2: set_actor 10@ weapon_accuracy_to  100
0639: AS_actor 10@ rotate_to_actor $PLAYER_ACTOR
067C: put_camera_on_actor 10@ with_offset 0.0 1.5 0.6 rotation 0.0 0.2 0.6 0.0 2
02A3: enable_widescreen 1
wait 1500
fade 1 1500
054C: use_GXT_table 'GARAGE1'
33@ = 0 // reset timer
0@ = 1

:CUTSCEN_25
wait 0
if
0256:   player $PLAYER_CHAR defined
jf @CUTSCEN_cleanup
if or
33@ > 10000// check timer if 10 seconds are passed
00E1:   player 0 pressed_key 14
00E1:   player 0 pressed_key 15
00E1:   player 0 pressed_key 17
00E1:   player 0 pressed_key 6
jf @CUTSCEN_31
jump @CUTSCEN_cleanup


:CUTSCEN_31
if
0@ == 1
jf @CUTSCEN_33
0812: AS_actor 10@ perform_animation "gsign1" IFP_file "GHANDS" 8.0 loopA 0 lockX 0 lockY 0 lockF 0 time -1 // versionB
7@ = 16484
gosub @CUTSCEN_dialoque_sound_SUB
0967: actor 10@ move_mouth_for  2000 ms
00BC: show_text_highpriority GXT 'GAR1_NE' time 5000 flag 1
33@ = 0 // reset timer
0@ = 2
jump @CUTSCEN_25


:CUTSCEN_33
if and
0@ == 2
33@ > 3000
jf @CUTSCEN_35
0812: AS_actor 10@ perform_animation "IDLE_chat" IFP_file "ped" 8.0 loopA 0 lockX 0 lockY 0 lockF 0 time -1 // versionB
7@ = 16486
gosub @CUTSCEN_dialoque_sound_SUB
0967: actor 10@ move_mouth_for  3000 ms
00BC: show_text_highpriority GXT 'GAR1_NG' time 5000 flag 1
33@ = 0 // reset timer
0@ = 3
jump @CUTSCEN_25


:CUTSCEN_35
if and
0@ == 3
33@ > 3000
jf @CUTSCEN_37
0812: AS_actor 10@ perform_animation "gsign1" IFP_file "GHANDS" 8.0 loopA 0 lockX 0 lockY 0 lockF 0 time -1 // versionB
7@ = 16487
gosub @CUTSCEN_dialoque_sound_SUB
0967: actor 10@ move_mouth_for  5000 ms
00BC: show_text_highpriority GXT 'GAR1_NH' time 5000 flag 1
33@ = 0 // reset timer
0@ = 4
jump @CUTSCEN_25

:CUTSCEN_37
if and
0@ == 4
33@ > 5000
jf @CUTSCEN_39
04C4: create_coordinate 11@ 12@ 13@ from_actor $PLAYER_ACTOR offset 0.0  0.0  0.9
0668: AS_actor 10@ rotate_and_shoot_at 11@ 12@ 13@ 1000 ms
33@ = 0 // reset timer
0@ = 5
jump @CUTSCEN_25

:CUTSCEN_39
if and
0@ == 5
33@ > 1000
jf @CUTSCEN_25
0@ = 6
jump @CUTSCEN_cleanup


:CUTSCEN_cleanup
fade 0 1000
wait 1000
04EF: release_animation "GHANDS"
02A3: enable_widescreen 0
0373: set_camera_directly_behind_player
02EB: restore_camera_with_jumpcut
009B: destroy_actor 10@
fade 1 2000
01B4: set_player $PLAYER_CHAR can_move 1
jump @CUTSCEN_11




:CUTSCEN_dialoque_sound_SUB
040D: unload_wav 1
03CF: load_wav 7@ as 1

:CUTSCEN_dialoque_sound_1
wait 0
if
03D0:   wav 1 loaded
jf @CUTSCEN_dialoque_sound_1
0949: link_wav 1 to_actor 10@
03D1: play_wav 1
return


Subdivide the main loop into sequences
1. check for a var value
2. check for timer value
read the comments
CODE
:CUTSCEN_25
wait 0
if
0256:   player $PLAYER_CHAR defined
jf @CUTSCEN_cleanup



:CUTSCEN_31// sequence 1
if
0@ == 1   // check for var value of 0@ to let the code pass to read the sequence codes
jf @CUTSCEN_33
0812: AS_actor 10@ perform_animation "gsign1" IFP_file "GHANDS" 8.0 loopA 0 lockX 0 lockY 0 lockF 0 time -1 // versionB
7@ = 16484
gosub @CUTSCEN_dialoque_sound_SUB
0967: actor 10@ move_mouth_for  2000 ms
00BC: show_text_highpriority GXT 'GAR1_NE' time 5000 flag 1
33@ = 0 // reset timer
0@ = 2  // change var value
jump @CUTSCEN_25


:CUTSCEN_33// sequence 2
if and
0@ == 2    // check for var value of 0@ to let the code pass to read the sequence codes
33@ > 3000 // ckeck if 3 seconds are passed, since the previous sequence has been started
jf @CUTSCEN_35
0812: AS_actor 10@ perform_animation "IDLE_chat" IFP_file "ped" 8.0 loopA 0 lockX 0 lockY 0 lockF 0 time -1 // versionB
7@ = 16486
gosub @CUTSCEN_dialoque_sound_SUB
0967: actor 10@ move_mouth_for  3000 ms
00BC: show_text_highpriority GXT 'GAR1_NG' time 5000 flag 1
33@ = 0 // reset timer
0@ = 3  // change var value
jump @CUTSCEN_25


:CUTSCEN_35// sequence 3
if and
0@ == 3    // check for var value of 0@ to let the code pass to read the sequence codes
33@ > 3000 // ckeck if 3 seconds are passed, since the previous sequence has been started
jf @CUTSCEN_37
0812: AS_actor 10@ perform_animation "gsign1" IFP_file "GHANDS" 8.0 loopA 0 lockX 0 lockY 0 lockF 0 time -1 // versionB
7@ = 16487
gosub @CUTSCEN_dialoque_sound_SUB
0967: actor 10@ move_mouth_for  5000 ms
00BC: show_text_highpriority GXT 'GAR1_NH' time 5000 flag 1
33@ = 0 // reset timer
0@ = 4  // change var value
jump @CUTSCEN_25

:CUTSCEN_37// sequence 4
if and
0@ == 4    // check for var value of 0@ to let the code pass to read the sequence codes
33@ > 5000 // ckeck if 5 seconds are passed, since the previous sequence has been started
jf @CUTSCEN_39
04C4: create_coordinate 11@ 12@ 13@ from_actor $PLAYER_ACTOR offset 0.0  0.0  0.9
0668: AS_actor 10@ rotate_and_shoot_at 11@ 12@ 13@ 1000 ms
33@ = 0 // reset timer
0@ = 5  // change var value
jump @CUTSCEN_25

:CUTSCEN_39// sequence 5
if and
0@ == 5    // check for var value of 0@ to let the code pass to read the sequence codes
33@ > 1000 // ckeck if 1 seconds are passed, since the previous sequence has been started
jf @CUTSCEN_25
0@ = 6  // change var value
jump @CUTSCEN_cleanup


Instead of manually checking if the keys are pressed for cutscene skip, just use the appropriate commands? 0707 0701

You can make it skip to a different label if you need to do extra things in case the cutscene was skipped (e.g. if the player was walking somewhere in the cutscene, teleport him instantly) and also remember to free any loaded models, animations etc. (these should be loaded before the cutscene skip and removed after it as the cutscene can be skipped at any time during it's progress).

I hope this helps you..
Please give comments/suggestion so that I can improve the Tutorial..

This post has been edited by Arijit Sen: Oct 4 2012, 02:50 PM


--------------------
Go to the top of the page
 
+Quote Post
Deji
post Oct 4 2012, 01:47 PM
Post #2


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



Instead of manually checking if the keys are pressed for cutscene skip, just use the appropriate commands? 0707 0701

You can make it skip to a different label if you need to do extra things in case the cutscene was skipped (e.g. if the player was walking somewhere in the cutscene, teleport him instantly) and also remember to free any loaded models, animations etc. (these should be loaded before the cutscene skip and removed after it as the cutscene can be skipped at any time during it's progress).


--------------------
Go to the top of the page
 
+Quote Post
Arijit Sen
post Oct 4 2012, 02:50 PM
Post #3


Trained Member

Posts: 85
Joined: 21-September 12



Added your valuable suggestions I hope the tutorial helped somehow ..


--------------------
Go to the top of the page
 
+Quote Post
Michael.Knight1
post Oct 12 2012, 07:29 PM
Post #4


Member

Posts: 130
From: Germany
Joined: 24-March 12



Artijisen , did you know what is the cutscene ?? confused.gif
If you're new in this web forums you must know one things ( It's For Pros ) .
You have just posting some opcode and i can't to understand anythings about that tutorial and also gta sa cutscene is releated to info , models , extra col , otion , attach , remove , uncoppress , etc ...
you can find the helpfull in gta modding :
http://www.gtamodding.com/index.php?title=Cutscene
This Tutorial Called : How to make custom Scenes .
It's not help full two , you just write codes and no informations just a litle . down.gif

This post has been edited by Michael.Knight1: Oct 12 2012, 07:32 PM


--------------------
Michael Knight A shadowy flight into the dangerous world of a man who does not exist.
Michael Knight, a young loner on a crusade to champion the cause of the innocent, the helpless, the powerless, in a world of criminals who operate above the law.
Go to the top of the page
 
+Quote Post
badboy
post Oct 14 2012, 04:56 PM
Post #5


Trained Member

Posts: 76
From: Nederland, NL
Joined: 1-May 12



QUOTE (Michael.Knight1 @ Oct 12 2012, 09:29 PM) *
Artijisen , did you know what is the cutscene ?? confused.gif
If you're new in this web forums you must know one things ( It's For Pros ) .
You have just posting some opcode and i can't to understand anythings about that tutorial and also gta sa cutscene is releated to info , models , extra col , otion , attach , remove , uncoppress , etc ...
you can find the helpfull in gta modding :
http://www.gtamodding.com/index.php?title=Cutscene
This Tutorial Called : How to make custom Scenes .
It's not help full two , you just write codes and no informations just a litle . down.gif


Implying you are a pro.
Go to the top of the page
 
+Quote Post
Michael.Knight1
post Oct 14 2012, 07:16 PM
Post #6


Member

Posts: 130
From: Germany
Joined: 24-March 12



QUOTE (badboy @ Oct 14 2012, 05:56 PM) *
Implying you are a pro.

No , My level is awsome but no pro , i not talking about my self man thumbsup.gif


--------------------
Michael Knight A shadowy flight into the dangerous world of a man who does not exist.
Michael Knight, a young loner on a crusade to champion the cause of the innocent, the helpless, the powerless, in a world of criminals who operate above the law.
Go to the top of the page
 
+Quote Post
LINK/2012
post Oct 14 2012, 09:19 PM
Post #7


I will kill you

Posts: 126
Joined: 13-May 11



QUOTE (Michael.Knight1 @ Oct 14 2012, 04:16 PM) *
No , My level is awsome but no pro , i not talking about my self man thumbsup.gif

wacko.gif
Dunno if I laugh or if I cry
Go to the top of the page
 
+Quote Post
Spider-Vice
post Oct 14 2012, 11:28 PM
Post #8


In motus...

Group Icon

Posts: 361
From: Portugal
Joined: 28-May 09



So this website is for pros but you don't consider yourself one. No need to call each others pros or noobs, just help people because that's what this forum is for too. Helping people in modding.
Go to the top of the page
 
+Quote Post
Arijit Sen
post Oct 15 2012, 11:24 AM
Post #9


Trained Member

Posts: 85
Joined: 21-September 12



@MK-1 - You are a real stupid idiot the link (which you gave) is of "how to make original cutscenes like how R* made" but the tutorial which I have presented is "How to make a custom cutscene" ..If you don't like it no one has asked your stupid & idiotic comments... So just shut up..
And you are calling yourself a pro ??? I don't think so if you had been even a good modder then you might have given replies like Deji to improve the TUT. not like the ones which you have given...lol..

And if it is a website for pro then I don't think I should contribute anything for this site..because I am a good modder not a pro..


--------------------
Go to the top of the page
 
+Quote Post
Jimmy
post Nov 4 2012, 09:12 AM
Post #10


Ameteur Member

Posts: 36
From: India
Joined: 19-January 12



Nice one Arijitsen. Good job.


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


Go to the top of the page
 
+Quote Post
Arijit Sen
post Nov 4 2012, 09:17 AM
Post #11


Trained Member

Posts: 85
Joined: 21-September 12



Thanks..


--------------------
Go to the top of the page
 
+Quote Post
Reply to this postStart new topic

5 User(s) are reading this topic (5 Guests and 0 Anonymous Users)
0 Members: