Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
      4. Frontier Pursuits
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Diamond Casino & Resort
      2. DLC
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA IV Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA SA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA VC Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA III Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. News

    2. Forum Support

    3. Site Suggestions

nubbel

savegarage creation

Recommended Posts

Demarest

I really want a mod to do this, now!
So... make one rampage_ani.gif

 

 

I really want to have a car available at Madd Doggs mansion. (mine now)
If you find such a mod here, the mansion won't be yours anymore sly.gif

Share this post


Link to post
Share on other sites
nubbel

 

The code I wrote is right here: GARAGE3.TXT

I was asking if you could link to a text file that contains ALL of the SCM code through

 

:MAIN_63700D6: if  00038:   $157 ==  1;; integer values004D: jump_if_false ££MAIN_6410004: $157 =  0;; integer values:MAIN_6410002: jump ££MAIN_392

 

...INCLUDING your added code. If I can see all of it together, maybe I can spot why it's not behaving properly.

So, you are askig for this: GARAGE4.txt ?

 

Or do you also need all code from :MAIN_1 ?

Its the word "THROUGH" I dont really understand in this case sad.gif

 

 

//EDIT: Strange, I put my driveby code just next to this garage code (you know which driveby code I mean, dont you? and remember this code works).

I discovered that this code also is not executed after I load a saved game.

This makes no sense to me confused.gif

 

 

Thanks for your time!

Edited by nubbel

Share this post


Link to post
Share on other sites
Guill

i might have made some advancement on the save garage code with thanks to nubbel.

only stores 1 car and the colours atm but it will survive a save and reload

too many of them and its going to hit the memory limit confused.gif

 

user posted image

 

 

  :GRG_0103A4: name_thread 'GRG'0004: $gstored1 = 0;Car stored:GRG_020001: wait  0 ms00D6: if  10038:  $gstored1 ==  0 ;; integer values   004D: jump_if_false ££GRG_02;CAR IN GRG?:GRG_040001: wait  0 ms00D6: if  10103:  actor $PLAYER_ACTOR stopped_near_point_in_car   1644.437 -1549.561 13.39254  radius  5.0  5.0  5.0 sphere  1   00E1:   key_pressed  0  15 004D: jump_if_false ££GRG_04 ;STORE CAR:GRG_050811: @0 = actor $PLAYER_ACTOR car0441: $gtype1 = car @0 model0407: create_coordinate $gcoorx1 $gcoory1 $gcoorz1 from_car @0 offset 0.0 0.0 0.00174: $gzang1 = car @0 z_angle03F3: get car @0 color $gcol1 $gcol20004: $gstored1 = 1;Car stored;HAS PLAYER LEFT GRG?:GRG_110001: wait  0 ms00D6: if  100A3:   actor $PLAYER_ACTOR  0 ()in_rectangle  1633.214 -1532.919     1653.687 -1557.562 004D: jump_if_false ££GRG_200002: jump ££GRG_11;EMPTY GRG:GRG_2000A6: destroy_car $storedcars ;0395: clear_area  2 at  1644.437 -1549.561 13.39254  range  8.0;HAS PLAYER COME BACK?:GRG_250001: wait  0 ms00D6: if  100A3:   actor $PLAYER_ACTOR  0 ()in_rectangle  1633.214 -1532.919     1653.687 -1557.562004D: jump_if_false ££GRG_25;RECREATE CAR:GRG_1040247: request_model $gtype1:GRG_1050001: wait 0 ms00D6: if 00248:   model $gtype1 available004D: jump_if_false ££GRG_1050001: wait 250 ms00A5: $storedcars = create_car $gtype1 at $gcoorx1 $gcoory1 $gcoorz1     0229: set_car $storedcars color_to  $gcol1  $gcol2 0175: set_car_z_angle $storedcars $gzang10004: $gstored1 = 0;Car stored:GRG_1150001: wait  0 ms:GRG_12500D6: if  100A3:   actor $PLAYER_ACTOR  0 ()in_rectangle  1633.214 -1532.919     1653.687 -1557.562	004D: jump_if_false ££GRG_1300002: jump ££GRG_115:GRG_1300001: wait  0 ms00D6: if  100B0:   car $storedcars  0 ()in_rectangle  1637.371 -1552.999    1646.839 -1543.693004D: jump_if_false ££GRG_135 0002: jump ££GRG_130:GRG_1350002: jump ££GRG_02

 

 

i am quite new to SCM so be forgiving biggrin.gif

Edited by Guill

Share this post


Link to post
Share on other sites
nubbel

As I already said in the IRC: Really good work, thanks for your information! Awesome! xmas.gif

I will have to try around with the code and see where critical issues are.

 

 

too many of them and its going to hit the memory limit

 

Do you mean if you try to save 2 cars for example, that doesnt work?

If so, I guess its time for "bitcoding". But I cant do that confused.gif

Share this post


Link to post
Share on other sites
Y_Less
Well Patrick did 40, so I don't think 2 will be a problem.

Share this post


Link to post
Share on other sites
nubbel

Well, I can now say: Cool, we are success!

Thanks again Guill for your code, I tried around and figured out some bugs. In your code, if you save the car, go away and return to the garage the car is spawned, but it wont be restored again after that.

Thats only because there is a missing if-statement for that.

 

There are also some minor bugs like

 

 

00D6: if  100A3:   actor $PLAYER_ACTOR  0 ()in_rectangle  1633.214 -1532.919     1653.687 -1557.562 004D: jump_if_false ££GRG_20

 

what should be "if 0".

 

Also I think a "remove_references_to_car" is needed.

 

Last point is that there must be a check if you took the car and drove away with it, so it is deleted from the garage.

 

I have done all of that, tried all steps like saving car, going away, returning, going away, returning, taking car out of the garage, returning and all of this combined with saving and loading processes.

 

Finally, I now have a (as far as I can say) fully working garage for 1 car!

Here comes the code:

 

 

