{$CLEO .cs}

//-------------MAIN---------------
thread 'RUNCUT' 
0A8C: write_memory 0x406BF0 size 17 value 0x90 virtual_protect 1 // UNNECESSARY: Unlock Controls when Cutscene is playing
0A8C: write_memory 0x407034 size 26 value 0x90 virtual_protect 1 // UNNECESSARY: Unlock Controls when Cutscene is playing

:RUNCUT_01
wait 0
if and
05EE:  key_pressed 82  //R
05EE:  key_pressed 67  //C
else_jump @RUNCUT_01

:RUNCUT_02
wait 0
if or
85EE:  NOT key_pressed 82  //R
85EE:  NOT key_pressed 67  //C
else_jump @RUNCUT_02
load_special_actor 1 'dance' // Name of the model must match with the name in the .ifp file
// WARNING! It is necessary to load ALL Cutscene Actors and Objects EVEN you don't want to use all of them in cutscene
// Model name must be coincide with the animation name in IFP
// If you load actor at numbers 1-11 so he will have dynamic shadow, if 12-21 - will not have shadow.
load_requested_models

:RUNCUT_03
wait 0
if
023D:   special_actor 1 loaded
jf @RUNCUT_03
04C4: create_coordinate 1@ 2@ 3@ from_actor $PLAYER_ACTOR offset 1.0 2.0 -1.0 // We will place cutscene in front of and slightly to the right of player.
02E4: load_cutscene_data 'csdance' // Load "csdance" cutscene(it's the name of both .ifp and .dat files). 
// A cutscenes with non-original names will have no sounds, even if you will add an .mp3 file with the same name in "Audio" folder. But you can just replace original cutscenes, of course!
0244: set_cutscene_pos 1@ 2@ 3@ // Center of the cutscene
02E5: 0@ = create_cutscene_object #SPECIAL01 // Creating new cutscene object(actor). Also here creates dynamic shadow if object has bones.
04BC: (unknown) 'dance' // UNNECESSARY: Endless animation play loop
02E6: set_cutscene_anim 0@ 'dance' // Set cutscene animation for cutscene object(actor)
02E7: start_cutscene
// That's all. Cutscene has been started. Now we can adjust some extra moments:
0A8C: write_memory 0x9839C4 size 1 value 1 virtual_protect 1 // UNNECESSARY: 0 - Music off(OnMenu or mp3 is playing), 1 - Music On(InGame), 2 - CutscenePlaying, 4 - GameLoading
// This cutscene has no sound but we don't want to hear silence so we just restored InGame sounds.
0A8C: write_memory 0xA10B63 size 1 value 0 virtual_protect 1 // UNNECESSARY: Unlock Menu Controls when Cutscene is playing
wait 0 // UNNECESSARY: We will wait until cutscene camera will created...
02A3: enable_widescreen 0 // UNNECESSARY: ...and will destroy widscreen...
Camera.SetBehindPlayer // UNNECESSARY: ...and restore camera...
015A: restore_camera // UNNECESSARY: ...for walking through cutscene!

:RUNCUT_11
wait 0
if and
05EE:  key_pressed 82  //R
05EE:  key_pressed 67  //C
else_jump @RUNCUT_11

:RUNCUT_12
wait 0
if or
85EE:  NOT key_pressed 82  //R
85EE:  NOT key_pressed 67  //C
else_jump @RUNCUT_12
02EA: end_cutscene // To unload all cutscene we need just one opcode...
0296: unload_special_actor 1 // ...and don't forger about actors, of course!
jump @RUNCUT_01