Jump to content

[VC] How to make moving garage doors?


SaL_Leone

Recommended Posts

How to make moving garage doors?I need to make this doors moving at -831.753, -1195.27, 12.095 :

https://www.mediafire.com/?1cl88n8yk1c2xb4

Aslo i need to player can save cars in that garage.Its for GTA VCS on VC mod:

http://gtaforums.com/topic/704426-relvc-grand-theft-auto-stories/

Thanks.

//Sorry if i posted in wrong section :blush:

Edited by SaL_Leone
  • Like 1
Link to comment
Share on other sites

  • 6 years later...
Bodethedestroyer
On 7/19/2014 at 9:18 PM, SaL_Leone said:

How to make moving garage doors?I need to make this doors moving at -831.753, -1195.27, 12.095 :

https://www.mediafire.com/?1cl88n8yk1c2xb4

Aslo i need to player can save cars in that garage.Its for GTA VCS on VC mod:

http://gtaforums.com/topic/704426-relvc-grand-theft-auto-stories/

Thanks.

//Sorry if i posted in wrong section

Did you learn how Sal?

Link to comment
Share on other sites

 

In GTA III and Vice City, garages can only be created and controlled through the main.scm

(but i think it also needs propper door models)

 

script examples:

0219: $196 = create_garage_type 5 door -914.129 -1263.54 10.706 to -906.3 -1266.9 14.421 depth -907.137 -1246.626 
0219: $197 = create_garage_type 5 door -1014.341 -857.732 6.325 to -1014.341 -841.532 10.885 depth -1001.315 -857.732 
03BB: set_garage $197 door_type_to_swing_open 
0219: $198 = create_garage_type 5 door -886.157 -115.158 9.992 to -876.7 -119.83 15.58 depth -882.699 -108.312 
0219: $199 = create_garage_type 5 door 323.9 427.4 10.0 to 313.9 430.53 15.7 depth 326.3 434.5 
0219: $200 = create_garage_type 5 door -7.55 -1253.77 9.322 to 2.64 -1253.7 14.4 depth -7.55 -1261.2 
0219: $201 = create_garage_type 1 door -1056.05 -469.668 10.053 to -1038.966 -467.675 14.753 depth -1054.074 -486.611 
03BB: set_garage $201 door_type_to_swing_open 
0219: $202 = create_garage_type 23 door -823.448 -1488.083 10.852 to -842.0 -1481.0 16.165 depth -834.686 -1515.899 
03DA: set_garage $202 camera_follows_player 
03BB: set_garage $202 door_type_to_swing_open 
0219: $203 = create_garage_type 1 door -966.016 -861.529 5.761 to -966.016 -841.683 11.273 depth -978.454 -861.529 
03DA: set_garage $203 camera_follows_player 
03BB: set_garage $203 door_type_to_swing_open 
0219: $204 = create_garage_type 19 door 449.137 340.002 10.794 to 465.43 326.187 14.7 depth 465.42 340.002 
03BB: set_garage $204 door_type_to_swing_open 
0219: $205 = create_garage_type 4 door -1163.248 -1407.282 10.157 to -1159.338 -1397.813 16.989 depth -1178.292 -1400.939 
0219: $206 = create_garage_type 26 door 303.998 400.718 12.025 to 301.281 410.584 16.044 depth 298.697 402.389 
03DA: set_garage $206 camera_follows_player 
03BB: set_garage $206 door_type_to_swing_open 
057A: set_garage $206 max_cars_to 1 
0219: $207 = create_garage_type 17 door -848.225 1303.119 10.421 to -836.832 1307.033 15.816 depth -853.657 1318.901 
03DA: set_garage $207 camera_follows_player 
057A: set_garage $207 max_cars_to 4 
0219: $208 = create_garage_type 18 door -825.466 1311.499 10.537 to -817.159 1314.355 15.061 depth -828.66 1320.791 
03DA: set_garage $208 camera_follows_player 
057A: set_garage $208 max_cars_to 2 
0219: $209 = create_garage_type 24 door -816.37 1314.69 10.582 to -819.54 1324.01 15.061 depth -808.09 1317.46 
03DA: set_garage $209 camera_follows_player 
057A: set_garage $209 max_cars_to 2 
0219: $210 = create_garage_type 25 door 27.143 -1483.954 9.423 to 21.365 -1490.59 12.994 depth 22.611 -1483.384 
03BB: set_garage $210 door_type_to_swing_open 
03DA: set_garage $210 camera_follows_player 
057A: set_garage $210 max_cars_to 1 
0219: $211 = create_garage_type 16 door 450.136 641.029 10.112 to 457.977 641.029 13.092 depth 450.136 635.726 
03BB: set_garage $211 door_type_to_swing_open 
03DA: set_garage $211 camera_follows_player 
057A: set_garage $211 max_cars_to 1 
0219: $212 = create_garage_type 27 door -981.654 -802.265 6.325 to -981.654 -821.865 10.73 depth -991.127 -802.265 
03BB: set_garage $212 door_type_to_swing_open 
03DA: set_garage $212 camera_follows_player 
057A: set_garage $212 max_cars_to 2 
0219: $213 = create_garage_type 28 door -992.416 -802.265 6.325 to -992.416 -821.865 10.73 depth -1001.889 -802.265 
03BB: set_garage $213 door_type_to_swing_open 
03DA: set_garage $213 camera_follows_player 
057A: set_garage $213 max_cars_to 2 
0219: $214 = create_garage_type 29 door -1003.771 -802.265 6.325 to -1003.771 -821.865 10.73 depth -1013.244 -802.265 
03BB: set_garage $214 door_type_to_swing_open 
03DA: set_garage $214 camera_follows_player 
057A: set_garage $214 max_cars_to 2 
0219: $215 = create_garage_type 30 door -1015.436 -802.265 6.325 to -1015.436 -821.865 10.73 depth -1024.909 -802.265 
03BB: set_garage $215 door_type_to_swing_open 
03DA: set_garage $215 camera_follows_player 
057A: set_garage $215 max_cars_to 2 
0219: $216 = create_garage_type 31 door -362.12 -550.214 11.722 to -353.12 -550.214 15.16 depth -362.12 -539.484 
03BB: set_garage $216 door_type_to_swing_open 

 

 

 

 

 