:GRG_0103A4: name_thread 'GRG'0004: $gstored1 = 0;Car stored:GRG_020001: wait  0 ms 00D6: if  00038:  $gstored1 ==  0;; integer values   004D: jump_if_false ££GRG_02;In sphere and exits car?:GRG_0400D6: if  10103:   actor $PLAYER_ACTOR stopped_near_point_in_car   1644.437 -1549.561 13.39254  radius  5.0  5.0  5.0 sphere  1  00E1:   key_pressed  0  15 004D: jump_if_false ££GRG_04_20002: jump ££GRG_05      ;Player near garage?:GRG_04_20001: wait  0 ms00D6: if  100A3:   actor $PLAYER_ACTOR  0 ()in_rectangle  1633.214 -1532.919     1653.687 -1557.5628038:   NOT $gtype1 == 0;; integer values    <- check if car exists004D: jump_if_false ££GRG_020002: jump ££GRG_100;Store the car:GRG_050811: @0 = actor $PLAYER_ACTOR car0441: $gtype1 = car @0 model0407: create_coordinate $gcoorx1 $gcoory1 $gcoorz1 from_car @0 offset 0.0 0.0 0.00174: $gzang1 = car @0 z_angle03F3: get car @0 color $gcol1 $gcol20004: $gstored1 = 1;Car stored;Player goes away?:GRG_110001: wait  0 ms00D6: if  000A3:   actor $PLAYER_ACTOR  0 ()in_rectangle  1616.958 -1508.342    1667.599 -1571.379004D: jump_if_false ££GRG_200002: jump ££GRG_11;Clear area:GRG_2001C3: remove_references_to_car  @0 ;; Like turning a car into any random car0395: clear_area  2 at  1644.437 -1549.561 13.39254  range  5.0;Player near garage?:GRG_250001: wait  0 ms00D6: if  100A3:   actor $PLAYER_ACTOR  0 ()in_rectangle  1633.214 -1532.919     1653.687 -1557.5628038:   NOT $gtype1 == 0;; integer values    <- check if car exists004D: jump_if_false ££GRG_25;Respawn the car:GRG_1000247: request_model $gtype1:GRG_1050001: wait 0 ms00D6: if 00248:   model $gtype1 available004D: jump_if_false ££GRG_105  ;0001: wait 250 ms00A5: @0 = create_car $gtype1 at $gcoorx1 $gcoory1 $gcoorz1     0229: set_car @0 color_to  $gcol1  $gcol2 0175: set_car_z_angle @0 $gzang10004: $gstored1 = 1;Car stored;Player goes away?:GRG_1150001: wait  0 ms00D6: if  000A3:   actor $PLAYER_ACTOR  0 ()in_rectangle  1633.214 -1532.919     1653.687 -1557.562004D: jump_if_false ££GRG_1350002: jump ££GRG_115;Player took car out?:GRG_1350001: wait  0 ms00D6: if  000DB:   actor $PLAYER_ACTOR in_car @0004D: jump_if_false ££GRG_140;Delete the saved car0004: $gtype1 = 0;; integer values;Clear area:GRG_14001C3: remove_references_to_car  @0 ;; Like turning a car into any random car0395: clear_area  2 at  1644.437 -1549.561 13.39254  range  5.0:GRG_END0004: $gstored1 = 0;Car stored0002: jump ££GRG_02

 

 

Would be nice if some more advanced coders could look at the code to figure out more issues.

Thanks to Guill, Dem, and all of you. I'm really happy now, because I think this is a major step to creating new garages via SCM coding xmas.gif

 

nubbel

Share this post


Link to post
Share on other sites
Guill

i wrote a small car store array to test if they survive a save.

 

 

:GRGAR_10001: wait  0 ms:GRGAR_40001: wait  0 ms00D6: if  10103:  actor $PLAYER_ACTOR stopped_near_point_in_car  1644.437 -1549.561 13.39254  radius  3.0 3.0 3.0  sphere 1 004D: jump_if_false ££GRGAR_40004: $car =  1 ;; integer values0050: gosub ££GRGAR_10:GRGAR_50001: wait  0 ms00D6: if  10103:  actor $PLAYER_ACTOR stopped_near_point_in_car  1641.027 -1549.343 13.28889  radius  3.0 3.0 3.0  sphere 1 004D: jump_if_false ££GRGAR_50004: $car =  2 ;; integer values0050: gosub ££GRGAR_10:GRGAR_60001: wait  0 ms00D6: if  10103:  actor $PLAYER_ACTOR stopped_near_point_in_car  1637.01 -1549.175 13.19196  radius  3.0 3.0 3.0  sphere 1 004D: jump_if_false ££GRGAR_60004: $car =  3 ;; integer values0050: gosub ££GRGAR_10:GRGAR_70001: wait  0 ms00D6: if  10103:  actor $PLAYER_ACTOR stopped_near_point_in_car  1633.034 -1549.552 13.33204  radius  3.0 3.0 3.0  sphere 1 004D: jump_if_false ££GRGAR_70004: $car =  4 ;; integer values0050: gosub ££GRGAR_10:GRGAR_90004: $car =  1 ;; integer values0002: jump ££GRGAR_12:GRGAR_100001: wait  0 ms0811: @0 = actor $PLAYER_ACTOR car0441: @1 = car @0 model0407: create_coordinate @2 @3 @4 from_car @0 offset 0.0 0.0 0.0 0174: @5 = car @0 z_angle03F3: get car @0 color @6 @70084: $MDGrgCarType($car,10i) = @1  ; Car type0084: $MDGrgCarX($car,10i) = @2  ; X0084: $MDGrgCarY($car,10i) = @3  ; Y0084: $MDGrgCarZ($car,10i) = @4  ; Z0084: $MDGrgCarZR($car,10i) = @5  ; ZROT0084: $MDGrgCarC1($car,10i) = @6  ; COL10084: $MDGrgCarC2($car,10i) = @7  ; COL20051: return:GRGAR_120001: wait  5000 ms0001: wait 0 ms00D6: if 00248:   model $MDGrgCarType($car,10i) available004D: jump_if_false ££GRGAR_120001: wait 250 ms00A5: $PlayerCar = create_car $MDGrgCarType($car,10i) at  $MDGrgCarX($car,10i) $MDGrgCarY($car,10i) $MDGrgCarZ($car,10i)0175: set_car $PlayerCar z_angle_to  $MDGrgCarZR($car,10i)0229: set_car $PlayerCar color_to  $MDGrgCarC1($car,10i)  $MDGrgCarC2($car,10i)0008: $car +=  1 ;; integer values00D6: if  00028:   $car >=  5 ;; integer values004D: jump_if_false ££GRGAR_12004E: end_thread

 

 

as far as i can tell arrays dont survive confused.gif

Share this post


Link to post
Share on other sites
Opius

It could because you're using integer arrays for floating-point numbers. Coordinates and rotations should be floats, everything else integers.

Share this post


Link to post
Share on other sites
ALEXE

 

Well Patrick did 40, so I don't think 2 will be a problem.

i didn't understand nothing from these 5 pages except that you were trying different codes and didn't come up with a mod

yet someone says patrick already did a 40 car garage for VC so I'm asking again:

 

can anyone mod a garage (preferably the 'Abandoned Air Strip' hangar cuz it has huge space)

to store about 20-30 cars in it, like Bruce Wayne has his grand collection biggrin.gif

please help me out without those script codes or whatever they are cuz they're jibberish... I was looking for a download or something...

considering all the mods (vehicles, buildings, new islands and even missions) that have been added to this game I think a extra-store capacity in a already done garage shouldn't take more than 2 days work from a good modder... or someone that understands those codes...

 

let me know what you have

Share this post


Link to post
Share on other sites
nubbel

Hell, I am half dead after all this coding now, but finally I have done a garage that saves 6 cars now! lol.gifxmas.gifcatspider.gif

 

First, I want to explain what the code does:

You can save 6 cars in front of the garage area at Mad Doggs Mansion.

The cars are saved to the savegame and are loaded again after you load the savegame.

 

If you try to save a 7. car, the first saved car gets deleted.

