Jump to content

[Q] Attaching 2dfx1 lights to cutscene vehicles


WeekSoldier

Recommended Posts

I installed @Cleoude's Intro Cutscene Fix which, among other changes, adds a police siren to CRASH's car during the prologue via CLEO script. I wondered if the same could be done to other cutscene vehicles, so I rewrote some lines with Sanny, but all the attempts ended with the game crashing during the scene. How can I go about doing it? Is there any other way?

Link to comment
Share on other sites

48 minutes ago, MiranDMC said:

Why is it crashing? Have you check scrlog.log? (produced by Junior's scrlog.asi)

Just checked. The last command was CREATE_CAR.

********************************************
 script prologf
 Local variables dump:
 1157608356 1149797970 1093320730 338 0 0 17988 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
 7415 7415
********************************************

00000169&0: [00D6] IF 0
00000173&0: [0019] l3(338) > 300    // TRUE
00000181&1: [004D] GOTO_IF_FALSE -136
00000188&1: [00A5] CREATE_CAR 470 2042.61 1092.2 10.6719

*********************************

 

Link to comment
Share on other sites

Ok, what were your changes then? Maybe additional models/effects the car is using have to be requested and loaded too. Hard to say without any code.

Link to comment
Share on other sites

53 minutes ago, MiranDMC said:

Ok, what were your changes then? Maybe additional models/effects the car is using have to be requested and loaded too. Hard to say without any code.

I made a 5-seconds long cutscene with an static Patriot then created another model for the headlights, which reuses the collision model for copsiren, and I replaced copsiren in the .ide file with headlights. As for the cleo, I changed the coords to my cutscene's coords and the models. I wasn't sure about their position though, so I just left them nearly in the same place as the Patriot. 

 

// By Cleoude
{$CLEO .cs}
{$USE cleo+}
{$USE ini}

//-------------MAIN---------------
thread "PROLOGFIX"   
    
:PROLOG_1
wait 0
if  
06B9:   cutscene_data_loaded
jf @PROLOG_1      
08D1: store_cutscene_pos_to 0@ 1@ 2@
wait 0
if and
0@ == 2045.6138 
1@ == 1092.1975 
2@ == 10.6719
jf @PROLOG_1
0AF0: 6@ = read_int_from_ini_file "cleo\testlight.ini" section "Light" key "ID"
Model.Load(#PATRIOT)
Model.Load(6@) 
jump @PROLOG_2

:PROLOG_2
wait 0
if 
056A:   cutscene_skipped
jf @PROLOG_3
JUMP @PROLOG_1
                              
:PROLOG_3
02E8: 3@ = cutscenetime    
Wait 0
if 
3@ > 300
jf @PROLOG_2
Car.Create(4@, #PATRIOT, 2042.6138, 1092.1975, 10.6719)
Car.Angle(4@) = 180.0  
Object.Create(5@, 6@, 1389.34, 827.43, 10.6719)
0338: set_car 4@ visibility 0    
020A: set_car 4@ door_status_to 1
Car.SetSpeedInstantly(4@, 0.0)
0681: attach_object 5@ to_car 4@ with_offset 0.0 0.0 0.0 rotation 0.0 0.0 0.0
0AF0: 7@ = read_int_from_ini_file "cleo\testlight.ini" section "Light" key "duration"
jump @PROLOG_4

:PROLOG_4
02E8: 3@ = cutscenetime
Wait 0
if or 
001D:   3@ > 7@  // (int)
056A:   cutscene_skipped
jf @PROLOG_4
Car.RemoveReferences(4@)
Car.Destroy(4@)
Object.RemoveReferences(5@)
Object.Destroy(5@)
jump @PROLOG_1

At first I thought the problem were the modifications for the col and ide files, but it still crashed even after reverting those changes.

Edited by WeekSoldier
Link to comment
Share on other sites

11 hours ago, MiranDMC said:

Try add 038B: load_requested_models before spawning the car and object.

 

Added it but it crashed again. 

********************************************

00000045&1: [00D6] IF 2
00000049&1: [0043] l0(2017.12) == 2017.12    // TRUE
00000059&1: [0043] l1(1110.84) == 1110.84    // TRUE
00000069&1: [0043] l2(10.8203) == 10.8203    // TRUE
00000079&1: [004D] GOTO_IF_FALSE -13
00000086&1: [0AF0] READ_INT_FROM_INI_FILE "CLEO\PROLOG.INI" "SIREN" "ID" -> 17988    // TRUE
00000119&1: [0247] REQUEST_MODEL 470
00000124&1: [0247] REQUEST_MODEL 17988
00000129&1: [038B] LOAD_ALL_MODELS_NOW

*********************************

 

Link to comment
Share on other sites

On 9/24/2023 at 7:31 AM, MiranDMC said:

Try add 038B: load_requested_models before spawning the car and object.

 

works for me

if the carsirene object is installed correct, then it can be used like any other object, it can be spawned and attached to vehicles

 

Basically does it need to load models and do a load check or use opcode 038B:

Pickups are working without that and sometimes spawning an object also

That the COPCARLA spawn of Cleoude's Intro Cutscene Fix works, was luck

Spawning another car model needs to do a load check or use opcode 038B:

Spoiler

works for me

{$CLEO .cs}
{$USE cleo+}
{$USE ini}

thread 'PRLGFIX'   
    
:PROLOG_1
wait 0
if  
06B9:   cutscene_data_loaded
jf @PROLOG_1      
08D1: store_cutscene_pos_to 0@ 1@ 2@
0092: 6@ = float_to_integer 0@  
0092: 7@ = float_to_integer 1@  
0092: 8@ = float_to_integer 2@
wait 0
if and
//0@ == 2045.6138 
//1@ == 1092.1975 
//2@ == 10.6719
6@ == 2484 
7@ == -1722
8@ == 13
jf @PROLOG_1
0AF0: 6@ = read_int_from_ini_file "cleo\testlight.ini" section "Light" key "ID"
Model.Load(#PATRIOT)
Model.Load(6@)
038B: load_requested_models 
jump @PROLOG_2

:PROLOG_2
wait 0
if 
056A:   cutscene_skipped
jf @PROLOG_3
JUMP @PROLOG_1
                              
:PROLOG_3
02E8: 3@ = cutscenetime    
Wait 0
if 
3@ > 300
jf @PROLOG_2
Car.Create(4@, #PATRIOT, 2490.95, -1729.05, 12.99)
Car.Angle(4@) = 180.0  
Object.Create(5@, 6@, 1389.34, 827.43, 10.6719)
//0338: set_car 4@ visibility 0    
020A: set_car 4@ door_status_to 1
Car.SetSpeedInstantly(4@, 0.0)
0681: attach_object 5@ to_car 4@ with_offset 0.0 0.0 0.0 rotation 0.0 0.0 0.0
0AF0: 7@ = read_int_from_ini_file "cleo\testlight.ini" section "Light" key "duration"
jump @PROLOG_4

:PROLOG_4
02E8: 3@ = cutscenetime
Wait 0
if or 
001D:   3@ > 7@  // (int)
056A:   cutscene_skipped
jf @PROLOG_4
Car.RemoveReferences(4@)
Car.Destroy(4@)
Object.RemoveReferences(5@)
Object.Destroy(5@)
jump @PROLOG_1

 

 

 

 

 

 

Btw. your cutscene coords and the carspawn coords are far away from intro cutscene "PROLOG3"

0@ == 2045.6138 
1@ == 1092.1975 
2@ == 10.6719
Car.Create(4@, #PATRIOT, 2042.6138, 1092.1975, 10.6719)
Car.Angle(4@) = 180.0

 

 

 

 

 

Edited by ZAZ
Link to comment
Share on other sites

@ZAZ hello! I updated the mod. now It's using actor's animation and object attached to Rhand bone.

https://streamable.com/iq8f15

now it works fine.

 

I wanna ask you question. I added light for green goo but light dissappears in some camera angles and positions. Can you help me for this? It's actually general problem from game. Objects dissappears when camera is near. Cull problem or sth whatever

 

https://streamable.com/y386bt

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.