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

cns

fire from car

Recommended Posts

Demarest
There is no checking if the homies are dead (or if you are in the right car), dont push me for that tounge.gif

Why not? tounge.gif

 

Same suggestions as before. Also, your :DriveBy_Avail_001 loop needs a wait 0 or could crash the game. Your if clump would be a lot more appropriate as if NOT car wrecked jf out, if player driving jf out, if keypressed jf out loop. Same with the trap loop. Last but not least, you're still using an end_thread that will never get executed.

 

Nice work. Looks like you're already enjoying the fruits of your labor. Just need to take it to the next step, give it a trigger and you've got yourself a mod smile.gif

Share this post


Link to post
Share on other sites
nubbel

 

There is no checking if the homies are dead (or if you are in the right car), dont push me for that tounge.gif

Why not? tounge.gif

 

Because I'm too lazy atm sleepy.gif

 

 

your :DriveBy_Avail_001 loop needs a wait 0 or could crash the game

 

Oh, I defenetly forgot this, thx.

 

 

Your if clump would be a lot more appropriate as if NOT car wrecked jf out, if player driving jf out, if keypressed jf out loop. Same with the trap loop.

 

Ok, sounds conclusive.

 

 

Last but not least, you're still using an end_thread that will never get executed.

 

I just thought about that directly after posting my code xmas.gif

 

 

Nice work. Looks like you're already enjoying the fruits of your labor. Just need to take it to the next step, give it a trigger and you've got yourself a mod smile.gif

 

Thank you. Yes, it's quite fun to play around.

But I'm too lazy to make such things a mod. Anybody who wants to take the code is allowed to xmas.gif

Share this post


Link to post
Share on other sites
Y_Less

:drivebyTrap0001: wait  150 ms00D6: if  000E1:   key_pressed  0  4004D: jump_if_false ££drivebyChk0002: jump ££drivebyTrap00D6: if  00256:   player $PLAYER_CHAR defined004D: jump_if_false ££drivebyChk0002: jump ££drivebyTrap

 

 

This player defined check will never get run as if the first part is true or false, it is jumped away. You would need the definition check before the key_pressed check as (AFAIK) it is a player dependent check and if the player is not defined when you execute it, the game will crash.

 

Also, to check the player is in the right car, you can just use:

 

0442: is_player $player_char in_car @0

 

or

 

0448: is_actor $player_actor in_car @0

 

Replace your is_player_driving check with one of them (in SA I believe the actor check is more likely to work) and it should only work when you are in the right car.

Share this post


Link to post
Share on other sites
Demarest

When player is dead, the game more or less trucks on regardless. I think the is player defined is to prevent further commands that refer to $PLAYER_CHAR from referencing nothing and crashing. Of course, the GTAs' EXE is more resilient than that because when developing Neo, I left that check out for the longest time and the code would either ignore my input or continue to manipulate his corpse. It's still good practice though.

 

Point being that because a keypress conditional doesn't reference $PLAYER_CHAR, you do not need to check if it's defined ahead of time.

Share this post


Link to post
Share on other sites
Y_Less
Ahh, well then that check is completely pointless (especially is it is not even run in that code anyway).

Share this post


Link to post
Share on other sites
Bigun

About the player driveby. You can indeed drive the car while shooting. With no further delay I will just post the code for people who wanna use it/learn from it. Note that I did not make the code, /Pavel/ sent it to me from his Car Driver mod.

 

 

 

004F: create_thread ££DRIVER_Shoot1(with all the create_threads...)

 

 

(above mission 0):DRIVER_ShootA0001: wait  30 ms03C0: @990 = actor $PLAYER_ACTOR car:DRIVER_Shoot20001: wait 150 ms00D6: if 000DB: actor $PLAYER_ACTOR in_car @990004D: jump_if_false ££DRIVER_ShootA0001: wait 0 ms00D6: if 0 80E1: NOT key_pressed 0 4004D: jump_if_false ££DRIVER_Shoot30002: jump ££DRIVER_ShootA:DRIVER_Shoot3 0713: unknown_action_sequence $PLAYER_ACTOR -1 -1 0.0 0.0 0.0 300.0 8 1 1000001: wait 500 ms:DRIVER_Shoot40001: wait 50 ms00D6: if 0 80E1: NOT key_pressed 0 4004D: jump_if_false ££DRIVER_Shoot50002: jump ££DRIVER_Shoot4:DRIVER_Shoot5 0812: unknown_action_sequence $PLAYER_ACTOR "OFF_SIT_IDLE_LOOP" "INT_OFFICE" 0.0 0 0 0 0 002EB: restore_camera_with_jumpcut 0001: wait 500 ms0002: jump ££DRIVER_ShootA

 