If you take out a car, the latest saved car will get moved to the array data of the car you took out. So it shifts the last car to the now "free" car slot in the array.

 

A big bug thats still in my code is, when you take out the last car that you saved, the game crashes.

Maybe also other variations of saving and taking out cars may crash due to bad code tounge.gif

 

I would really appreciate it, when some more advanced coder(s) could have a deeper look at the code to find the bug causing issues.

 

Thanks again to you for giving me the right impulses cookie.gif

 

 

 

DEFINE MEMORY 44357...004F: create_thread ££GRG_01004F: create_thread ££MadAcc_001...;---------------------------------------;- Press TAB to open Mad Doggs Mansion -;---------------------------------------:MadAcc_0010001: wait  250 ms00D6: if  000E1:   key_pressed  0  4004D: jump_if_false ££MadAcc_00107FB: set_interior 'MADDOGS' accessible  1 07FB: set_interior 'MDDOGS' accessible  1 004E: end_thread;---------------------------------------------------------------------------------------------------------:GRG_0103A4: name_thread 'GRG'0004: @0      = 0   ; declaration, later car handle0004: @3      = 0   ; Cars done0004: @4      = 0   ; just 0, needed as "0" var (array index)0004: @12     = 0.0 ; just 0.0, needed as "0.0" var (array index)0004: @14     = 7   ; always 7 (maybe deleted later)0004: $curr_i = 0   ; current index in loops0004: $tmp_i  = 0   ; another used index in loops:GRG_020001: wait  0 ms 00D6: if  00038:    @3 ==  0   004D: jump_if_false ££GRG_02;----------------------------------;In garage and wants to save a car?;----------------------------------:GRG_040001: wait  0 ms00D6: if  10103:   actor $PLAYER_ACTOR stopped_near_point_in_car   1248.62  -804.75  83.14 radius  10.0  10.0  10.0 sphere  0  00E1:   key_pressed  0  15 004D: jump_if_false ££GRG_04_20002: jump ££GRG_05;-----------------------------------------------      ;Player in garage, then go to car spawn routine?;-----------------------------------------------:GRG_04_20001: wait  0 ms00D6: if  100A4:    actor $PLAYER_ACTOR  0 ()in_cube     1237.611 -823.5489 82.135  1260.113 -799.1196 88.3125        $cars > 0; if any car exists/saved004D: jump_if_false ££GRG_020002: jump ££GRG_100;-------------;Store the car;-------------:GRG_050001: wait  0 ms0050: gosub ££GRG_SAVE0004: @3 = 1;-----------------;Player goes away?;-----------------:GRG_110002: jump ££GRG_115;---------- ;Spawn Cars;----------:GRG_1000001: wait  0 ms00D6: if  0        $cars > 0; if any car exists/saved004D: jump_if_false ££GRG_1150050: gosub ££GRG_SPAWN0004: @3 = 1;-------------------------;Player is still in garage;-------------------------:GRG_1150001: wait  0 ms00D6: if  000A4:   actor $PLAYER_ACTOR  0 ()in_cube     1237.611 -823.5489 82.135  1260.113 -799.1196 88.3125004D: jump_if_false ££GRG_135;Player wants to save a car0001: wait  0 ms00D6: if  10103:   actor $PLAYER_ACTOR stopped_near_point_in_car   1248.62  -804.75  83.14 radius  10.0  10.0  10.0 sphere  0  00E1:   key_pressed  0  15 004D: jump_if_false ££GRG_1150002: jump ££GRG_05;--------------------------------;Player is now outside the garage;--------------------------------;----------------------;Player took a car out? ;----------------------:GRG_1350001: wait  0 ms00D6: if  000DF:   actor $PLAYER_ACTOR driving004D: jump_if_false ££GRG_1400050: gosub ££GRG_TOOKOUT;----------;Clear area;----------:GRG_1400050: gosub ££GRG_CLEAR0395: clear_area  2 at  1248.62  -804.75  83.14  range  15.003BA: clear_cars_from_cube  1237.611 -823.5489 82.135  1260.113 -799.1196 88.3125:GRG_END0004: @3 = 00002: jump ££GRG_02;----------------------------------------------------------------------------:GRG_SAVE00D6: if  0     6 > $cars      ; <- we only allow 6 cars004D: jump_if_false ££GRG_SAVE_00020008: $cars += 1:GRG_SAVE_0002;-----------------------------------; TEST COUNTER0109: player $PLAYER_CHAR money += 1;----------------------------------- 0811: @0 = actor $PLAYER_ACTOR car0441: @5 = car @0 model0407: create_coordinate @6 @7 @8 from_car @0 offset 0.0 0.0 0.00174: @9 = car @0 z_angle03F3: get car @0 color @10 @1100D6: if  0        $cars > 1; if car 2 exists/saved004D: jump_if_false ££GRG_SAVE_03;------------------------------------------------------------------------------; Shift all cars in array (last car gets overwritten. 6 cars (0 to 5) storable);------------------------------------------------------------------------------0004: $curr_i = 6:GRG_LOOP_SHIFT0001: wait 50 ms00D6: if  0        $curr_i > 0 004D: jump_if_false ££GRG_SAVE_03       ;Shift cars in array000C: $curr_i -=  10004: $tmp_i   = $curr_i000C: $tmp_i  -= 10084: $GrgCarType($curr_i,10i) = $GrgCarType($tmp_i,10i)0085: $GrgCarX($curr_i,10f) = $GrgCarX($tmp_i,10f)0085: $GrgCarY($curr_i,10f) = $GrgCarY($tmp_i,10f)0085: $GrgCarZ($curr_i,10f) = $GrgCarZ($tmp_i,10f)0085: $GrgCarZangle($curr_i,10f) = $GrgCarZangle($tmp_i,10f)0084: $GrgCarCol1($curr_i,10i) = $GrgCarCol1($tmp_i,10i)0084: $GrgCarCol2($curr_i,10i) = $GrgCarCol2($tmp_i,10i)0084: $GrgCarExists($curr_i,10i) = @14; <- 70084: $GrgCarHandle($curr_i,10i) = $GrgCarHandle($tmp_i,10i)0002: jump ££GRG_LOOP_SHIFT;-----------------------; Save new car (index 0);-----------------------:GRG_SAVE_030001: wait 50 ms0004: $tmp_i = 00084: $GrgCarType($tmp_i,10i) = @50085: $GrgCarX($tmp_i,10f) = @60085: $GrgCarY($tmp_i,10f) = @70085: $GrgCarZ($tmp_i,10f) = @80085: $GrgCarZangle($tmp_i,10f) = @90084: $GrgCarCol1($tmp_i,10i) = @100084: $GrgCarCol2($tmp_i,10i) = @110084: $GrgCarExists($tmp_i,10i) = @14; <- 70084: $GrgCarHandle($tmp_i,10i) = @00051: return;----------------------------------------------------------------------------:GRG_SPAWN0004: $tmp_i  = 00004: $curr_i = $cars00D6: if  0       $cars > 0; if any car exists/saved004D: jump_if_false ££GRG_SPAWN_END00D6: if  0       $cars > 1; if more than 1 car is saved004D: jump_if_false ££GRG_105_2;----------------------------- ; Spawn cars with index 5 to 1;----------------------------- :GRG_LOOP_SPAWN0001: wait 50 ms00D6: if  0        $curr_i > 0 004D: jump_if_false ££GRG_105_2000C: $curr_i -= 10008: $tmp_i  += 1;----------------------------------------------; if car exists (compare cars count with index);----------------------------------------------00D6: if  0001C:    $cars > $tmp_i004D: jump_if_false ££GRG_105_20247: request_model $GrgCarType($curr_i,10i):GRG_1050001: wait 0 ms00D6: if 00248:    model $GrgCarType($curr_i,10i) available004D: jump_if_false ££GRG_10500A5: $GrgCarHandle($curr_i,10i) = create_car $GrgCarType($curr_i,10i) at $GrgCarX($curr_i,10i) $GrgCarY($curr_i,10i) $GrgCarZ($curr_i,10i)     0229: set_car $GrgCarHandle($curr_i,10i) color_to  $GrgCarCol1($curr_i,10i) $GrgCarCol2($curr_i,10i) 0175: set_car_z_angle $GrgCarHandle($curr_i,10i) $GrgCarZangle($curr_i,10i)0002: jump ££GRG_LOOP_SPAWN;-----------------------; Spawn car with index 0;-----------------------:GRG_105_20001: wait 50 ms0004: $tmp_i = 000D6: if 00248:    model $GrgCarType($tmp_i,10i) available004D: jump_if_false ££GRG_105_200A5: $GrgCarHandle($tmp_i,10i) = create_car $GrgCarType($tmp_i,10i) at $GrgCarX($tmp_i,10i) $GrgCarY($tmp_i,10i) $GrgCarZ($tmp_i,10i)     0229: set_car $GrgCarHandle($tmp_i,10i) color_to  $GrgCarCol1($tmp_i,10i) $GrgCarCol2($tmp_i,10i) 0175: set_car_z_angle $GrgCarHandle($tmp_i,10i) $GrgCarZangle($tmp_i,10i):GRG_SPAWN_END0051: return;----------------------------------------------------------------------------:GRG_CLEAR0004: $tmp_i  = 00004: $curr_i = $cars00D6: if  0       $cars > 0; if any car exists/saved004D: jump_if_false ££GRG_CLEAR_END00D6: if  0       $cars > 1; if more than 1 car is saved004D: jump_if_false ££GRG_106_2;----------------------------- ; Clear cars with index 5 to 1;----------------------------- :GRG_LOOP_CLEAR0001: wait 50 ms00D6: if  0        $curr_i > 0 004D: jump_if_false ££GRG_106_2000C: $curr_i -= 10008: $tmp_i  += 1;----------------------------------------------; if car exists (compare cars count with index);----------------------------------------------00D6: if  0001C:    $cars > $tmp_i004D: jump_if_false ££GRG_106_201C3: remove_references_to_car  $GrgCarHandle($curr_i,10i) ;; Like turning a car into any random car0002: jump ££GRG_LOOP_CLEAR;-----------------------; Clear car with index 0;-----------------------:GRG_106_20001: wait 50 ms0004: $tmp_i = 001C3: remove_references_to_car  $GrgCarHandle($tmp_i,10i):GRG_CLEAR_END0051: return;----------------------------------------------------------------------------  :GRG_TOOKOUT 0004: $tmp_i  = 00004: $curr_i = $cars0004: $last_i = $cars ; <- get index of last car000C: $last_i -= 1    ; <- get index of last car00D6: if  0       $cars > 0; if any car exists/saved004D: jump_if_false ££GRG_TOOKOUT_END00D6: if  0       $cars > 1; if more than 1 car is saved004D: jump_if_false ££GRG_107_2;----------------------------- ; Loop cars with index 5 to 1;----------------------------- :GRG_LOOP_TOOKOUT0001: wait 50 ms00D6: if  0        $curr_i > 0 004D: jump_if_false ££GRG_107_2000C: $curr_i -= 10008: $tmp_i  += 1;----------------------------------------------; if car exists (compare cars count with index);----------------------------------------------00D6: if  0001C:    $cars > $tmp_i004D: jump_if_false ££GRG_107_200D6: if  000DB:    actor $PLAYER_ACTOR in_car $GrgCarHandle($curr_i,10i)       ; <- player took this car out004D: jump_if_false ££GRG_LOOP_TOOKOUT;----------------;Shift and delete;----------------000C: $cars -= 1  ; <- cars = cars - 1;--------------------;If took out last car;--------------------00D6: if  00038:    $curr_i == $last_i004D: jump_if_false ££GRG_107_00010002: jump ££GRG_107_0002;------------------------------;Took out a car from the middle;------------------------------:GRG_107_00010084: $GrgCarType($curr_i,10i)   = $GrgCarType($last_i,10i)             ; last car gets shifted to taken car0085: $GrgCarX($curr_i,10f)      = $GrgCarX($last_i,10f)0085: $GrgCarY($curr_i,10f)      = $GrgCarY($last_i,10f)0085: $GrgCarZ($curr_i,10f)      = $GrgCarZ($last_i,10f)0085: $GrgCarZangle($curr_i,10f) = $GrgCarZangle($last_i,10f)0084: $GrgCarCol1($curr_i,10i)   = $GrgCarCol1($last_i,10i)0084: $GrgCarCol2($curr_i,10i)   = $GrgCarCol2($last_i,10i)0084: $GrgCarExists($curr_i,10i) = @14; <- 70084: $GrgCarHandle($curr_i,10i) = $GrgCarHandle($last_i,10i)           ; last car gets shifted to taken car:GRG_107_00020084: $GrgCarType($last_i,10i)   = @4   ; <- 00085: $GrgCarX($last_i,10f)      = @12  ; <- 0.00085: $GrgCarY($last_i,10f)      = @120085: $GrgCarZ($last_i,10f)      = @120085: $GrgCarZangle($last_i,10f) = @120084: $GrgCarCol1($last_i,10i)   = @40084: $GrgCarCol2($last_i,10i)   = @40084: $GrgCarExists($last_i,10i) = @14; <- 70084: $GrgCarHandle($last_i,10i) = @40002: jump ££GRG_TOOKOUT_END                     ; <- ??? NOT SURE IF NECCESARY:GRG_107_20001: wait 50 ms0004: $tmp_i = 000D6: if  000DB:    actor $PLAYER_ACTOR in_car $GrgCarHandle($tmp_i,10i)004D: jump_if_false ££GRG_TOOKOUT_END;-------------------------;- Delete car with index 0;-------------------------000C: $cars -= 1  ; <- cars = cars - 10084: $GrgCarType($tmp_i,10i)   = @4   ; <- 00085: $GrgCarX($tmp_i,10f)      = @12  ; <- 0.00085: $GrgCarY($tmp_i,10f)      = @120085: $GrgCarZ($tmp_i,10f)      = @120085: $GrgCarZangle($tmp_i,10f) = @120084: $GrgCarCol1($tmp_i,10i)   = @40084: $GrgCarCol2($tmp_i,10i)   = @40084: $GrgCarHandle($tmp_i,10i) = @4:GRG_TOOKOUT_END0051: return

 

 