Edited by ZAZ
  • Like 1
Link to comment
Share on other sites

Bodethedestroyer
On 6/11/2021 at 7:05 PM, ZAZ said:

 

In GTA III and Vice City, garages can only be created and controlled through the main.scm

(but i think it also needs propper door models)

 

script examples:


0219: $196 = create_garage_type 5 door -914.129 -1263.54 10.706 to -906.3 -1266.9 14.421 depth -907.137 -1246.626 
0219: $197 = create_garage_type 5 door -1014.341 -857.732 6.325 to -1014.341 -841.532 10.885 depth -1001.315 -857.732 
03BB: set_garage $197 door_type_to_swing_open 
0219: $198 = create_garage_type 5 door -886.157 -115.158 9.992 to -876.7 -119.83 15.58 depth -882.699 -108.312 
0219: $199 = create_garage_type 5 door 323.9 427.4 10.0 to 313.9 430.53 15.7 depth 326.3 434.5 
0219: $200 = create_garage_type 5 door -7.55 -1253.77 9.322 to 2.64 -1253.7 14.4 depth -7.55 -1261.2 
0219: $201 = create_garage_type 1 door -1056.05 -469.668 10.053 to -1038.966 -467.675 14.753 depth -1054.074 -486.611 
03BB: set_garage $201 door_type_to_swing_open 
0219: $202 = create_garage_type 23 door -823.448 -1488.083 10.852 to -842.0 -1481.0 16.165 depth -834.686 -1515.899 
03DA: set_garage $202 camera_follows_player 
03BB: set_garage $202 door_type_to_swing_open 
0219: $203 = create_garage_type 1 door -966.016 -861.529 5.761 to -966.016 -841.683 11.273 depth -978.454 -861.529 
03DA: set_garage $203 camera_follows_player 
03BB: set_garage $203 door_type_to_swing_open 
0219: $204 = create_garage_type 19 door 449.137 340.002 10.794 to 465.43 326.187 14.7 depth 465.42 340.002 
03BB: set_garage $204 door_type_to_swing_open 
0219: $205 = create_garage_type 4 door -1163.248 -1407.282 10.157 to -1159.338 -1397.813 16.989 depth -1178.292 -1400.939 
0219: $206 = create_garage_type 26 door 303.998 400.718 12.025 to 301.281 410.584 16.044 depth 298.697 402.389 
03DA: set_garage $206 camera_follows_player 
03BB: set_garage $206 door_type_to_swing_open 
057A: set_garage $206 max_cars_to 1 
0219: $207 = create_garage_type 17 door -848.225 1303.119 10.421 to -836.832 1307.033 15.816 depth -853.657 1318.901 
03DA: set_garage $207 camera_follows_player 
057A: set_garage $207 max_cars_to 4 
0219: $208 = create_garage_type 18 door -825.466 1311.499 10.537 to -817.159 1314.355 15.061 depth -828.66 1320.791 
03DA: set_garage $208 camera_follows_player 
057A: set_garage $208 max_cars_to 2 
0219: $209 = create_garage_type 24 door -816.37 1314.69 10.582 to -819.54 1324.01 15.061 depth -808.09 1317.46 
03DA: set_garage $209 camera_follows_player 
057A: set_garage $209 max_cars_to 2 
0219: $210 = create_garage_type 25 door 27.143 -1483.954 9.423 to 21.365 -1490.59 12.994 depth 22.611 -1483.384 
03BB: set_garage $210 door_type_to_swing_open 
03DA: set_garage $210 camera_follows_player 
057A: set_garage $210 max_cars_to 1 
0219: $211 = create_garage_type 16 door 450.136 641.029 10.112 to 457.977 641.029 13.092 depth 450.136 635.726 
03BB: set_garage $211 door_type_to_swing_open 
03DA: set_garage $211 camera_follows_player 
057A: set_garage $211 max_cars_to 1 
0219: $212 = create_garage_type 27 door -981.654 -802.265 6.325 to -981.654 -821.865 10.73 depth -991.127 -802.265 
03BB: set_garage $212 door_type_to_swing_open 
03DA: set_garage $212 camera_follows_player 
057A: set_garage $212 max_cars_to 2 
0219: $213 = create_garage_type 28 door -992.416 -802.265 6.325 to -992.416 -821.865 10.73 depth -1001.889 -802.265 
03BB: set_garage $213 door_type_to_swing_open 
03DA: set_garage $213 camera_follows_player 
057A: set_garage $213 max_cars_to 2 
0219: $214 = create_garage_type 29 door -1003.771 -802.265 6.325 to -1003.771 -821.865 10.73 depth -1013.244 -802.265 
03BB: set_garage $214 door_type_to_swing_open 
03DA: set_garage $214 camera_follows_player 
057A: set_garage $214 max_cars_to 2 
0219: $215 = create_garage_type 30 door -1015.436 -802.265 6.325 to -1015.436 -821.865 10.73 depth -1024.909 -802.265 
03BB: set_garage $215 door_type_to_swing_open 
03DA: set_garage $215 camera_follows_player 
057A: set_garage $215 max_cars_to 2 
0219: $216 = create_garage_type 31 door -362.12 -550.214 11.722 to -353.12 -550.214 15.16 depth -362.12 -539.484 
03BB: set_garage $216 door_type_to_swing_open 

 

 

 

 

 

But what about new garages,ZaZ

I know everything you wrote

Iam just editing my gta vcs mod from Sal

Because unfortunately

Sal didn't upload 2.6 version

So Hose the hoes Mission and Garages can't

Exist

So I have the garage door

