IMG

 
IMG
IMG   IMG
  Welcome to GTAForums! Be sure to check out the Grand Theft Auto V Forum.

You are not registered! (If you are, click here to login) Registering is fast, free and easy and allows you to instantly reply to any topic on GTAForums.
Why wait? Click here to register your own unique username and become part of the ever-growing community!


( Log In | Register | Revalidate Validation E-mail )
Quick Log-In:
  IMG
       
>
Forum Rules GTA Modification Forums

Please post mod releases in the Mod Showroom

GTAGarage.com
free mod hosting from GTANet, simply login with your GTAForums account details

GTAModding.com
GTANet's modding wiki

GTA Modding Chatroom
provided by irc.gtanet.com (Don't have an IRC client? Click here)


  Reply to this topicStart new topicStart Poll

 [Q] Parking sensors

 Parking sensors for GTA SA
 
G-Modifications  
Posted: Thursday, Nov 10 2011, 20:34
Quote Post


G
Group Icon
Group: Members
Joined: Oct 24, 2011

be.gif

XXXXX



Hello

Is it possible to make parking sensors for GTA SA? dozingoff.gif

G-Modifications
PM
  Top
 

 
Pie015  
Posted: Thursday, Nov 10 2011, 20:44
Quote Post


6 STAR VETERAN
Group Icon
Group: Members
Joined: Jun 11, 2010

uk.gif

XXXXX



CODE
01B0:   car 71@ sphere 0 in_sphere 2644.462 -2017.282 12.5547 radius 4.0 4.0 4.0 stopped
PMXbox LivePlayStation Network
  Top
 

 
G-Modifications  
Posted: Thursday, Nov 10 2011, 20:50
Quote Post


G
Group Icon
Group: Members
Joined: Oct 24, 2011

be.gif

XXXXX



Thanks, but I didn't mean that.

Whene you drive reverse, you will hear blips that you are to close to an object.

G-Modifications
PM
  Top
 

 
SilentPL  
Posted: Thursday, Nov 10 2011, 22:01
Quote Post


Senior File Manager
Group Icon
Group: Members
Joined: Feb 1, 2010

pl.gif

Member Award




I've made such a mod ages ago, but it was pretty nooby and I had to adjust it to every vehicle. However, you might use an opcode to get model dimensions, then get coords with some offset and check if there's any obstacles in this line. I think I even lost the sources.
Users WebsitePMMSNXbox Live
  Top
 

 
G-Modifications  
Posted: Friday, Nov 11 2011, 07:16
Quote Post


G
Group Icon
Group: Members
Joined: Oct 24, 2011

be.gif

XXXXX



Alright I will try this.

It's strange that almost nobody made a parking sensor mod. When I drive reverse I always hit something confused.gif .

G-Modifications

EDIT:

I've tried it and it won't work. Can someone help me, please?

G-Modifications

This post has been edited by G-Modifications on Friday, Nov 11 2011, 13:31
PM
  Top
 

 
Pie015  
Posted: Friday, Nov 11 2011, 13:57
Quote Post


6 STAR VETERAN
Group Icon
Group: Members
Joined: Jun 11, 2010

uk.gif

XXXXX



How about this? I havent tried it but its off the top of my head:

CODE

:1
wait 0
if and
Actor.Driving($PLAYER_ACTOR)
Player.Defined($PLAYER_CHAR)
0AB0:  key_pressed 0x73 // edit it to your reverse key
jf @1
04C4: store_coords_to 0@ 1@ 2@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0
if
0AE3: 3@ = random_object_near_point 0@ 1@ 2@ in_radius 10.0 find_next 1 //IF and SET
jf @1
// Your sound here



PMXbox LivePlayStation Network
  Top
 

 
G-Modifications  
Posted: Friday, Nov 11 2011, 15:09
Quote Post


G
Group Icon
Group: Members
Joined: Oct 24, 2011

be.gif

XXXXX



I'm sorry but it doesn't work.

G-Modifications
PM
  Top
 

 
SilentPL  
Posted: Friday, Nov 11 2011, 16:42
Quote Post


Senior File Manager
Group Icon
Group: Members
Joined: Feb 1, 2010

pl.gif

Member Award




Untested, but should work. It's not very "professional", as it doesn't get the real rear bumper coordinates etc. Also, I'm not sure if I didn't mistake the dimensions - if it doesn't work, try to switch dimensionA vars with dimensionB vars.

[old code was here]

I bet it doesn't work though, damn my hate for testing scripts in game tounge.gif

Edit:

Doesn't work, guess I'll have to test it once.

Edit2:

This one works well:

CODE
{$CLEO}
0000: SENSORS

const
   NUM_PARKING_SENSORS     = 4     // Customize to adjust the amount of parking sensors (shouldn't be lower than 2 though)
   MAX_SENSOR_RANGE        = 3.0  // Max distance to any obstacle
   
   SOUND_RACE_321          = 1056
   SOUND_RACE_GO           = 1057 // Original R* names for these sounds :)
end

while true
   0001: wait 0 ms
   if
       00DF:   actor $PLAYER_ACTOR driving
   then
       03C0: 0@ = actor $PLAYER_ACTOR car
       02E3: 1@ = car 0@ speed
       if
           0023:   15.0 > 1@
       then
           0441: 1@ = car 0@ model
           if
               0A01:   model 1@ car
           then
               07E4: get_model 1@ dimensions_cornerA_to 2@ 3@ 4@ dimensions_cornerB_to 5@ 6@ 7@
               000B: 2@ += 0.25
               000F: 5@ -= 0.25
               
               0087: 8@ = 5@ // (float)
               0087: 11@ = 2@ // (float)
               0063: 8@ -= 2@  // (float)
               0087: 9@ = 8@ // (float)
               0006: 10@ = NUM_PARKING_SENSORS
               000E: 10@ -= 1
               0093: 10@ = integer 10@ to_float
               0073: 9@ /= 10@ // (float)  
               
               0087: 13@ = 3@ // (float)
               000F: 13@ -= MAX_SENSOR_RANGE
               0006: 14@ = false
               0007: 21@ = -100.0
   
               for 12@ = 1 to NUM_PARKING_SENSORS
                   0407: store_coords_to 15@ 16@ 17@ from_car 0@ with_offset 11@ 3@ -0.1
                   0407: store_coords_to 18@ 19@ 20@ from_car 0@ with_offset 11@ 13@ -0.1
                   if
                       86BD:   not no_obstacles_between 15@ 16@ 17@ and 18@ 19@ 20@ solid 1 car 1 actor 1 object 1 particle 0  
                   then
                       0006: 14@ = true    
                       0087: 22@ = 13@ // (float)
               
                       repeat
                           000B: 22@ += 0.1
                           if
                               0025:   22@ > 21@  // (float)
                           then
                               0087: 21@ = 22@ // (float)
                           end  
                           0407: store_coords_to 15@ 16@ 17@ from_car 0@ with_offset 11@ 3@ -0.1
                           0407: store_coords_to 18@ 19@ 20@ from_car 0@ with_offset 11@ 22@ -0.1
                       until 06BD:   no_obstacles_between 15@ 16@ 17@ and 18@ 19@ 20@ solid 1 car 1 actor 1 object 1 particle 0
                   end  
                   005B: 11@ += 9@  // (float)
               end
                   
               if
                   0039:   14@ == true
               then
                   0097: make 21@ absolute_float
                   006B: 21@ *= 21@  // (float)
                   006B: 21@ *= 21@  // (float)
                   0092: 21@ = float 21@ to_integer
                   if
                       001B:   75 > 21@
                   then
                       097A: play_audio_at 0.0 0.0 0.0 event SOUND_RACE_GO
                   else
                       097A: play_audio_at 0.0 0.0 0.0 event SOUND_RACE_321
                   end
                   0001: wait 21@ ms
               end
           end
       end
   end
end


This post has been edited by SilentPL on Friday, Nov 11 2011, 17:30
Users WebsitePMMSNXbox Live
  Top
 

 
G-Modifications  
Posted: Friday, Nov 11 2011, 17:38
Quote Post


G
Group Icon
Group: Members
Joined: Oct 24, 2011

be.gif

XXXXX



Thanks, I will try this.
I'm working on a speedometer. This is great for my super mod.

EDIT:

Nice, thank you very much. I give you a cookie.gif
But it doesn't work on front of the car. How can I add this?

G-Modifications

This post has been edited by G-Modifications on Friday, Nov 11 2011, 18:30
PM
  Top
 

 
SilentPL  
Posted: Friday, Nov 11 2011, 19:06
Quote Post


Senior File Manager
Group Icon
Group: Members
Joined: Feb 1, 2010

pl.gif

Member Award




Well, you'd have to adjust the code to use second model dimension, mostly requires swapping adding with substracting.
Users WebsitePMMSNXbox Live
  Top
 

 
G-Modifications  
Posted: Saturday, Nov 12 2011, 07:51
Quote Post


G
Group Icon
Group: Members
Joined: Oct 24, 2011

be.gif

XXXXX



Ok, thanks

G-Modifications
PM
  Top
 

 
Tiuga  
Posted: Friday, Jun 29 2012, 12:14
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jun 29, 2012

XXXXX



AI

This post has been edited by Tiuga on Saturday, Jun 30 2012, 04:48
PM
  Top
 

 

0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)

0 Members:

Topic Options Reply to this topicStart new topicStart Poll
Search topic for posted by (exact match)



 
IMG IMG