Share this post


Link to post
Share on other sites
Y_Less

 

DEFINE MEMORY 44357...004F: create_thread ��GRG_01004F: create_thread ��MadAcc_001...;---------------------------------------;- Press TAB to open Mad Doggs Mansion -;---------------------------------------:MadAcc_0010001: wait  250 ms00D6: if  000E1:   key_pressed  0  4004D: jump_if_false ��MadAcc_00107FB: set_interior 'MADDOGS' accessible  1 07FB: set_interior 'MDDOGS' accessible  1 004E: end_thread;---------------------------------------------------------------------------------------------------------

 

 

What does that do? It will only ever run once, so what about after you die or the interior is dropped from memory, or you reload the game at a later date? I would also suggest using a smaller wait as you are looking for a keypress.

 

 

:GRG_0103A4: name_thread 'GRG'0004: @0      = 0; declaration, later car handle0004: @3      = 0; Cars done0004: @4      = 0; just 0, needed as "0" var (array index)0004: @12     = 0.0; just 0.0, needed as "0.0" var (array index)0004: @14     = 7; always 7 (maybe deleted later)0004: $curr_i = 0; current index in loops0004: $tmp_i  = 0; another used index in loops:GRG_020001: wait  0 ms 00D6: if  00038:    @3 ==  0   004D: jump_if_false ��GRG_02;----------------------------------;In garage and wants to save a car?;----------------------------------:GRG_040001: wait  0 ms00D6: if  10103:   actor $PLAYER_ACTOR stopped_near_point_in_car   1248.62  -804.75  83.14 radius  10.0  10.0  10.0 sphere  0  00E1:   key_pressed  0  15 004D: jump_if_false ��GRG_04_20002: jump ��GRG_05

 

 