I have sunny builder

I have the coordinates

Now how I would do that

Please respond quickly if you have experience in this

Link to comment
Share on other sites

On 6/13/2021 at 10:19 PM, Bodethedestroyer said:

But what about new garages,ZaZ

Now how I would do that

Please respond quickly if you have experience in this

 

Sorry, quickly wasn't possible, because i have a real life

but i got it

 

I think that you can't add an additional garage with working save function to originally main.scm
But you can make custom garages for TC's

 

 

 


The method to define the save area:

WEST - SOUTH - MIN.HEIGHT corner /to/ EAST - SOUTH - MAX.HEIGHT corner /depth/ WEST - NORTH corner

0219: $216 = create_garage_type 31 door /WEST - SOUTH - MIN.HEIGHT/ (corner) to /EAST - SOUTH - MAX.HEIGHT/ (corner) depth /WEST - NORTH/ (corner)

 

That's the usual way to define areas in gta
WEST - SOUTH - MIN.HEIGHT corner to EAST - SOUTH - MAX.HEIGHT

Or in other words: first the corner with the smaller values, then the corner with the bigger values

 

What depth means isn't important, i could see in existing garage definitions, that it needs to define a WEST - NORTH corner

BUT MAKE SURE THAT both WEST coords are the same as well as that both SOUTH coords are the same


IMPORTANT: the coords for height should be lower than expected

I did hard work and several trials without success.

 

Then i saw that the garage at Vercetti Estate have lower coords for the height

 

The ground at Vercetti Estate is at 13.2
and this the originally garage definition of the mansion garage:
0219: $686 = create_garage_type 1 door -362.12 -550.214 11.722 to -353.12 -550.214 15.16 depth -362.12 -539.484

11.722 instead 13.2, ca. 1,5 units lower

15.16 as max height, just 2 units above the ground

 

Garage TYPE is actually the ID
look to the table at https://gtamods.com/wiki/Garage#Types_of_Garages
Each garage have it's own ID

So i think that you can't add an additional garage with working save function to originally main.scm
But you can make custom garages for TC's


I give 2 examples

 

First garage example creates a garage at Vercetti Estate, on the other side of the stairway
The originally garage is at left side of the big stairway
The new garage is at right side of the big stairway

 

I moved the garage door inside of mansion.IPL to this
 

2548, man_frntstepGD, 0, -357.618988, -539.7459717, 14.97500038, 1, 1, 1, 0, 0, 0.7071067691, 0.7071067691

 

the garage codes:
 

0219: $216 = create_garage_type 31 door -401.8 -539.2 11.722 to -392.9 -539.2 15.16 depth -401.8 -526.1
03BB: set_garage $216 door_type_to_swing_open
057A: set_garage $216 max_cars_to 2

 

the complete "test stripped main.scm" with carspawn and save script, inside the spoiler

Spoiler

DEFINE OBJECTS 8
DEFINE OBJECT (Sannybuilder code)                
DEFINE OBJECT KILLFRENZY               // Object number -1
DEFINE OBJECT BRIBE                    // Object number -2
DEFINE OBJECT INFO                     // Object number -3
DEFINE OBJECT BODYARMOUR               // Object number -4
DEFINE OBJECT HEALTH                   // Object number -5
DEFINE OBJECT ADRENALINE               // Object number -6
DEFINE OBJECT PICKUPSAVE               // Object number -7

DEFINE MISSIONS 0

//-------------MAIN---------------
03A4: name_thread 'MAIN' 
016A: fade 0 0 ms 
01F0: set_max_wanted_level_to 6 
0111: set_wasted_busted_check_to 0 
00C0: set_current_time 10 0 
04E4: unknown_refresh_game_renderer_at -248.01 -518.9
03CB: set_camera -248.01 -518.9 12.8 
0053: $PLAYER_CHAR = create_player #NULL at -248.01 -518.9 12.8 
01F5: $PLAYER_ACTOR = create_emulated_actor_from_player $PLAYER_CHAR
0001: wait 0 ms 
01B6: set_weather 0 
if 
8118:   not actor $PLAYER_ACTOR dead 
jf @MAIN_133 
0352: set_actor $PLAYER_ACTOR skin_to 'PLAYER' 
038B: load_requested_models 
0353: refresh_actor $PLAYER_ACTOR 
0171: set_player $PLAYER_CHAR z_angle_to 99.4


004F: create_thread @P_SAVE
004F: create_thread @Carspawn_thread


:MAIN_133
016A: fade 1 1000 ms 
if 
0256:   player $PLAYER_CHAR defined 
jf @MAIN_169 
04BB: select_interiour 0 // select render area 
01B4: set_player $PLAYER_CHAR frozen_state 1 
01B6: set_weather 4
0330: set_player $PLAYER_CHAR infinite_run_to 1 
055D: make_player $PLAYER_CHAR fireproof 1 
055E: set_player $PLAYER_CHAR max_health += 100 
055F: set_player $PLAYER_CHAR max_armour += 100 
035E: set_player $PLAYER_CHAR armour_to 200 
0222: set_player $PLAYER_CHAR health_to 200 
032B: $1388 = create_weapon_pickup #M4 15 ammo 120 at -330.9 -569.7 11.6 
032B: $1389 = create_weapon_pickup #CHROMEGUN 15 ammo 50 at -335.9 -569.5 11.6 
0213: $1390 = create_pickup #HEALTH type 2 at -330.702 -573.366 11.6 
0213: $1391 = create_pickup #BODYARMOUR type 2 at -336.0 -573.7 11.6 
0109: player $PLAYER_CHAR money += 90000

0219: $216 = create_garage_type 31 door -401.8 -539.2 11.722 to -392.9 -539.2 15.16 depth -401.8 -526.1
03BB: set_garage $216 door_type_to_swing_open
057A: set_garage $216 max_cars_to 2 

 

:MAIN_169
0001: wait 2500 ms 
jump @MAIN_169



