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. DLC
      2. Find Lobbies & Players
      3. Guides & Strategies
      4. Vehicles
      5. Content Creator
      6. Help & Support
      7. The Diamond Casino Heist
    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

homer_simpson

Flying code & Spawning code

Recommended Posts

homer_simpson

Well after a days work i made a teleport code where you go up to one of the terminals inside the airport and stand inside a marker and a text box appears saying "stand here for 3 seconds to fly to "your area here". heres the code

 

:FlyPort0001: wait  0 ms00D6: if  000E4:   player $PLAYER_CHAR  1 (in-sphere)near point on foot  -1389.29  -881.521 radius  0.6  1.3004D: jump_if_false ££FlyPort03BC:  [email protected] = create_sphere  -1389.29  -881.521  21.9  1.5 03E5: text_box "TP1"; Stand here for 3 seconds to fly to Paradise Island0001: wait  1000 ms00D6: if  000E4:   player $PLAYER_CHAR  1 (in-sphere)near point on foot  -1389.29  -881.521 radius  0.6  1.3004D: jump_if_false ££FlyPort0001: wait  1000 ms00D6: if  000E4:   player $PLAYER_CHAR  1 (in-sphere)near point on foot  -1389.29  -881.521 radius  0.6  1.3004D: jump_if_false ££FlyPort0001: wait  1000 ms00D6: if  000E4:   player $PLAYER_CHAR  1 (in-sphere)near point on foot  -1389.29  -881.521 radius  0.6  1.3004D: jump_if_false ££FlyPort0169: set_fade_color  255  255  255016A: fade  0 ()  200 ms0001: wait 200 ms016A: fade  1 (back)  200 ms0055: put_player $PLAYER_CHAR at  X Y Z0001: wait  0 ms0002: jump ££FlyPort

 

Where it says X Y Z near the end just put the coords of where you want to fly to:D.

Now this is a code where you press the camera button when on foot and it will spawn a car of your choice which is everythingproof right infront of you

 

:Spawn0001: wait 200 ms00D6: if  00256:   player $PLAYER_CHAR defined004D: jump_if_false ££Spawn00D6: if  000E1:   key_pressed  0  13004D: jump_if_false ££Spawn0247: request_model #YOURCAR:Spawn20001: wait  0 ms00D6: if  00248:   model #YOURCAR available004D: jump_if_false ££Spawn200D6: if  080E0:   NOT   player $PLAYER_CHAR driving004D: jump_if_false ££Spawn04C4: create_coordinate  [email protected]  [email protected]  [email protected] from_actor $PLAYER_ACTOR offset  0.0 5.0  0.000A5: $car = create_car #YOURCAR at  [email protected]  [email protected]  [email protected]: set_car  $car immunities  1  1  1  1  10002: jump ££Spawn

 

Just change the YOURCAR to whatever car you want to use. biggrin.gif

 

Now a good one biggrin.gif this ones for all you peeps that cant make savepoints. this is a savepoint all u gatta do is replace the X Y Z with the coords you want

 

:Mysave03A4: name_thread "Mysave":Save10001: wait  250 ms00D6: if  00256:   player $PLAYER_CHAR defined004D: jump_if_false ££Jumpthing00D6: if  003EE:   player $PLAYER_CHAR controllable004D: jump_if_false ££Jumpthing00D6: if  00038:   $ONMISSION ==  0 ;; integer values004D: jump_if_false ££Destroy00D6: if  00038:   $194 ==  0 ;; integer values004D: jump_if_false ££Save20213: $195 = create_pickup #PICKUPSAVE type  3 at  X Y Z0004: $194 =  1 ;; integer values:Save200D6: if  00214:   pickup $195 picked_up004D: jump_if_false ££Jumping0050: gosub ££Frozen00D6: if  00256:   player $PLAYER_CHAR defined004D: jump_if_false ££Gofish0215: destroy_pickup $1950213: $195 = create_pickup #PICKUPSAVE type  3 at  X Y Z016A: fade  1 (back)  1000 ms0395: clear_area  1 at  X Y range  10.2  1.00055: put_player $PLAYER_CHAR at  X Y Z0171: set_player $PLAYER_CHAR z_angle_to  270.0:Gofish0050: gosub ££Savedone:Jumping0002: jump ££Jumpthing:Destroy00D6: if  00038:   $194 ==  1 ;; integer values004D: jump_if_false ££Jumpthing0215: destroy_pickup $1950004: $194 =  0 ;; integer values:Jumpthing0002: jump ££Save1:Frozen0004: $ONMISSION =  1 ;; integer values01B4: set_player $PLAYER_CHAR frozen_state  0 (frozen)03D8: show_save_screen0001: wait  0 ms:Savedone00D6: if  00256:   player $PLAYER_CHAR defined004D: jump_if_false ££Savedone202EB: restore_camera_with_jumpcut0373: set_camera_directly_behind_player:Savedone20001: wait  500 ms00D6: if  00256:   player $PLAYER_CHAR defined004D: jump_if_false ££Return01B4: set_player $PLAYER_CHAR frozen_state  1 (unfrozen)0004: $ONMISSION =  0 ;; integer values:Return0051: return

 