You need a player definition check

 

 

;-----------------------------------------------      ;Player in garage, then go to car spawn routine?;-----------------------------------------------:GRG_04_20001: wait  0 ms00D6: if  100A4:    actor $PLAYER_ACTOR  0 ()in_cube     1237.611 -823.5489 82.135  1260.113 -799.1196 88.3125        $cars > 0; if any car exists/saved004D: jump_if_false ��GRG_020002: jump ��GRG_100;-------------;Store the car;-------------:GRG_050001: wait  0 ms0050: gosub ��GRG_SAVE0004: @3 = 1;-----------------;Player goes away?;-----------------:GRG_110002: jump ��GRG_115;---------- ;Spawn Cars;----------:GRG_1000001: wait  0 ms00D6: if  0        $cars > 0; if any car exists/saved004D: jump_if_false ��GRG_1150050: gosub ��GRG_SPAWN0004: @3 = 1

 

 

Why do you check this again? Cars existing is required to reach this point in the code, theres no point doing it again.

 

 

;-------------------------;Player is still in garage;-------------------------:GRG_1150001: wait  0 ms00D6: if  000A4:   actor $PLAYER_ACTOR  0 ()in_cube     1237.611 -823.5489 82.135  1260.113 -799.1196 88.3125004D: jump_if_false ��GRG_135;Player wants to save a car0001: wait  0 ms00D6: if  10103:   actor $PLAYER_ACTOR stopped_near_point_in_car   1248.62  -804.75  83.14 radius  10.0  10.0  10.0 sphere  0  00E1:   key_pressed  0  15 004D: jump_if_false ��GRG_1150002: jump ��GRG_05;--------------------------------;Player is now outside the garage;--------------------------------;----------------------;Player took a car out? ;----------------------:GRG_1350001: wait  0 ms00D6: if  000DF:   actor $PLAYER_ACTOR driving004D: jump_if_false ��GRG_1400050: gosub ��GRG_TOOKOUT;----------;Clear area;----------:GRG_1400050: gosub ��GRG_CLEAR0395: clear_area  2 at  1248.62  -804.75  83.14  range  15.003BA: clear_cars_from_cube  1237.611 -823.5489 82.135  1260.113 -799.1196 88.3125:GRG_END0004: @3 = 00002: jump ��GRG_02;----------------------------------------------------------------------------:GRG_SAVE00D6: if  0     6 > $cars   ; <- we only allow 6 cars004D: jump_if_false ��GRG_SAVE_00020008: $cars += 1:GRG_SAVE_0002;-----------------------------------; TEST COUNTER0109: player $PLAYER_CHAR money += 1;----------------------------------- 0811: @0 = actor $PLAYER_ACTOR car0441: @5 = car @0 model0407: create_coordinate @6 @7 @8 from_car @0 offset 0.0 0.0 0.00174: @9 = car @0 z_angle03F3: get car @0 color @10 @1100D6: if  0        $cars > 1; if car 2 exists/saved004D: jump_if_false ��GRG_SAVE_03;------------------------------------------------------------------------------; Shift all cars in array (last car gets overwritten. 6 cars (0 to 5) storable);------------------------------------------------------------------------------0004: $curr_i = 6:GRG_LOOP_SHIFT0001: wait 50 ms00D6: if  0        $curr_i > 0 004D: jump_if_false ��GRG_SAVE_03       ;Shift cars in array000C: $curr_i -=  10004: $tmp_i   = $curr_i000C: $tmp_i  -= 10084: $GrgCarType($curr_i,10i) = $GrgCarType($tmp_i,10i)0085: $GrgCarX($curr_i,10f) = $GrgCarX($tmp_i,10f)0085: $GrgCarY($curr_i,10f) = $GrgCarY($tmp_i,10f)0085: $GrgCarZ($curr_i,10f) = $GrgCarZ($tmp_i,10f)0085: $GrgCarZangle($curr_i,10f) = $GrgCarZangle($tmp_i,10f)0084: $GrgCarCol1($curr_i,10i) = $GrgCarCol1($tmp_i,10i)0084: $GrgCarCol2($curr_i,10i) = $GrgCarCol2($tmp_i,10i)0084: $GrgCarExists($curr_i,10i) = @14; <- 70084: $GrgCarHandle($curr_i,10i) = $GrgCarHandle($tmp_i,10i)0002: jump ��GRG_LOOP_SHIFT;-----------------------; Save new car (index 0);-----------------------:GRG_SAVE_030001: wait 50 ms0004: $tmp_i = 00084: $GrgCarType($tmp_i,10i) = @50085: $GrgCarX($tmp_i,10f) = @60085: $GrgCarY($tmp_i,10f) = @70085: $GrgCarZ($tmp_i,10f) = @80085: $GrgCarZangle($tmp_i,10f) = @90084: $GrgCarCol1($tmp_i,10i) = @100084: $GrgCarCol2($tmp_i,10i) = @110084: $GrgCarExists($tmp_i,10i) = @14; <- 70084: $GrgCarHandle($tmp_i,10i) = @00051: return;----------------------------------------------------------------------------:GRG_SPAWN0004: $tmp_i  = 00004: $curr_i = $cars

 

 