:Carspawn_thread
03A4: name_thread 'CARSPN'
014B: $25 = init_parked_car_generator #HOTRING -1 -1 1 alarm 0 door_lock 0 0 10000 at -316.1 -519.7 12.8 angle 273.6 
014C: set_parked_car_generator $25 cars_to_generate_to 101
0247: request_model #CUBAN

:Carspawn_thread_1
wait 0
if
0248:   model #CUBAN available
jf @Carspawn_thread_1

00A5: 1@ = create_car #CUBAN at -239.49 -505.63 12.8
0175: set_car 1@ z_angle_to 270.4
wait 250
0249: release_model #CUBAN
01C3: remove_references_to_car 1@ // Like turning a car into any random car
004E: end_thread



:P_SAVE
thread 'PSAVE'
0570: $188 = create_asset_radar_marker_with_icon 19 at -273.5 -519.1 12.8 
018B: show_on_radar $188 2

:PSAVE_01
wait 250 
if 
0256:   player $PLAYER_CHAR defined 
jf @PSAVE_13 
if 
03EE:   player $PLAYER_CHAR controllable 
jf @PSAVE_13 
if 
    $ONMISSION == 0 // integer values 
jf @PSAVE_09 
if 
$267 == 0
jf @PSAVE_03 
0213: $268 = create_pickup #PICKUPSAVE type 3 at -273.5 -519.1 12.8 
$267 = 1 

:PSAVE_03
if 
0214:   pickup $268 picked_up 
jf @PSAVE_07 
0050: gosub @SavSub_1 
if 
0256:   player $PLAYER_CHAR defined 
jf @PSAVE_05 
0215: destroy_pickup $268 
0213: $268 = create_pickup #PICKUPSAVE type 3 at -273.5 -519.1 12.8 
016A: fade 1 1000 ms 
0395: clear_area 1 at -261.8 -523.6 range 25.3 1.0 
0055: put_player $PLAYER_CHAR at -261.8 -523.6 12.8 
0171: set_player $PLAYER_CHAR z_angle_to 233.8

:PSAVE_05
0050: gosub @SavSub_11 

:PSAVE_07
jump @PSAVE_13 

:PSAVE_09
if 
$267 == 1 
jf @PSAVE_13 
0215: destroy_pickup $268 
$267 = 0

:PSAVE_13
jump @PSAVE_01





:SavSub_1
0004: $ONMISSION = 1 // integer values 
01B4: set_player $PLAYER_CHAR frozen_state 0 
03D8: show_save_screen 
0001: wait 0 ms 

:SavSub_2
00D6: if 
83D9:   not save_done 
004D: jump_if_false @SavSub_3 
0001: wait 0 ms 
0002: jump @SavSub_2 

:SavSub_3
0169: set_fade_color 0 0 0 
016A: fade 0 1000 ms 
00D6: if 
0256:   player $PLAYER_CHAR defined 
004D: jump_if_false @SavSub_4 
0222: set_player $PLAYER_CHAR health_to 200 
01B4: set_player $PLAYER_CHAR frozen_state 0 

:SavSub_4
0051: return 



:SavSub_11
00D6: if 
0256:   player $PLAYER_CHAR defined 
004D: jump_if_false @SavSub_12 
02EB: restore_camera_with_jumpcut 
0373: set_camera_directly_behind_player 

:SavSub_12
0001: wait 500 ms 
00D6: if 
0256:   player $PLAYER_CHAR defined 
004D: jump_if_false @SavSub_13 
01B4: set_player $PLAYER_CHAR frozen_state 1 
0004: $ONMISSION = 0 // integer values 

:SavSub_13
0051: return








 

 

 

 

 

Second garage example creates a garage at the airport nearby the tower
The whole hangar, next to the fire station, is the save garage area
A door isn't neccesary, so it don't have any door

 

the garage codes:
 

0219: $216 = create_garage_type 31 door -1817.05 -956.2 11.722 to -1772.19 -956.2 15.16 depth -1817.05 -911.36
057A: set_garage $216 max_cars_to 4


below the complete "test stripped main.scm" with carspawn and save script

DEFINE OBJECTS 8
DEFINE OBJECT (Sannybuilder code)                
DEFINE OBJECT KILLFRENZY               // Object number -1
DEFINE OBJECT BRIBE                    // Object number -2
DEFINE OBJECT INFO                     // Object number -3
DEFINE OBJECT BODYARMOUR               // Object number -4
DEFINE OBJECT HEALTH                   // Object number -5
DEFINE OBJECT ADRENALINE               // Object number -6
DEFINE OBJECT PICKUPSAVE               // Object number -7

DEFINE MISSIONS 0

//-------------MAIN---------------
03A4: name_thread 'MAIN' 
016A: fade 0 0 ms 
01F0: set_max_wanted_level_to 6 
0111: set_wasted_busted_check_to 0 
00C0: set_current_time 10 0 
04E4: unknown_refresh_game_renderer_at -1770.3308 -890.99
03CB: set_camera -1770.3308 -890.9949 14.868 
0053: $PLAYER_CHAR = create_player #NULL at -1770.3308 -890.9949 14.868 
01F5: $PLAYER_ACTOR = create_emulated_actor_from_player $PLAYER_CHAR
0001: wait 0 ms 
01B6: set_weather 0 
if 
8118:   not actor $PLAYER_ACTOR dead 
jf @MAIN_133 
0352: set_actor $PLAYER_ACTOR skin_to 'PLAYER' 
038B: load_requested_models 
0353: refresh_actor $PLAYER_ACTOR 
0171: set_player $PLAYER_CHAR z_angle_to 270.0


004F: create_thread @P_SAVE
004F: create_thread @Carspawn_thread