I guess that could be optimized a little. This allows you to driveby with any weapon, but if you have a submachine gun you could only use it since the game auto puts it as selected weapon. Might need to have a submachine gun and waste its ammo to be able to use other weapons...

Notes: Cant driveby with Rocket Launcher and the like.

Cant fall off bike when in driveby mode.

Share this post


Link to post
Share on other sites
Demarest
What happens when the player is on foot, the code calls to store his car and crashes FIRST THING? I'll leave it at that.

Share this post


Link to post
Share on other sites
/Pavel/

This code doesn't crash in my Driver Mod because it only starts (create_thread code) when Cj is in the car. So some changes have to be done, if you want to thread run continuously in the background.

Share this post


Link to post
Share on other sites
Demarest
There are multiple jumps back to it so even in a car, a person could get out. Unfortunately, that's why most code is insanely redundant. Can't afford to crash the game wink.gif

Share this post


Link to post
Share on other sites
Bigun

Actually..it seems not to crash the game (storing a car when actor aint in one).

The keypress ID is 4, which is secondary fire in car and action on foot. I didnt crash when I pressed action with this code in.

 

Perhaps SA has actual crash-preventation features? yawn.gif Not likely, but it seems very easily avoidable crashing just because the game tried to get a handle of someone's car, and he is on foot.

Share this post


Link to post
Share on other sites
Demarest
I still be hanging around helping people to become GOOD coders instead of slopping by with bare minimum wink.gif

Share this post


Link to post
Share on other sites
java

So now after I read this whole topic I am still not able to fire from a passenger seat.

I am not good at changing codes etc.

but I want to add some mods together for personal use, I want to add a script that allows you to fire from the passenger seat.

 

I saw the Back to reality mod has the abiltity to fire from passenger seat, but I don't want to add all of the scripts of the mod to my main.scm.

so I only need the part of the codes that I need to add to fire from a passenger seat.

 

I think this is the part I need confused.gif

 

 