You can't use 0004 to define a variable as another variable, its:

0084: $curr_i = $cars

 

After this you're getting into arrays and I've not yet had a chance to study these, so I can't comment.

 

 

00D6: if  0       $cars > 0; if any car exists/saved004D: jump_if_false ��GRG_SPAWN_END00D6: if  0       $cars > 1; if more than 1 car is saved004D: jump_if_false ��GRG_105_2;----------------------------- ; Spawn cars with index 5 to 1;----------------------------- :GRG_LOOP_SPAWN0001: wait 50 ms00D6: if  0        $curr_i > 0 004D: jump_if_false ��GRG_105_2000C: $curr_i -= 10008: $tmp_i  += 1;----------------------------------------------; if car exists (compare cars count with index);----------------------------------------------00D6: if  0001C:    $cars > $tmp_i004D: jump_if_false ��GRG_105_20247: request_model $GrgCarType($curr_i,10i):GRG_1050001: wait 0 ms00D6: if 00248:    model $GrgCarType($curr_i,10i) available004D: jump_if_false ��GRG_10500A5: $GrgCarHandle($curr_i,10i) = create_car $GrgCarType($curr_i,10i) at $GrgCarX($curr_i,10i) $GrgCarY($curr_i,10i) $GrgCarZ($curr_i,10i)     0229: set_car $GrgCarHandle($curr_i,10i) color_to  $GrgCarCol1($curr_i,10i) $GrgCarCol2($curr_i,10i) 0175: set_car_z_angle $GrgCarHandle($curr_i,10i) $GrgCarZangle($curr_i,10i)0002: jump ��GRG_LOOP_SPAWN;-----------------------; Spawn car with index 0;-----------------------:GRG_105_20001: wait 50 ms0004: $tmp_i = 000D6: if 00248:    model $GrgCarType($tmp_i,10i) available004D: jump_if_false ��GRG_105_200A5: $GrgCarHandle($tmp_i,10i) = create_car $GrgCarType($tmp_i,10i) at $GrgCarX($tmp_i,10i) $GrgCarY($tmp_i,10i) $GrgCarZ($tmp_i,10i)     0229: set_car $GrgCarHandle($tmp_i,10i) color_to  $GrgCarCol1($tmp_i,10i) $GrgCarCol2($tmp_i,10i) 0175: set_car_z_angle $GrgCarHandle($tmp_i,10i) $GrgCarZangle($tmp_i,10i):GRG_SPAWN_END0051: return;----------------------------------------------------------------------------:GRG_CLEAR0004: $tmp_i  = 00004: $curr_i = $cars00D6: if  0       $cars > 0; if any car exists/saved004D: jump_if_false ��GRG_CLEAR_END00D6: if  0       $cars > 1; if more than 1 car is saved004D: jump_if_false ��GRG_106_2;----------------------------- ; Clear cars with index 5 to 1;----------------------------- :GRG_LOOP_CLEAR0001: wait 50 ms00D6: if  0        $curr_i > 0 004D: jump_if_false ��GRG_106_2000C: $curr_i -= 10008: $tmp_i  += 1;----------------------------------------------; if car exists (compare cars count with index);----------------------------------------------00D6: if  0001C:    $cars > $tmp_i004D: jump_if_false ��GRG_106_201C3: remove_references_to_car  $GrgCarHandle($curr_i,10i);; Like turning a car into any random car0002: jump ��GRG_LOOP_CLEAR;-----------------------; Clear car with index 0;-----------------------:GRG_106_20001: wait 50 ms0004: $tmp_i = 001C3: remove_references_to_car  $GrgCarHandle($tmp_i,10i):GRG_CLEAR_END0051: return;----------------------------------------------------------------------------  :GRG_TOOKOUT 0004: $tmp_i  = 00004: $curr_i = $cars0004: $last_i = $cars; <- get index of last car000C: $last_i -= 1 ; <- get index of last car

 

 

This could well be the source of your crashing when taking out the last car problem, you have again tried to use 0004 to define a variable as another variable.

 

More arrays, can't comment.

 

 

00D6: if  0       $cars > 0; if any car exists/saved004D: jump_if_false ��GRG_TOOKOUT_END00D6: if  0       $cars > 1; if more than 1 car is saved004D: jump_if_false ��GRG_107_2;----------------------------- ; Loop cars with index 5 to 1;----------------------------- :GRG_LOOP_TOOKOUT0001: wait 50 ms00D6: if  0        $curr_i > 0 004D: jump_if_false ��GRG_107_2000C: $curr_i -= 10008: $tmp_i  += 1;----------------------------------------------; if car exists (compare cars count with index);----------------------------------------------00D6: if  0001C:    $cars > $tmp_i004D: jump_if_false ��GRG_107_200D6: if  000DB:    actor $PLAYER_ACTOR in_car $GrgCarHandle($curr_i,10i)    ; <- player took this car out004D: jump_if_false ��GRG_LOOP_TOOKOUT;----------------;Shift and delete;----------------000C: $cars -= 1; <- cars = cars - 1;--------------------;If took out last car;--------------------00D6: if  00038:    $curr_i == $last_i004D: jump_if_false ��GRG_107_00010002: jump ��GRG_107_0002;------------------------------;Took out a car from the middle;------------------------------:GRG_107_00010084: $GrgCarType($curr_i,10i)   = $GrgCarType($last_i,10i)          ; last car gets shifted to taken car0085: $GrgCarX($curr_i,10f)      = $GrgCarX($last_i,10f)0085: $GrgCarY($curr_i,10f)      = $GrgCarY($last_i,10f)0085: $GrgCarZ($curr_i,10f)      = $GrgCarZ($last_i,10f)0085: $GrgCarZangle($curr_i,10f) = $GrgCarZangle($last_i,10f)0084: $GrgCarCol1($curr_i,10i)   = $GrgCarCol1($last_i,10i)0084: $GrgCarCol2($curr_i,10i)   = $GrgCarCol2($last_i,10i)0084: $GrgCarExists($curr_i,10i) = @14; <- 70084: $GrgCarHandle($curr_i,10i) = $GrgCarHandle($last_i,10i)        ; last car gets shifted to taken car:GRG_107_00020084: $GrgCarType($last_i,10i)   = @4; <- 00085: $GrgCarX($last_i,10f)      = @12; <- 0.00085: $GrgCarY($last_i,10f)      = @120085: $GrgCarZ($last_i,10f)      = @120085: $GrgCarZangle($last_i,10f) = @120084: $GrgCarCol1($last_i,10i)   = @40084: $GrgCarCol2($last_i,10i)   = @40084: $GrgCarExists($last_i,10i) = @14; <- 70084: $GrgCarHandle($last_i,10i) = @40002: jump ��GRG_TOOKOUT_END                  ; <- ??? NOT SURE IF NECCESARY:GRG_107_20001: wait 50 ms0004: $tmp_i = 000D6: if  000DB:    actor $PLAYER_ACTOR in_car $GrgCarHandle($tmp_i,10i)004D: jump_if_false ��GRG_TOOKOUT_END;-------------------------;- Delete car with index 0;-------------------------000C: $cars -= 1; <- cars = cars - 10084: $GrgCarType($tmp_i,10i)   = @4; <- 00085: $GrgCarX($tmp_i,10f)      = @12; <- 0.00085: $GrgCarY($tmp_i,10f)      = @120085: $GrgCarZ($tmp_i,10f)      = @120085: $GrgCarZangle($tmp_i,10f) = @120084: $GrgCarCol1($tmp_i,10i)   = @40084: $GrgCarCol2($tmp_i,10i)   = @40084: $GrgCarHandle($tmp_i,10i) = @4:GRG_TOOKOUT_END0051: return

 