Edited by homer_simpson

Share this post


Link to post
Share on other sites
Barton Waterduck

Less code, harder to get I guess:

 

:FlyPortInit03BC:  [email protected] = create_sphere  -1389.29  -881.521  21.9  1.5 :[email protected] = 0:FlyPort0001: wait  250 ms00D6: if  00256:   player $PLAYER_CHAR defined004D: jump_if_false ££FlyPort00D6: if  000F6:   player $PLAYER_CHAR  0 ()near_point_on_foot -1389.29  -881.521  21.9 radius  1.5  1.5  2.5004D: jump_if_false ££FlyPortResetTimeif [email protected] > 3000jf ££FlyPort01B4: set player $PLAYER_CHAR frozen state  0 (frozen)0169: set_fade_color  255  255  255016A: fade  0 ()  200 ms0001: wait 200 ms0055: put_player $PLAYER_CHAR at  X Y Z016A: fade  1 (back)  200 ms0001: wait  200 ms01B4: set player $PLAYER_CHAR frozen state  1 (unfrozen)0002: jump ££FlyPortResetTime

 

 

Share this post


Link to post
Share on other sites
homer_simpson

meh they both work. so tell me what you think?

Share this post


Link to post
Share on other sites
Barton Waterduck

I think my code is better. rolleyes.gif

Share this post


Link to post
Share on other sites
immortalfantasy7

How do you use this code in my game? alien.gif

Share this post


Link to post
Share on other sites
random_download

Open up a scirpt in MB (such as the original main.scm). Search for '004F: create_thread' and add there '004F: create_thread ££Spawn' or '004F: create_thread ££FlyPort' depending on which oine you want. Then search for 'end_thread' and add the code afterwards. Compile Copy & Run.

Share this post


Link to post
Share on other sites
PatrickW
I think my code is better. rolleyes.gif

I hate to admit it but it sure is....

 

In fact, it's pure elegance, I saved it in my scm snippets folder.....

 

inlove.gif

Share this post


Link to post
Share on other sites
homer_simpson

hey well i wonder why its better lol hes Barton Waterduck THE greatest coder i have ever met. So why dont you tell me what you think about MY code biggrin.gif

PLZ

Share this post


Link to post
Share on other sites
PatrickW

I'm sorry, offcoarse when I invade you're topic I should also comment on you code:

 

On the teleport code:

The idea is good, the code works but as barton pointed out, for timing stuff you should learn how to use @16 and @17 instead of the wait-opcode.

 

You're missing a couple of if-player-defined checks in your code, you should have one after each wait-opcode, before the next reference to $PLAYER_CHAR or $PLAYER_ACTOR is made. Failing to do so, may crash your game when the player dies or gets arrested.

 

Looking at it, Bartons code suffers from the same problem,, in the lower half where he cheated by using some wait-opcodes during the fading. tounge.gif

 

On the car-spawn code:

I Don't want to know what happens if you spawn a large vehicle like a "coach".

Changes are very good that the player gets crushed smile.gif

You should at least given the newly spawned vehicle a defined angle.