:MOB_GF_9840001: wait  0 ms03A4: name_thread "PASSENGER"0004: $11201.25 =  0 ;; integer values0004: $11200.25 = -1 ;; integer values00D6: if  08449:   NOT   actor $PLAYER_ACTOR in_a_car004D: jump_if_false ££MOB_GF_98400D6: if  000E1:   key_pressed  0  13004D: jump_if_false ££MOB_GF_98400A0: store_actor $PLAYER_ACTOR position_to $11199.25 $11198.25 $11197.250086: $11196.25 = $11199.25 ;; floating-point values only0009: $11196.25 +=  3.0 ;; floating-point values0086: $11195.25 = $11198.25 ;; floating-point values only0009: $11195.25 +=  3.0 ;; floating-point values0086: $11194.25 = $11196.25 ;; floating-point values only000D: $11194.25 -=  6.0 ;; floating-point values0086: $11193.25 = $11195.25 ;; floating-point values only000D: $11193.25 -=  6.0 ;; floating-point values053E: $11200.25 = get_random_car_with_actors -1 in_area $11196.25 $11195.25 $11194.25 $11193.250004: $11201.25 =  1 ;; integer values0001: wait  0 ms00D6: if  18038:   NOT   $11200.25 == -1 ;; integer values8038:   NOT   $11201.25 ==  0 ;; integer values004D: jump_if_false ££MOB_GF_9840004: $11192.25 =  0 ;; integer values:MOB_GF_10110001: wait  0 ms00D6: if  08018:   NOT   $11192.25 >  4 ;; integer values004D: jump_if_false ££MOB_GF_105200D6: if  08431:   NOT   car $11200.25 car_passenger_seat_free $11192.25004D: jump_if_false ££MOB_GF_10200008: $11192.25 +=  1 ;; integer values0002: jump ££MOB_GF_1011:MOB_GF_10200001: wait  0 ms00AD: set_car $11200.25 max_speed_to  0.005CA: unknown_action_sequence $PLAYER_ACTOR $11200.25  10000 $11192.25 :MOB_GF_10230001: wait  1000 ms00D6: if  18119:   NOT   car $11200.25 wrecked0256:   player $PLAYER_CHAR defined004D: jump_if_false ££MOB_GF_107300D6: if  080DB:   NOT   actor $PLAYER_ACTOR in_car $11200.25004D: jump_if_false ££MOB_GF_10360008: $11192.25 +=  1 ;; integer values00D6: if  00018:   $11192.25 >  20 ;; integer values004D: jump_if_false ££MOB_GF_10230002: jump ££MOB_GF_1073:MOB_GF_10360001: wait  0 ms00D6: if  000DB:   actor $PLAYER_ACTOR in_car $11200.25004D: jump_if_false ££MOB_GF_10360004: $11238.25 =  1 ;; integer values00D6: if  00209: $11191.25 = random_int  1  40001: wait  0 ms0004: $11190.25 =  20 ;; integer values0068: $11190.25 *= $11191.25 ;; integer values0091: $11189.25 = integer_to_float $11190.25  00AD: set_car $11200.25 max_speed_to $11189.2500AF: set_car $11200.25 driver_behaviour_to  1000A8: set_car $11200.25 to_psycho_driver00AE: unknown_set_car $11200.25 to_ignore_traffic_lights  20002: jump ££MOB_GF_1056:MOB_GF_10520001: wait  0 ms03E5: text_box 'NOSEATS'0001: wait  1000 ms03E6: remove_text_box:MOB_GF_10560001: wait  0 ms00D6: if  00256:   player $PLAYER_CHAR defined004D: jump_if_false ££MOB_GF_107300D6: if  08119:   NOT   car $11200.25 wrecked004D: jump_if_false ££MOB_GF_107300D6: if  000DB:   actor $PLAYER_ACTOR in_car $11200.25004D: jump_if_false ££MOB_GF_10670002: jump ££MOB_GF_1056:MOB_GF_10670001: wait  0 ms00AD: set_car $11200.25 max_speed_to  10.001C3: remove_references_to_car $11200.25 ;; Like turning a car into any random car0004: $11238.25 =  0 ;; integer values0002: jump ££MOB_GF_984004E: end_thread:MOB_GF_10730001: wait  0 ms01C3: remove_references_to_car $11200.25 ;; Like turning a car into any random car0004: $11238.25 =  0 ;; integer values0002: jump ££MOB_GF_984004E: end_thread:MOB_GF_10780001: wait  0 ms0004: $11238.25 =  0 ;; integer values:MOB_GF_10800001: wait  0 ms00D6: if  10018:   $11238.25 >  0 ;; integer values00E1:   key_pressed  0  6004D: jump_if_false ££MOB_GF_10920001: wait  1500 ms00D6: if  000E1:   key_pressed  0  6004D: jump_if_false ££MOB_GF_10800001: wait  0 ms0713: unknown_action_sequence $PLAYER_ACTOR -1 -1  0.0  0.0  0.0  300.0  8  1  100 0001: wait  2000 ms:MOB_GF_10920001: wait  0 ms00D6: if  10018:   $11238.25 >  0 ;; integer values00E1:   key_pressed  0  16004D: jump_if_false ££MOB_GF_110500D6: if  08020:   NOT   $11189.25 >  210.0 ;; floating-point values004D: jump_if_false ££MOB_GF_10800009: $11189.25 +=  10.0 ;; floating-point values00AD: set_car $11200.25 max_speed_to $11189.250090: $11190.25 = float_to_integer $11189.25  01E4: text_1number_lowpriority 'MAXSPED' $11190.25  500 ms  10001: wait  500 ms:MOB_GF_11050001: wait  0 ms00D6: if  10018:   $11238.25 >  0 ;; integer values00E1:   key_pressed  0  14004D: jump_if_false ££MOB_GF_108000D6: if  00020:   $11189.25 >  9.9 ;; floating-point values004D: jump_if_false ££MOB_GF_1080000D: $11189.25 -=  10.0 ;; floating-point values00AD: set_car $11200.25 max_speed_to $11189.250090: $11190.25 = float_to_integer $11189.25  01E4: text_1number_lowpriority 'MAXSPED' $11190.25  500 ms  10001: wait  500 ms0002: jump ££MOB_GF_1080:MOB_GF_11190001: wait  0 ms00D6: if  48018:   NOT   $11238.25 >  0 ;; integer values84A7:   NOT $PLAYER_ACTOR 84C8:   NOT $PLAYER_ACTOR 00E1:   key_pressed  0  1700DF:   actor $PLAYER_ACTOR driving004D: jump_if_false ££MOB_GF_11190001: wait  800 ms00D6: if  000E1:   key_pressed  0  17004D: jump_if_false ££MOB_GF_111900D6: if  00018:   $11239.25 >  0 ;; integer values004D: jump_if_false ££MOB_GF_11380006: $11239.25 =  0 ;; integer values067F: $11237.25  2 0001: wait  500 ms0002: jump ££MOB_GF_1119:MOB_GF_11380001: wait  0 ms0006: $11239.25 =  1 ;; integer values067F: $11237.25  1 0001: wait  500 ms0002: jump ££MOB_GF_1119

 

 