:MAIN_133
016A: fade 1 1000 ms 
if 
0256:   player $PLAYER_CHAR defined 
jf @MAIN_169 
04BB: select_interiour 0 // select render area 
01B4: set_player $PLAYER_CHAR frozen_state 1 
0330: set_player $PLAYER_CHAR infinite_run_to 1 
055D: make_player $PLAYER_CHAR fireproof 1 
055E: set_player $PLAYER_CHAR max_health += 100 
055F: set_player $PLAYER_CHAR max_armour += 100 
035E: set_player $PLAYER_CHAR armour_to 200 
0222: set_player $PLAYER_CHAR health_to 200 
032B: $1388 = create_weapon_pickup #M4 15 ammo 120 at -330.9 -569.7 11.6 
032B: $1389 = create_weapon_pickup #CHROMEGUN 15 ammo 50 at -335.9 -569.5 11.6 
0213: $1390 = create_pickup #HEALTH type 2 at -330.702 -573.366 11.6 
0213: $1391 = create_pickup #BODYARMOUR type 2 at -336.0 -573.7 11.6 
0109: player $PLAYER_CHAR money += 90000


//0219: $216 = create_garage_type 31 door /WEST - SOUTH - MIN.HEIGHT/ (corner) to /EAST - SOUTH - MAX.HEIGHT/ (corner) depth /WEST - NORTH/ (corner)
0219: $216 = create_garage_type 31 door -1817.05 -956.2 11.722 to -1772.19 -956.2 15.16 depth -1817.05 -911.36
057A: set_garage $216 max_cars_to 4

 

:MAIN_169
0001: wait 2500 ms 
jump @MAIN_169



:Carspawn_thread
03A4: name_thread 'CARSPN'
014B: $25 = init_parked_car_generator #HOTRING -1 -1 1 alarm 0 door_lock 0 0 10000 at -1761.1 -971.9 14.9 angle 272.0 
014C: set_parked_car_generator $25 cars_to_generate_to 101
0247: request_model #CUBAN

:Carspawn_thread_1
wait 0
if
0248:   model #CUBAN available
jf @Carspawn_thread_1

00A5: 1@ = create_car #CUBAN at -1765.7 -871.3 14.9
0175: set_car 1@ z_angle_to 179.1
wait 250
0249: release_model #CUBAN
01C3: remove_references_to_car 1@ // Like turning a car into any random car
004E: end_thread



:P_SAVE
thread 'PSAVE'
0570: $188 = create_asset_radar_marker_with_icon 19 at -1773.8 -902.1 14.8 
018B: show_on_radar $188 2

:PSAVE_01
wait 250 
if 
0256:   player $PLAYER_CHAR defined 
jf @PSAVE_13 
if 
03EE:   player $PLAYER_CHAR controllable 
jf @PSAVE_13 
if 
    $ONMISSION == 0 // integer values 
jf @PSAVE_09 
if 
$267 == 0
jf @PSAVE_03 
0213: $268 = create_pickup #PICKUPSAVE type 3 at -1773.8 -902.1 14.8 
$267 = 1 

:PSAVE_03
if 
0214:   pickup $268 picked_up 
jf @PSAVE_07 
0050: gosub @SavSub_1 
if 
0256:   player $PLAYER_CHAR defined 
jf @PSAVE_05 
0215: destroy_pickup $268 
0213: $268 = create_pickup #PICKUPSAVE type 3 at -1773.8 -902.1 14.8 
016A: fade 1 1000 ms 
0395: clear_area 1 at -1770.3308 -890.994 range 25.3 1.0 
0055: put_player $PLAYER_CHAR at -1770.33 -890.99 14.9 
0171: set_player $PLAYER_CHAR z_angle_to 270.0 

:PSAVE_05
0050: gosub @SavSub_11 

:PSAVE_07
jump @PSAVE_13 

:PSAVE_09
if 
$267 == 1 
jf @PSAVE_13 
0215: destroy_pickup $268 
$267 = 0

:PSAVE_13
jump @PSAVE_01





:SavSub_1
0004: $ONMISSION = 1 // integer values 
01B4: set_player $PLAYER_CHAR frozen_state 0 
03D8: show_save_screen 
0001: wait 0 ms 

:SavSub_2
00D6: if 
83D9:   not save_done 
004D: jump_if_false @SavSub_3 
0001: wait 0 ms 
0002: jump @SavSub_2 

:SavSub_3
0169: set_fade_color 0 0 0 
016A: fade 0 1000 ms 
00D6: if 
0256:   player $PLAYER_CHAR defined 
004D: jump_if_false @SavSub_4 
0222: set_player $PLAYER_CHAR health_to 200 
01B4: set_player $PLAYER_CHAR frozen_state 0 

:SavSub_4
0051: return 



:SavSub_11
00D6: if 
0256:   player $PLAYER_CHAR defined 
004D: jump_if_false @SavSub_12 
02EB: restore_camera_with_jumpcut 
0373: set_camera_directly_behind_player 

:SavSub_12
0001: wait 500 ms 
00D6: if 
0256:   player $PLAYER_CHAR defined 
004D: jump_if_false @SavSub_13 
01B4: set_player $PLAYER_CHAR frozen_state 1 
0004: $ONMISSION = 0 // integer values 

:SavSub_13
0051: return








 

 

 

 

 

 

 

 

 

 

 

 

Edited by ZAZ
Link to comment
Share on other sites

Bodethedestroyer
On 6/19/2021 at 11:58 PM, ZAZ said:

 

Sorry, quickly wasn't possible, because i have a real life

but i got it

 

I think that you can't add an additional garage with working save function to originally main.scm
But you can make custom garages for TC's

 

 

 


The method to define the save area:

WEST - SOUTH - MIN.HEIGHT corner /to/ EAST - SOUTH - MAX.HEIGHT corner /depth/ WEST - NORTH corner


0219: $216 = create_garage_type 31 door /WEST - SOUTH - MIN.HEIGHT/ (corner) to /EAST - SOUTH - MAX.HEIGHT/ (corner) depth /WEST - NORTH/ (corner)

 