The best approach would probably to sniff the players angle, and assign the same angle to the vehicle. And to prevent the crushing problem with large vehciles, it's probably better to spawn the vehivle not direct in front of the player, but with a considerable sideways offset.

 

On the save-point template:

 

Good way, I haven't checked it completely, but I remember that the original savepoint code also includes Zone-checking, which you seem to have left out. I'm not completely sure what the impact is of that.

 

 

In general, you have made amazing progress in your mission coding, keep it up and I'm sure that we see a whole lot more of you.....

Share this post


Link to post
Share on other sites
homer_simpson

Thank you very much i will remember the player checks from now on. Bartons Teleport code is alot better actually now that i look at it. its shorter and i used it alot now:D i put a marker at the bottom door of a building and if the building has a roof i would make the teleport on the roof its great. Thx barton. I have quit missions for a while and i started on custom models and textures ill keep you updated in the models & textures or maps

Share this post


Link to post
Share on other sites
Barton Waterduck
:FlyPortInit03BC:  [email protected] = create_sphere  -1389.29  -881.521  21.9  1.5 :[email protected] = 0:FlyPort0001: wait  250 ms00D6: if  00256:   player $PLAYER_CHAR defined004D: jump_if_false ££FlyPort00D6: if  000F6:   player $PLAYER_CHAR  0 ()near_point_on_foot -1389.29  -881.521  21.9 radius  1.5  1.5  2.5004D: jump_if_false ££[email protected] > 3000jf ££FlyPort01B4: set player $PLAYER_CHAR frozen state  0 (frozen)0169: set_fade_color  255  255  255016A: fade  0 ()  200 ms0001: wait 200 ms00D6: if  00256:   player $PLAYER_CHAR defined004D: jump_if_false ££FlyPort0055: put_player $PLAYER_CHAR at  X Y Z016A: fade  1 (back)  200 ms0001: wait  200 ms00D6: if  00256:   player $PLAYER_CHAR defined004D: jump_if_false ££FlyPort01B4: set player $PLAYER_CHAR frozen state  1 (unfrozen)0002: jump ££FlyPortResetTime

 

Share this post


Link to post
Share on other sites
jason_urbanski

hi love the codes great fun but the save point does not work that well coz u go in to it and save the game but then u cant get away from it if u try to run away it just bring up the save menu???????? confused.gif

Share this post


Link to post
Share on other sites
PatrickW

2 months is just within the liveliness boundries of this topic smile.gif

 

You're right, this is caused by the fact that the player is put back at the exact same position as the pickup is. The solution to this is that the coordinates in

 

0055: put_player $PLAYER_CHAR at  X Y Z

 

