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. Gameplay
      2. Missions
      3. Help & Support
    2. Red Dead Online

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

      1. Recruitment
    2. Events

    1. GTA Online

      1. Arena War
      2. After Hours
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA Next

    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 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 Mods
    10. GTA Vice City

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

      1. Guides & Strategies
      2. Help & Support
      3. GTA 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

stitchman

spawning car with nitro

Recommended Posts

Opius
80EC:   NOT   actor $PLAYER_ACTOR  0 ()near_point  1812.369 -1929.922 radius  500.0  500.0

 

Both of those will work fine. Your choice as to which one. Just remember the bottom one only check XY, so if the car will be created even if you're 1000 meters above the ground.

 

Just remember, with nearly all conditional opcodes, you can add/remove 8 to the first digit of the opcode to make it inverted. So both of these will work.

 

 

00EC:  actor $PLAYER_ACTOR  0 ()near_point  1812.369 -1929.922 radius  500.0  500.080EC:   NOT   actor $PLAYER_ACTOR  0 ()near_point  1812.369 -1929.922 radius  500.0  500.0

 

Share this post


Link to post
Share on other sites
ReeferSmoke

I tried this:

:RequestCars0001: wait  0 ms00EC:   actor $PLAYER_ACTOR  0 ()near_point  2487.35 -1655.12 radius  150.0  150.00247: request model #SENTINEL06E9: request_car_component #NTO_B_S 038B: load_requested_models:WaitCars00D6: if  00248:   model #SENTINEL available0248:   model #NTO_B_S available004D: jump_if_false ££WaitCars :GetCars0001: wait  0 ms 00A5: $mycar = create_car  #SENTINEL at  2487.35 -1655.12  13.3  0175: set_car $mycar z_angle_to  90.0        0229: set_car $mycar color_to  19  0 02AC: set_car $mycar immunities  1  1  1  1  1;0224: set_car $mycar health_to  5000;0423: car $mycar improve_handling  2.006E7: $mynos = add_car_component #NTO_B_S to_car $mycar :ReleaseCars00D6: if  080EC:   NOT   actor $PLAYER_ACTOR  0 ()near_point  2487.35 -1655.12 radius  150.0  150.00001: wait  10 ms01C3: remove_references_to_car $mycar 0249: release_model #SENTINEL06EB: release_car_component #NTO_B_S 004D: jump_if_false ££RequestCars

 

the car appears, but it just bounces non stop and cant be entered. I leave and come back and it's gone.

Share this post


Link to post
Share on other sites
Opius

That's because youre missing the jump_if_false off the last if statement.

 

And you still haven't added the wait to the WaitCars label. confused.gif

Share this post


Link to post
Share on other sites
ReeferSmoke

With this, the car spawns over and over. I can't seem to make it spawn once when I get close then dissapear when I leave.

 

:RequestCars00D6: if  000EC:   actor $PLAYER_ACTOR  0 ()near_point  2487.35 -1655.12 radius  150.0  150.00001: wait  0 ms0247: request model #SULTAN06E9: request_car_component #NTO_B_TW 038B: load_requested_models:WaitCars0001: wait  0 ms 00D6: if  20248:   model #SULTAN available0248:   model #NTO_B_TW available004D: jump_if_false ££WaitCars :GetCars0001: wait  0 ms 00A5: $mycar2 = create_car  #SULTAN at  2487.35 -1655.12  13.3 06E7: $mynos = add_car_component #NTO_B_TW to_car $mycar2 0175: set_car $mycar2 z_angle_to  90.0        0229: set_car $mycar2 color_to  19  0 02AC: set_car $mycar2 immunities  1  1  1  1  1;0224: set_car $mycar2 health_to  5000;0423: car $mycar2 improve_handling  2.0:ReleaseCars00D6: if  080EC:   NOT   actor $PLAYER_ACTOR  0 ()near_point  2487.35 -1655.12 radius  150.0  150.0004D: jump_if_false ££RequestCars0001: wait  10 ms01C3: remove_references_to_car $mycar2 0249: release_model #SULTAN06EB: release_car_component #NTO_B_TW

 

Share this post


Link to post
Share on other sites
Opius

That's because you're not jumping back to the first label LIKE I SAID IN MY SECOND POST.

 

Out of interest, are you actually able to read the code and follow where it goes? Did you expect it to magically restart without any intervention from yourself?

Share this post


Link to post
Share on other sites
ReeferSmoke

To answer your question. I am learnig this stuff as I go. I try to read existing code and pull out what I can. I thought this was jumping back to the first label:

:ReleaseCars00D6: if  080EC:   NOT   actor $PLAYER_ACTOR  0 ()near_point  2487.35 -1655.12 radius  150.0  150.0004D: jump_if_false ££RequestCars0001: wait  10 ms01C3: remove_references_to_car $mycar2 0249: release_model #SULTAN06EB: release_car_component #NTO_B_TW

 

I guess not. Anyway, thanks for your help Opius. Maybe I can figure this out.