That's the usual way to define areas in gta
WEST - SOUTH - MIN.HEIGHT corner to EAST - SOUTH - MAX.HEIGHT

Or in other words: first the corner with the smaller values, then the corner with the bigger values

 

What depth means isn't important, i could see in existing garage definitions, that it needs to define a WEST - NORTH corner

BUT MAKE SURE THAT both WEST coords are the same as well as that both SOUTH coords are the same


IMPORTANT: the coords for height should be lower than expected

I did hard work and several trials without success.

 

Then i saw that the garage at Vercetti Estate have lower coords for the height

 

The ground at Vercetti Estate is at 13.2
and this the originally garage definition of the mansion garage:
0219: $686 = create_garage_type 1 door -362.12 -550.214 11.722 to -353.12 -550.214 15.16 depth -362.12 -539.484

11.722 instead 13.2, ca. 1,5 units lower

15.16 as max height, just 2 units above the ground

 

Garage TYPE is actually the ID
look to the table at https://gtamods.com/wiki/Garage#Types_of_Garages
Each garage have it's own ID

So i think that you can't add an additional garage with working save function to originally main.scm
But you can make custom garages for TC's


I give 2 examples

 

First garage example creates a garage at Vercetti Estate, on the other side of the stairway
The originally garage is at left side of the big stairway
The new garage is at right side of the big stairway

 

I moved the garage door inside of mansion.IPL to this
 


2548, man_frntstepGD, 0, -357.618988, -539.7459717, 14.97500038, 1, 1, 1, 0, 0, 0.7071067691, 0.7071067691

 

the garage codes:
 


0219: $216 = create_garage_type 31 door -401.8 -539.2 11.722 to -392.9 -539.2 15.16 depth -401.8 -526.1
03BB: set_garage $216 door_type_to_swing_open
057A: set_garage $216 max_cars_to 2

 

the complete "test stripped main.scm" with carspawn and save script, inside the spoiler

  Reveal hidden contents


DEFINE OBJECTS 8
DEFINE OBJECT (Sannybuilder code)                
DEFINE OBJECT KILLFRENZY               // Object number -1
DEFINE OBJECT BRIBE                    // Object number -2
DEFINE OBJECT INFO                     // Object number -3
DEFINE OBJECT BODYARMOUR               // Object number -4
DEFINE OBJECT HEALTH                   // Object number -5
DEFINE OBJECT ADRENALINE               // Object number -6
DEFINE OBJECT PICKUPSAVE               // Object number -7

DEFINE MISSIONS 0

//-------------MAIN---------------
03A4: name_thread 'MAIN' 
016A: fade 0 0 ms 
01F0: set_max_wanted_level_to 6 
0111: set_wasted_busted_check_to 0 
00C0: set_current_time 10 0 
04E4: unknown_refresh_game_renderer_at -248.01 -518.9
03CB: set_camera -248.01 -518.9 12.8 
0053: $PLAYER_CHAR = create_player #NULL at -248.01 -518.9 12.8 
01F5: $PLAYER_ACTOR = create_emulated_actor_from_player $PLAYER_CHAR
0001: wait 0 ms 
01B6: set_weather 0 
if 
8118:   not actor $PLAYER_ACTOR dead 
jf @MAIN_133 
0352: set_actor $PLAYER_ACTOR skin_to 'PLAYER' 
038B: load_requested_models 
0353: refresh_actor $PLAYER_ACTOR 
0171: set_player $PLAYER_CHAR z_angle_to 99.4


004F: create_thread @P_SAVE
004F: create_thread @Carspawn_thread


:MAIN_133
016A: fade 1 1000 ms 
if 
0256:   player $PLAYER_CHAR defined 
jf @MAIN_169 
04BB: select_interiour 0 // select render area 
01B4: set_player $PLAYER_CHAR frozen_state 1 
01B6: set_weather 4
0330: set_player $PLAYER_CHAR infinite_run_to 1 
055D: make_player $PLAYER_CHAR fireproof 1 
055E: set_player $PLAYER_CHAR max_health += 100 
055F: set_player $PLAYER_CHAR max_armour += 100 
035E: set_player $PLAYER_CHAR armour_to 200 
0222: set_player $PLAYER_CHAR health_to 200 
032B: $1388 = create_weapon_pickup #M4 15 ammo 120 at -330.9 -569.7 11.6 
032B: $1389 = create_weapon_pickup #CHROMEGUN 15 ammo 50 at -335.9 -569.5 11.6 
0213: $1390 = create_pickup #HEALTH type 2 at -330.702 -573.366 11.6 
0213: $1391 = create_pickup #BODYARMOUR type 2 at -336.0 -573.7 11.6 
0109: player $PLAYER_CHAR money += 90000

0219: $216 = create_garage_type 31 door -401.8 -539.2 11.722 to -392.9 -539.2 15.16 depth -401.8 -526.1
03BB: set_garage $216 door_type_to_swing_open
057A: set_garage $216 max_cars_to 2 

 

:MAIN_169
0001: wait 2500 ms 
jump @MAIN_169



:Carspawn_thread
03A4: name_thread 'CARSPN'
014B: $25 = init_parked_car_generator #HOTRING -1 -1 1 alarm 0 door_lock 0 0 10000 at -316.1 -519.7 12.8 angle 273.6 
014C: set_parked_car_generator $25 cars_to_generate_to 101
0247: request_model #CUBAN

:Carspawn_thread_1
wait 0
if
0248:   model #CUBAN available
jf @Carspawn_thread_1

00A5: 1@ = create_car #CUBAN at -239.49 -505.63 12.8
0175: set_car 1@ z_angle_to 270.4
wait 250
0249: release_model #CUBAN
01C3: remove_references_to_car 1@ // Like turning a car into any random car
004E: end_thread



:P_SAVE
thread 'PSAVE'
0570: $188 = create_asset_radar_marker_with_icon 19 at -273.5 -519.1 12.8 
018B: show_on_radar $188 2