should be slightly off the coordinates used for the pickup, as is done in the original r* code. ( or make a waitloop that waits until the player has moved away before recreating the pickup, but that would only make things complex.

Share this post


Link to post
Share on other sites
jason_urbanski

thanx alot I was a bit woried that the topic was a bit old im a bit of a noob to coding so hope this works coz im makin a litle island and i need to make a save point smile.gif

Edited by jason_urbanski

Share this post


Link to post
Share on other sites
RainingAcid

 

:Mysave03A4: name_thread "Mysave":Save10001: wait  250 ms00D6: if  00256:   player $PLAYER_CHAR defined004D: jump_if_false ££Jumpthing00D6: if  003EE:   player $PLAYER_CHAR controllable004D: jump_if_false ££Jumpthing00D6: if  00038:   $ONMISSION ==  0;; integer values004D: jump_if_false ££Destroy00D6: if  00038:   $194 ==  0;; integer values004D: jump_if_false ££Save20213: $195 = create_pickup #PICKUPSAVE type  3 at  X Y Z0004: $194 =  1;; integer values:Save200D6: if  00214:   pickup $195 picked_up004D: jump_if_false ££Jumping0050: gosub ££Frozen00D6: if  00256:   player $PLAYER_CHAR defined004D: jump_if_false ££Gofish0215: destroy_pickup $1950213: $195 = create_pickup #PICKUPSAVE type  3 at  X Y Z016A: fade  1 (back)  1000 ms0395: clear_area  1 at  X Y range  10.2  1.00055: put_player $PLAYER_CHAR at  X Y Z0171: set_player $PLAYER_CHAR z_angle_to  270.0:Gofish0050: gosub ££Savedone:Jumping0002: jump ££Jumpthing:Destroy00D6: if  00038:   $194 ==  1;; integer values004D: jump_if_false ££Jumpthing0215: destroy_pickup $1950004: $194 =  0;; integer values:Jumpthing0002: jump ££Save1:Frozen0004: $ONMISSION =  1;; integer values01B4: set_player $PLAYER_CHAR frozen_state  0 (frozen)03D8: show_save_screen0001: wait  0 ms:Savedone00D6: if  00256:   player $PLAYER_CHAR defined004D: jump_if_false ££Savedone202EB: restore_camera_with_jumpcut0373: set_camera_directly_behind_player:Savedone20001: wait  500 ms00D6: if  00256:   player $PLAYER_CHAR defined004D: jump_if_false ££Return01B4: set_player $PLAYER_CHAR frozen_state  1 (unfrozen)0004: $ONMISSION =  0;; integer values:Return0051: return

 

I get error with this. Something about not able to find #pickupsave type 3 in default.ide.

Share this post


Link to post
Share on other sites
jason_urbanski

 

:Mysave03A4: name_thread "Mysave":Save10001: wait  250 ms00D6: if  00256:   player $PLAYER_CHAR defined004D: jump_if_false ££Jumpthing00D6: if  003EE:   player $PLAYER_CHAR controllable004D: jump_if_false ££Jumpthing00D6: if  00038:   $ONMISSION ==  0;; integer values004D: jump_if_false ££Destroy00D6: if  00038:   $194 ==  0;; integer values004D: jump_if_false ££Save20213: $195 = create_pickup #PICKUPSAVE type  3 at  X Y Z0004: $194 =  1;; integer values:Save200D6: if  00214:   pickup $195 picked_up004D: jump_if_false ££Jumping0050: gosub ££Frozen00D6: if  00256:   player $PLAYER_CHAR defined004D: jump_if_false ££Gofish0215: destroy_pickup $1950213: $195 = create_pickup #PICKUPSAVE type  3 at  X Y Z016A: fade  1 (back)  1000 ms0395: clear_area  1 at  X Y range  10.2  1.00055: put_player $PLAYER_CHAR at X Y Z  (this must be slightly different to all of the rest)0171: set_player $PLAYER_CHAR z_angle_to  270.0:Gofish0050: gosub ££Savedone:Jumping0002: jump ££Jumpthing:Destroy00D6: if  00038:   $194 ==  1;; integer values004D: jump_if_false ££Jumpthing0215: destroy_pickup $1950004: $194 =  0;; integer values:Jumpthing0002: jump ££Save1:Frozen0004: $ONMISSION =  1;; integer values01B4: set_player $PLAYER_CHAR frozen_state  0 (frozen)03D8: show_save_screen0001: wait  0 ms:Savedone00D6: if  00256:   player $PLAYER_CHAR defined004D: jump_if_false ££Savedone202EB: restore_camera_with_jumpcut0373: set_camera_directly_behind_player:Savedone20001: wait  500 ms00D6: if  00256:   player $PLAYER_CHAR defined004D: jump_if_false ££Return01B4: set_player $PLAYER_CHAR frozen_state  1 (unfrozen)0004: $ONMISSION =  0;; integer values:Return0051: return

 

I get error with this. Something about not able to find #pickupsave type 3 in default.ide.

Make shure you have made all of the x y z's in to coordinates of were you want the save to be other wise you are bound to get an error smile.gif

Edited by jason_urbanski

Share this post


Link to post
Share on other sites
homer_simpson

w0w its been a while since i checked here lol looks like its been getting a bit of attention

1) Make sure u change all X Y Z to coord's

2) Make sure the coords under Save 2 and this line

0055: put_player $PLAYER_CHAR at  X Y Z

 

make sure that is diffirent then under Save one and this line

0213: $195 = create_pickup #PICKUPSAVE type  3 at  X Y Z

 

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.


  • 2 Users Currently Viewing
    0 members, 0 Anonymous, 2 Guests

×
×
  • Create New...

Important Information

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