Share this post


Link to post
Share on other sites
Demarest

In your first section, you want the wait first since it's supposed to be a loop. Also, you're missing the jf (jump_if_false) line for it.

 

In your second section, you use if 2. That's incorrected. You want if 1. If operands are covered throughout the forum as well as in the Builder's readme. If you haven't read that, you're not going learn very easily. If you have, rereading it from time to time can be useful if not educational.

 

Your third section doesn't need to be a section at all. Get rid of the label (since nothing points to it) and lump those lines into the bottom of the section above it. Also, no wait is needed there since it just waited during the loop.

 

In your final section, you need a wait up front since this is supposed to be a loop. You want your jf target to be this same section to complete the loop. The jump back to the beginning should go AFTER you clear memory from the entire process. A standalone jump will be needed.

 

 

General tips: As Opius pointed out, you're using 2D location conditionals. If you were to fly over this area, you would waste system resources to create a car you couldn't possibly interact with. Using 00FE would accomplish the same thing, but in 3D. Also, there's no reason to not release the models as soon as you're done with them. Next, you should be using if player defined checks before using a command that addresses the player. For this reason, your memory clearing commands should go in its own section so that the if player defined check in the final loop can jf to it. The wait times for the player location sniffing can and should be a LOT more lax. Once you get used to coding, you should try using local variables instead of globals. Also, once the car is created, you should probably throw in an if car not wrecked check. It too would have a jf to the memory clearing commands. Of course doing that would mean you should either lower the radius of this entire process OR after clearing the memory, trap the code into another not in area check that once satisfied, would jump back to the beginning without clearing memory again. If you lowered the radius (the easier way), you'd have this (note: 00EC is still being used because I don't know the Z value you're looking to use in 00FE):

:RequestCars0001: wait  250 ms00D6: if  00256:   player $PLAYER_CHAR defined004D: jump_if_false ££RequestCars00D6: if  000EC:   actor $PLAYER_ACTOR  0 ()near_point  2487.35 -1655.12 radius  100.0  100.0004D: jump_if_false ££RequestCars0247: request model #SULTAN06E9: request_car_component #NTO_B_TW038B: load_requested_models:WaitCars0001: wait  0 ms00D6: if  10248:   model #SULTAN available0248:   model #NTO_B_TW available004D: jump_if_false ££WaitCars00A5: @0 = create_car  #SULTAN at  2487.35 -1655.12  13.306E7: @1 = add_car_component #NTO_B_TW to_car @00175: set_car @0 z_angle_to  90.0        0229: set_car @0 color_to  19  002AC: set_car @0 immunities  1  1  1  1  10249: release_model #SULTAN06EB: release_car_component #NTO_B_TW:ReleaseCars0001: wait  250 ms00D6: if  00256:   player $PLAYER_CHAR defined004D: jump_if_false ££MyCleanup00D6: if  080EC:   NOT   actor $PLAYER_ACTOR  0 ()near_point  2487.35 -1655.12 radius  100.0  100.0004D: jump_if_false ££ReleaseCars:MyCleanup01C3: remove_references_to_car @00002: jump ££RequestCars

 

If you do not understand why any aspect of the code I've posted is just so, then by all means ask. Oh, and when posting code (especially when posting it multiple times), don't bother including commented out lines unless your question is about those lines specifically.

Share this post


Link to post
Share on other sites
ReeferSmoke

Thanks for the reply Demerest. I see your points in your code. I'll keep studying it though in reference to other code. I really want to get a grasp on this. I tried this code and the car spawns, but it spawns 2 cars not jut one. Both are enterable. When I leave and come back. It will once again spawn 2 cars. Would this be an issue in the RequestCars label? I also changed

00EC:   actor $PLAYER_ACTOR  0 ()near_point  2487.35 -1655.12 radius  100.0  100.0

to

00FE:   actor $PLAYER_ACTOR  0 ()near_point  2487.35 -1655.12  13.3 radius  50.0  50.0  50.0

I also lowered the radius.

Edited by ReeferSmoke

Share this post


Link to post
Share on other sites
dertyjerzian

I have managed to use the examples and advise here to add nos to my pink bullet, but when I pause>new game, it crashes. I didn't use nearly as much code as is shown above... I defined the two objects, and added the code to where I... blah.

 

Why would it load perfectly fine, play, reload and then crash?

 

 