:PSAVE_01
wait 250 
if 
0256:   player $PLAYER_CHAR defined 
jf @PSAVE_13 
if 
03EE:   player $PLAYER_CHAR controllable 
jf @PSAVE_13 
if 
    $ONMISSION == 0 // integer values 
jf @PSAVE_09 
if 
$267 == 0
jf @PSAVE_03 
0213: $268 = create_pickup #PICKUPSAVE type 3 at -273.5 -519.1 12.8 
$267 = 1 

:PSAVE_03
if 
0214:   pickup $268 picked_up 
jf @PSAVE_07 
0050: gosub @SavSub_1 
if 
0256:   player $PLAYER_CHAR defined 
jf @PSAVE_05 
0215: destroy_pickup $268 
0213: $268 = create_pickup #PICKUPSAVE type 3 at -273.5 -519.1 12.8 
016A: fade 1 1000 ms 
0395: clear_area 1 at -261.8 -523.6 range 25.3 1.0 
0055: put_player $PLAYER_CHAR at -261.8 -523.6 12.8 
0171: set_player $PLAYER_CHAR z_angle_to 233.8

:PSAVE_05
0050: gosub @SavSub_11 

:PSAVE_07
jump @PSAVE_13 

:PSAVE_09
if 
$267 == 1 
jf @PSAVE_13 
0215: destroy_pickup $268 
$267 = 0

:PSAVE_13
jump @PSAVE_01





:SavSub_1
0004: $ONMISSION = 1 // integer values 
01B4: set_player $PLAYER_CHAR frozen_state 0 
03D8: show_save_screen 
0001: wait 0 ms 

:SavSub_2
00D6: if 
83D9:   not save_done 
004D: jump_if_false @SavSub_3 
0001: wait 0 ms 
0002: jump @SavSub_2 

:SavSub_3
0169: set_fade_color 0 0 0 
016A: fade 0 1000 ms 
00D6: if 
0256:   player $PLAYER_CHAR defined 
004D: jump_if_false @SavSub_4 
0222: set_player $PLAYER_CHAR health_to 200 
01B4: set_player $PLAYER_CHAR frozen_state 0 

:SavSub_4
0051: return 



:SavSub_11
00D6: if 
0256:   player $PLAYER_CHAR defined 
004D: jump_if_false @SavSub_12 
02EB: restore_camera_with_jumpcut 
0373: set_camera_directly_behind_player 

:SavSub_12
0001: wait 500 ms 
00D6: if 
0256:   player $PLAYER_CHAR defined 
004D: jump_if_false @SavSub_13 
01B4: set_player $PLAYER_CHAR frozen_state 1 
0004: $ONMISSION = 0 // integer values 

:SavSub_13
0051: return








 

 

 

 

 

Second garage example creates a garage at the airport nearby the tower
The whole hangar, next to the fire station, is the save garage area
A door isn't neccesary, so it don't have any door

 

the garage codes:
 


0219: $216 = create_garage_type 31 door -1817.05 -956.2 11.722 to -1772.19 -956.2 15.16 depth -1817.05 -911.36
057A: set_garage $216 max_cars_to 4


below the complete "test stripped main.scm" with carspawn and save script


DEFINE OBJECTS 8
DEFINE OBJECT (Sannybuilder code)                
DEFINE OBJECT KILLFRENZY               // Object number -1
DEFINE OBJECT BRIBE                    // Object number -2
DEFINE OBJECT INFO                     // Object number -3
DEFINE OBJECT BODYARMOUR               // Object number -4
DEFINE OBJECT HEALTH                   // Object number -5
DEFINE OBJECT ADRENALINE               // Object number -6
DEFINE OBJECT PICKUPSAVE               // Object number -7

DEFINE MISSIONS 0

//-------------MAIN---------------
03A4: name_thread 'MAIN' 
016A: fade 0 0 ms 
01F0: set_max_wanted_level_to 6 
0111: set_wasted_busted_check_to 0 
00C0: set_current_time 10 0 
04E4: unknown_refresh_game_renderer_at -1770.3308 -890.99
03CB: set_camera -1770.3308 -890.9949 14.868 
0053: $PLAYER_CHAR = create_player #NULL at -1770.3308 -890.9949 14.868 
01F5: $PLAYER_ACTOR = create_emulated_actor_from_player $PLAYER_CHAR
0001: wait 0 ms 
01B6: set_weather 0 
if 
8118:   not actor $PLAYER_ACTOR dead 
jf @MAIN_133 
0352: set_actor $PLAYER_ACTOR skin_to 'PLAYER' 
038B: load_requested_models 
0353: refresh_actor $PLAYER_ACTOR 
0171: set_player $PLAYER_CHAR z_angle_to 270.0


004F: create_thread @P_SAVE
004F: create_thread @Carspawn_thread


:MAIN_133
016A: fade 1 1000 ms 
if 
0256:   player $PLAYER_CHAR defined 
jf @MAIN_169 
04BB: select_interiour 0 // select render area 
01B4: set_player $PLAYER_CHAR frozen_state 1 
0330: set_player $PLAYER_CHAR infinite_run_to 1 
055D: make_player $PLAYER_CHAR fireproof 1 
055E: set_player $PLAYER_CHAR max_health += 100 
055F: set_player $PLAYER_CHAR max_armour += 100 
035E: set_player $PLAYER_CHAR armour_to 200 
0222: set_player $PLAYER_CHAR health_to 200 
032B: $1388 = create_weapon_pickup #M4 15 ammo 120 at -330.9 -569.7 11.6 
032B: $1389 = create_weapon_pickup #CHROMEGUN 15 ammo 50 at -335.9 -569.5 11.6 
0213: $1390 = create_pickup #HEALTH type 2 at -330.702 -573.366 11.6 
0213: $1391 = create_pickup #BODYARMOUR type 2 at -336.0 -573.7 11.6 
0109: player $PLAYER_CHAR money += 90000