Sorry, I got bored after a short while so my comments only go a little way.

 

Also, you don't need all those wait 0's unless its in a loop, and every time you have a wait, you need to check for player definition before continuing.

 

Edit: I got bored again, so did some more, I've just about commented on as much code as I can, though I've only commented on a per-line basis, not on the code as a whole as I can't due to lack of array knowledge.

Edited by Y_Less

Share this post


Link to post
Share on other sites
Demarest
please help me out without those script codes or whatever they are cuz they're jibberish... I was looking for a download or something...

If you've read this thread, then you are aware that there are several people working on it for their own benefit. Why would they magically have it done for somebody else? Also, why would you want to use an existing garage? If I was to choose the airfield (in the middle of the desert, that's just not smart), I'd have them line the runway, not occupy an area that will already save 4 monster vehicles.

 

@nubbel: I didn't bother checking your code. I trust Y_Less covered it.

Share this post


Link to post
Share on other sites
Y_Less

I only covered a bit of it as there was alot and I got bored, you're welcome to pick up where I left off (I also stopped as I've never used SA arrays so don't know how to use them yet so couldn't help you).

 

Im also going on holiday tomorrow for 2 weeks, so I hope you get this sorted (thats also a general announcement to anyone who cares).

Share this post


Link to post
Share on other sites
ALEXE

 

please help me out without those script codes or whatever they are cuz they're jibberish... I was looking for a download or something...

If you've read this thread, then you are aware that there are several people working on it for their own benefit. Why would they magically have it done for somebody else? Also, why would you want to use an existing garage? If I was to choose the airfield (in the middle of the desert, that's just not smart), I'd have them line the runway, not occupy an area that will already save 4 monster vehicles.

I thought of the airfield hangar of several reasons:

1. Is secluded out there in the desert, sorta like my secret Batmanish Billionaire collection I pictured in mind (of course, it wouldn't match to an actual Bat Cave and Wayne Mansion up on a hill somewhere like the 'GTA: Gotham City' dudes work on - if they're still alive, that is)

 

2. Has the airstrip runway to test drive any of the inside vehicles (if i feel the need for speed... traffic kinda turns me off)

 

3. It already has structure & gates that actually close and open so it doesn't need that mid air spawn/memory/loop problems you're trying to pass by

 

4. thought it would be easier to do since it has enough place to store, just that silly limit of 4 vehicles to... sorta change... or something

 

those 4 monster vehicles you (or any SA player might wanna choose to store there) could still be stored in the hangar... and you could add several other small vehicles too (like a Faggio next to a quarry Dumper lol.gif that would look dope wink.gif )

 

anyway, I don't wanna freepost or anything and I see you're doing your jobs and all... but how can it be that hard? ppl built a whole mountain town and added it to Vice City... this is just a garage... or extra spaces to one...

 

sorry, I might sound like a noob and I might insult your hard work (which would be a misunderstanding for I'd never do that) but it just looks strange...

I hold much respect and mean no inconvieniance

Peace

Edited by ALEXE

Share this post


Link to post
Share on other sites
random_download

The limit of 4 vehicles is hardcoded. Changing it is very hard indeed. Instead, the orginal garage is deleted and a whole new one created through scm script. So it is not so much changing the number that can be stored as creating a garage from scratch.

Share this post


Link to post
Share on other sites
ALEXE
The limit of 4 vehicles is hardcoded. Changing it is very hard indeed. Instead, the orginal garage is deleted and a whole new one created through scm script. So it is not so much changing the number that can be stored as creating a garage from scratch.

oh, ok, that's good to know

it's weird and all that but now that I know this I won't be bugging the hell outta you anymore (I think)

sooo... do your thing... bye

Share this post


Link to post
Share on other sites
Digital Animal

All I can really say is what your doing looks great but I notice that you are struggling with a few problems and this might provide a feasible get around to give that big garage feeling:

 

Why not try making a garage that consists of an underground area. The basic behavior of the area could then act as if this each floor of the structure was a single garage. When you pull up to the entrance of the underground parking area, it checks a list of garages for open spaces and finds a garage with an open space. The car is then lowered into the underground structure with you in it as a cut scene. After the cut scene, you are left on the floor with a space for you to park in. You could then drive out with a different car from that floor or use an elevator to go between the other floors or exit the structure.

 

You probably can spot some of the things this gets around but if you can here is some of them:

This would make it so you would only need to spawn the cars on a single floor at a time.

You would have to deal with traffic spawning stopping because there would not be any in the area.

You minimize the surface space needed to provide the area to house the cars. So if you want to put it under an existing building you could.

You would not have to recode the code to get around the max 4 vehicles limit.

 

It might not be as simple as I think it is but I’m guessing if you can check the garages for the you can’t park anymore cars here response then you should be able to have it jump to the next garage on that response. Is there any chance of something like this working or being currently possible? I thought I saw someone saying they got a simple garage working but that could have been anywhere in the last 6 pages :)

 

Any comments are welcome.

 

Digital Animal

 

Share this post


Link to post
Share on other sites
Vonsid

Hello biggrin.gif , you can post the code complete, please tounge.gif!

 

sorry, i talk spanish:

Share this post


Link to post
Share on other sites
nubbel

Thanks so far for checking my code.

What does such a "player definition check" in fact do and when is it really needed?

 

I guess you mean this:

 

:label0001: wait  0 ms00D6: if  00256:   player $PLAYER_CHAR defined004D: jump_if_false ££label

 

 

right?

 

The part "Press TAB to open Mad Doggs Mansion" has nothing to do with the garage. It only opens Mad Doggs house so that I can faster save and load the game for testing if the cars got saved.

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

 

@Vonsid: Sorry, there is no "complete code". We are still testing.

 

@ALEXE: I agree with Demarest.

Edited by nubbel

Share this post


Link to post
Share on other sites
ALEXE
@ALEXE: I agree with Demarest.

on which part?

the part that you only develop this for yourself and you won't share it with the little people? or the part where it seems ridiculous to mod an already existing garage... in the middle of the desert...

 