but when I add it and add 004F: create_thread ££MOB_GF_984 to the create_thread list

It won't work, When I press "V" in game I acces a passenger seat

but when I try to press "spacebar" to get in fire from passenger seat mode nothing happens cryani.gif

 

(sorry for the huge post)

anyone knows what's wrong???

Share this post


Link to post
Share on other sites
Demarest

You can't be the driver and the passenger at the same time. It was discussed before. If somebody else is driving, you won't be able to shoot via keypress. The drive-by opcodes require you to specify a target.

 

Side note: You should use if player defined checks before commands/conditionals that reference him. Also, you should use custom labels. Didn't read into your code any further than that.

Share this post


Link to post
Share on other sites
java

but if you install the back to reality mod you can press handbrake and then you can shoot as being a passenger

the above post is the part of the back to reality mod I thought that allows you to do that.

so if the code above is the code copied from that mod and the mod uses the same part of the code to fire from passenger seat then everything would be alright,

but I don't know if this is the correct part I am trying to copy in my main.scm.

cause when I add this code it will work to get in the car as a passenger but pressing hanbrake to enable fire from passenger seat won't work

 

so, is this the wrong part or what?? blink.gif

Share this post


Link to post
Share on other sites
cns

 

but if you install the back to reality mod you can press handbrake and then you can shoot as being a passenger

the above post is the part of the back to reality mod I thought that allows you to do that.

so if the code above is the code copied from that mod and the mod uses the same part of the code to fire from passenger seat then everything would be alright,

but I don't know if this is the correct part I am trying to copy in my main.scm.

cause when I add this code it will work to get in the car as a passenger but pressing hanbrake to enable fire from passenger seat won't work

 

so, is this the wrong part or what?? blink.gif

maybe it will be better to contact with me to understand what part of Back To Reality mod you need, cause no one knows this mod better than I wink.gif

Share this post


Link to post
Share on other sites
Demarest
That's true. But how to fire from a car is not indigenous to your mod. Since you see he's having difficulties, why not post on it here so that others may learn from your work?

Share this post


Link to post
Share on other sites
Bigun
Looks like somebody didnt bother reading page 2. More than only somebody.

Share this post


Link to post
Share on other sites
cns
That's true. But how to fire from a car is not indigenous to your mod. Since you see he's having difficulties, why not post on it here so that others may learn from your work?

If he tries to get part from my code will be better to ask what part he need, cause I didnt use clear fire code, Ive added extra that I think he doesnt need... Thats why I said so...

And about this mod, as I said in B2R topic, thanks for all who posted there, I would never done without your help...

Share this post


Link to post
Share on other sites
Blankhand

Anyone here anymore?

 

It seems you got the manual aim while driving to work.. Unfortunately I have no clue how to use that bit of code. sad.gif

 

What I really want is to be able to use other weapons and manual aim while driving.. without activating cheats..

 

It looks like you guys figured out how to do it but your discussion is way over my head.

 

This seems like a no brainer for a little mod yet I have spent 3 days searching the net and I can't find such a mod.. sooo, wha'dya say guys?

 

I guess the primary issues would be getting the game to not switch to the smg automatically (or better yet find a way to let us change weapons while driving), and getting the rate of fire to be closer to normal..

Share this post


Link to post
Share on other sites
blackdart

i don't know how this could be done but have a look in the driver mod and the heli part of it because you can change weapons with that

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.
Note: Your post will require moderator approval before it will be visible.

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.