//0219: $216 = create_garage_type 31 door /WEST - SOUTH - MIN.HEIGHT/ (corner) to /EAST - SOUTH - MAX.HEIGHT/ (corner) depth /WEST - NORTH/ (corner)
0219: $216 = create_garage_type 31 door -1817.05 -956.2 11.722 to -1772.19 -956.2 15.16 depth -1817.05 -911.36
057A: set_garage $216 max_cars_to 4

 

:MAIN_169
0001: wait 2500 ms 
jump @MAIN_169



:Carspawn_thread
03A4: name_thread 'CARSPN'
014B: $25 = init_parked_car_generator #HOTRING -1 -1 1 alarm 0 door_lock 0 0 10000 at -1761.1 -971.9 14.9 angle 272.0 
014C: set_parked_car_generator $25 cars_to_generate_to 101
0247: request_model #CUBAN

:Carspawn_thread_1
wait 0
if
0248:   model #CUBAN available
jf @Carspawn_thread_1

00A5: 1@ = create_car #CUBAN at -1765.7 -871.3 14.9
0175: set_car 1@ z_angle_to 179.1
wait 250
0249: release_model #CUBAN
01C3: remove_references_to_car 1@ // Like turning a car into any random car
004E: end_thread



:P_SAVE
thread 'PSAVE'
0570: $188 = create_asset_radar_marker_with_icon 19 at -1773.8 -902.1 14.8 
018B: show_on_radar $188 2

:PSAVE_01
wait 250 
if 
0256:   player $PLAYER_CHAR defined 
jf @PSAVE_13 
if 
03EE:   player $PLAYER_CHAR controllable 
jf @PSAVE_13 
if 
    $ONMISSION == 0 // integer values 
jf @PSAVE_09 
if 
$267 == 0
jf @PSAVE_03 
0213: $268 = create_pickup #PICKUPSAVE type 3 at -1773.8 -902.1 14.8 
$267 = 1 

:PSAVE_03
if 
0214:   pickup $268 picked_up 
jf @PSAVE_07 
0050: gosub @SavSub_1 
if 
0256:   player $PLAYER_CHAR defined 
jf @PSAVE_05 
0215: destroy_pickup $268 
0213: $268 = create_pickup #PICKUPSAVE type 3 at -1773.8 -902.1 14.8 
016A: fade 1 1000 ms 
0395: clear_area 1 at -1770.3308 -890.994 range 25.3 1.0 
0055: put_player $PLAYER_CHAR at -1770.33 -890.99 14.9 
0171: set_player $PLAYER_CHAR z_angle_to 270.0 

:PSAVE_05
0050: gosub @SavSub_11 

:PSAVE_07
jump @PSAVE_13 

:PSAVE_09
if 
$267 == 1 
jf @PSAVE_13 
0215: destroy_pickup $268 
$267 = 0

:PSAVE_13
jump @PSAVE_01





:SavSub_1
0004: $ONMISSION = 1 // integer values 
01B4: set_player $PLAYER_CHAR frozen_state 0 
03D8: show_save_screen 
0001: wait 0 ms 

:SavSub_2
00D6: if 
83D9:   not save_done 
004D: jump_if_false @SavSub_3 
0001: wait 0 ms 
0002: jump @SavSub_2 

:SavSub_3
0169: set_fade_color 0 0 0 
016A: fade 0 1000 ms 
00D6: if 
0256:   player $PLAYER_CHAR defined 
004D: jump_if_false @SavSub_4 
0222: set_player $PLAYER_CHAR health_to 200 
01B4: set_player $PLAYER_CHAR frozen_state 0 

:SavSub_4
0051: return 



:SavSub_11
00D6: if 
0256:   player $PLAYER_CHAR defined 
004D: jump_if_false @SavSub_12 
02EB: restore_camera_with_jumpcut 
0373: set_camera_directly_behind_player 

:SavSub_12
0001: wait 500 ms 
00D6: if 
0256:   player $PLAYER_CHAR defined 
004D: jump_if_false @SavSub_13 
01B4: set_player $PLAYER_CHAR frozen_state 1 
0004: $ONMISSION = 0 // integer values 

:SavSub_13
0051: return








 

 

 

 

 

 

 

 

 

 

 

 

OK Zaz what about doors

Link to comment
Share on other sites

On 6/23/2021 at 1:16 AM, Bodethedestroyer said:

OK Zaz what about doors

 

Garage doors are working automaticly, when it's placed at the save area, as you can see in First garage example

 

But it needs working collision

 

VC map objects become buggy if ipl and ide as well as col have different names

 

So, if you put the garage door of mansion into airport.ipl to give it to the Second garage example,
then it doesn't have collision and won't work

 

2548, man_frntstepGD, 0, -1780.95, -930.2, 17.1, 1, 1, 1, 0, 0, 0, 1

 

But if you add this line to mansion.ipl, then the Second garage example at airport have a working garage door.

Use opcode 03BB: to give the door swing movement

 

Edited by ZAZ
Link to comment
Share on other sites

Bodethedestroyer
On 6/24/2021 at 6:56 PM, ZAZ said:

 

Garage doors are working automaticly, when it's placed at the save area, as you can see in First garage example

 

But it needs working collision

 

VC map objects become buggy if ipl and ide as well as col have different names

 

So, if you put the garage door of mansion into airport.ipl to give it to the Second garage example,
then it doesn't have collision and won't work

 

2548, man_frntstepGD, 0, -1780.95, -930.2, 17.1, 1, 1, 1, 0, 0, 0, 1

 

But if you add this line to mansion.ipl, then the Second garage example at airport have a working garage door.

Use opcode 03BB: to give the door swing movement

 

I tried it 

AND IT WORKED

but i used the Havana spray garage door

And when I saved the car inside the garage

It worked

Thank you very much Zaz

I appreciate it a lot man

Soon I will try to give you the garage example video

Link to comment
Share on other sites

Great, I'm looking forward to the video

  • Like 1
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.