DEFINE VERSION SA 0.330002: jump ££Second_SegmentDEFINE MEMORY  64 ; Equals Mission Builder type global variable range $2 to $7:Second_Segment0002: jump ££Third_SegmentDEFINE OBJECTS  3DEFINE OBJECT STEVE-M.COM               ; This is an unused object. You can put anything here.DEFINE OBJECT NTO_B_S                   ; Object number -1DEFINE OBJECT NTO_B_TW                  ; Object number -2:Third_Segment0002: jump ££Fourth_SegmentDEFINE MISSIONS  0:Fourth_Segment0002: jump ££Fifth_SegmentDEFINE EXTERNAL_SCRIPTS  0:Fifth_Segment0002: jump ££Sixth_SegmentDEFINE UNKNOWN_FIFTH_SEGMENTDEFINE UNKNOWN1  0:Sixth_Segment0002: jump ££MAIN_1DEFINE UNKNOWN_SIXTH_SEGMENTDEFINE UNKNOWN3  0;-------------MAIN---------------:MAIN_103A4: name_thread 'MAIN'016A: fade  0 ()  0 ms042C: set_total_missions_to  0030D: set_total_mission_points_to  001F0: set_max_wanted_level_to  60111: set_wasted_busted_check_to  0 (disabled)00C0: set_current_time  10  00005: $7 =  0.0;; floating-point values0005: $6 =  0.0;; floating-point values0005: $5 =  15.0;; floating-point values04E4: unknown_refresh_game_renderer_at $7 $603CB: set_camera $7 $6 $5062A: change_stat  165 (energy) to  999.0; float062A: change_stat  23 (muscle) to  999.0; float062A: change_stat  21 (fat) to  0.0; float062A: change_stat  163 (health upgrade) to  999.0; float062A: change_stat  160 (driving skill) to  999.0; float062A: change_stat  229 (bike skill) to  999.0; float062A: change_stat  223 (pilot skill) to  999.0; float062A: change_stat  230 (cycling skill) to  999.0; float0629: change_stat  181 (islands unlocked) to  4; integer see statdisp.dat0629: change_stat  68 () to  0; integer see statdisp.dat0053: $PLAYER_CHAR = create_player #NULL at $7 $6 $507AF: $PLAYER_GROUP = player $PLAYER_CHAR group01F5: $PLAYER_ACTOR = create_emulated_actor_from_player $PLAYER_CHAR0373: set_camera_directly_behind_player0173: set_actor $PLAYER_ACTOR z_angle_to  262.001B6: set_weather  1    087B: set_player $PLAYER_CHAR clothes "NECKHASH" "NECK" 13 087B: set_player $PLAYER_CHAR clothes "TSHIRTWHITE" "TSHIRT" 0 087B: set_player $PLAYER_CHAR clothes "WORKTRCAMOGRN" "JEANS"  2 087B: set_player $PLAYER_CHAR clothes "SNEAKERPROWHT" "SNEAKER"  3 087B: set_player $PLAYER_CHAR clothes "PLAYER_FACE" "HEAD"  1 070D: $PLAYER_CHAR 04BB: select_interior  0;; select render area01B4: set_player $PLAYER_CHAR frozen_state  1 (unfrozen)01B7: release_weather016C: restart_if_wasted at $7 $6 $5 angle  0.0 unknown  0 0247: request_model #BULLET06E9: request_car_component #NTO_B_S:MAIN_390001: wait  0 ms00D6: if  00248:   model #BULLET available      004D: jump_if_false ££MAIN_3900A5: $4 = create_car #BULLET at $7 $6 $506E7: $var = add_car_component #NTO_B_S to_car $402AC: set_car $4 immunities  1  1  1  1  10229: set_car $4 color_to  126  40036A: put_actor $PLAYER_ACTOR in_car $4016A: fade  1 (back)  1000 ms0001: wait  100 ms03E6: remove_text_box:MAIN_480001: wait  2500 ms0002: jump ££MAIN_48

 

 

Consider me practice wink.gif And, please remember that I only need this car at start up and reload, I need only to start the game with it and reload and exit with no problems. I need not spawn it anywhere etc.

Edited by dertyjerzian

Share this post


Link to post
Share on other sites
Demarest

@Reefer: Did you update both of the radius checks? Also, the radius was made 100 because that was VC's parked car generator radius. I'm certain in SA it's LARGER. Also, I had neglected to also have an if car wrecked check in the final loop.

 

@derty: You didn't release model and you didn't remove references to car. This will clog memory in a way that MULTIPLE restarts would crash the game. Besides, for me, all 3 GTAs SOMETIMES crash when starting/loading a game even with original code.

Share this post


Link to post
Share on other sites
ReeferSmoke

@Demerest the radius checks I am currently using are:

 

00FE:   actor $PLAYER_ACTOR  0 ()near_point  414.2  2532.1  16.3 radius  150.0  100.0  50.080FE:   NOT   actor $PLAYER_ACTOR  0 ()near_point  414.2  2532.1  16.3 radius  150.0  100.0  50.0

 

 

As for the if car wrecked check. I don't understand what exactly that is and how it's used yet. Still a noob sigh.gif

 

Share this post


Link to post
Share on other sites
Demarest
As for the if car wrecked check. I don't understand what exactly that is and how it's used yet. Still a noob sigh.gif

Well I'm sure a quick search of code for the word wrecked will have you on your way. As far as the radii, as long as they match, that's cool. They don't even HAVE to match, but if they don't, you'll have undesired results ingame.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


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