anyway, good job till now, I guess... keep up the good work colgate.gif

 

 

 

 

 

@ Demarest: see monocle.gif ? I'm encouraging you biggrin.gif

Share this post


Link to post
Share on other sites
nubbel

I agree with the desert part.

 

I always post codes if I have something that works. I defenetly want to share my codes with others, that is the main idea behind gtaforums in my opinion.

 

I'm not sure if I ever will post codes in the mod showroom though.

Share this post


Link to post
Share on other sites
Demarest
I'm not sure if I ever will post codes in the mod showroom though.

Good. That place is already overrun with snippets I wouldn't call mods. But if you do kick something out, don't hesitate to do so smile.gif

 

TECHNICALLY player defined checks are never required. But we never say that because it's best to encourage good programming. Good programming would dictate you use a player defined check before any command block that makes references to $PLAYER_CHAR. That way if he's not defined, you don't risk crashing the game by telling it to manipulate something that doesn't exist. Same thing with using is car wrecked checks before addressing them, is actor dead before addressing them, etc.

Share this post


Link to post
Share on other sites
nubbel

Thanks Demarest.

But as far as I can say, I only have $PLAYER_ACTOR in my codes, not $PLAYER_CHAR. Do i also have to do this check before accessing $PLAYER_ACTOR?

 

 

I have made screenshots of 7 big parking lots i found so far. Sadly they are all in Las Venturas.

There is one ore 2 in San Fierro, but I dont like them so much.

 

Here are my screenshots: PARKLOTS Las Venturas

 

Any ideas of parklots in other cities, guys?!? xmas.gif

Share this post


Link to post
Share on other sites
Demarest
I think actors are even more important to check for than players.

Share this post


Link to post
Share on other sites
badGoo

hi! im new to modding GTA SA and i was wondering if you could help me out a bit. i dont mean to interrupt you on your work..

 

i read all the posts in this topic and from there i learned now how to create the cuboid for the parking garage. i also know that the cars vanish from sight when you are far from the area. i also found out that you guys have found a way to display the car from a further distance, but since i dont know scm coding i dont understand what to do next...

 

basically, i created a "garage" (cuboid) in front of the beachhouse (located at LaW2.IPL). There's a parking lot there and i placed my garage zone there. now i can store cars no problem (up to 4), but when i drive in my third car, the cars parked doesnt show up until i exit the vehicle im driving/trying to park. when i drive the second car, the first car shows up, but on the third and fourth, it doesnt. my first question: how can i make the previous car show up? (its an open parking zone, no gates).

 

my second question is, do you know how i can show those cars from a certain distance away? (with minimal coding, i hope, cause i dont know anything about scm coding. i only know how to spawn objects...)

 

thanks...

 

OFFTOPIC: could anyone point me to a thread on how to make savepoints? thanks! biggrin.gif

EDIT: no matter, i found it (save point)...

Edited by badGoo

Share this post


Link to post
Share on other sites
Demarest

my first question: how can i make the previous car show up? (its an open parking zone, no gates).
They "show up" when the garage opens. Your garage isn't opening is why you can't see them. Use opcode 057A to set your max cars for that garage to 4. If you go higher, it MIGHT still make the door open for car 5. Just know that it won't actually save beyond the last 4 deposited.

 

 

my second question is, do you know how i can show those cars from a certain distance away?
Sniff to see if player is X units away (3d) and if so, open garage. The larger the X, the further you'll see them from. Standard spawn radius for parked cars from what I've seen is 100. If you wanted to get fancy, you could also check for leaving whatever radius you specify and force close the garage.

Share this post


Link to post
Share on other sites
badGoo

ok thanks... i know what to do now, but i dont know where to do it... i assume main.scm? i could be wrong...

 

do you know the part of the code that does this? for example, the garage at Doherty, it opens for four so i assume i could imitate that code? could u point me to it? or is it totally different? i dont know much about coding yet...

Share this post


Link to post
Share on other sites
Demarest
i assume main.scm?

You assume correctly. You are also correct to want to immitate existing examples in game. I myself do not have SA, so my help will be limited. I do know that in SA, some garages are defined outside the SCM. I don't know if they have flags indicating such things or not.

Share this post


Link to post
Share on other sites
badGoo

ok thanks. ill be searching the scm for now, and reading the coding tutorials biggrin.gif.

 

EDIT: well, if anyone wants to know, i found out something. you guys may already know this, but you didnt post it so...

 

 

1  2  3   4  5   6  7  8   9   10   11------------------------------------------X, Y, Z,  X, Y,  X, Y, Z,  5,  31,  NAME1-3: The x, y and z coordinate lower left front4-5: The x, y coordinate lower right front6-8: The x, y, z coordinate top left back9: Garage type anyhow (most times 1)10: Unknown (may interact with parameter 9 ?!?)11: Identifier / Name

 

 

Based on this format (posted earlier), the 9th parameter was said to be the garage type.

 

now im not saying thats wrong but i think paramaters 9 & 10 are BOTH garage types. after playing around a bit, i think 9 is the camera position and 10 is how many cars it will open up to. if you use 5, 16 (for 9 and 10 respectively), it opens up for 2 cars, and when you drive in the third car, your stored cars dont show (it doesnt open up to it) until you exit the car ur driving. when you use 5, 31 the garage opens up to the 4th car (it doesnt open on the fifth). NOTE: when i say open up, nothing actually opens as i have no door in my custom garage (it is the parking lot in front of the beach house safehouse). what i mean is it spawns the stored cars.

 

9th param:

1,2,3 = garage cam

4,5 = normal cam (no camera view change)

 

10th param:

16, will spawn stored cars until 2nd car only

17 (or any higher i guess up to 41), will spawn stored cars until 4th car.

 

i didnt find any number that can spawn until the 5th car...

Edited by badGoo

Share this post


Link to post
Share on other sites
nubbel

Well,

 

I guess it should be:

 

 

1  2  3   4  5   6  7  8   9   10   11------------------------------------------X, Y, Z,  X, Y,  X, Y, Z,  5,  31,  NAME1-3: The x, y and z coordinate lower left front4-5: The x, y coordinate lower right front6-8: The x, y, z coordinate top left back9: Camera mode 1,3,4,5,7 (5 = normal view, 1 = garage view)10: Garage Type (1=Default GRG, 2=Bombshop, 5=Pay 'n' Spray, 16-45 different GRG)11: Identifier / Name (used in SCM)

 

 

I'm not yet sure about garage types 1 and 16 to 45. Maybe garages type 1 normally opens when you purchase the house belonging to the garage.

And garages type 16 to 45 also need to be unlocked in a special way, like mission passing, etc.

 

 

Important:

My garage code is now working with 40 cars!

No bugs found yet. I will try to figure out the limit later. Could you please help to find some nice spots to park cars at?

 

My founds (11 carparks): Carparks

 

Some carparks have random generated cars in it, so they would have to be deleted from SCM.

Others are special police carparks where you get wanted stars when you enter it, maybe these also can be changed.

Edited by nubbel

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

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