Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

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

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

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

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

    2. Support

    3. Suggestions

Getting coords to attach


Roflcake
 Share

Recommended Posts

hello, i want to make a grappling-hook script, where you can shoot a hook from the back-license plate from the car to the point where youre aiming at.

 

but now, i need to find a way to attach the object im shooting on the object where it collides.

 

So if i shoot the hook and it hits a traffic sign, i want it to be attached to the sign at the point where it hits it. and if possible, in the same rotation(but thats not so important)

 

is there a possibility to make that? im not good @ cleo-calculation so i need your help

 

sry for my bad english

Link to comment
Share on other sites

 

i need to find a way to attach the object im shooting on the object where it collides.

you can't attach an object to a building because it's not possible to get the reference of buildings for scripting

just remove the objects collision and the object stays at it's place

 

you need good scripting skills to make a grabbling hook

i wanna give you the start

 

so, aufgepasst

 

1. Objects which works for collisions-check with builings, ground, cars, peds and objects

2. throw object, collisions check

3. example script

 

 

1. Objects which works for collisions-check with builings, ground, cars, peds and objects

there are only a few objects which works for fully collisions check

the others can't check buildings and ground

below the useful objects:

 

ID number, model name, ide settings, behavior1598, beachball, beachball, 50, 128//standart collisionsfunction by default, explosion dynamical, throwable, collisionscheck,3065, BBALL_col, bballX, 30, 0//standart collisionsfunction by default, explosion dynamical, throwable, collisionscheck, damage to cars2891, kmb_packet, kmb_packet, 100, 0//standart collisionsfunction by default, explosion dynamical, throwable, collisionscheck, damage to cars3054, DYN_WREKING_BALL, BREAK_ballX, 100, 0//standart collisionsfunction by default, explosion dynamical, throwable, collisionscheck, damage to cars1305, dyn_quarryrock01, dynquarryrock, 100, 128//standart collisionsfunction by default, explosion dynamical, throwable, collisionscheck, damage to cars1582, pizzabox, prop_pizzabox, 40, 128//standart collisionsfunction by default, breakable instead explosion dynamical, throwable, collisionscheck

 

 

take the beachball or the basketball, they have settings in object.dat

you can add an object reference in object.dat if it still not exist there

with the same settings of BBALL_col to give your object the required behavior for full collisions check

 

 

2. throw object, collisions check

It needs to throw the object with 0381: throw_object

furthermore codes to activate collisions check and to make it movable

 

04D9: object [email protected] set_scripted_collision_check 1

 

0392: make_object [email protected] moveable 1

0381: throw_object [email protected] velocity_in_direction [email protected] [email protected] [email protected]

 

 

to get the values in throw_object opcode needs to read the player z-angle and calculate it with sin and cosin

 

 

3. script below throws the beachball which keeps position by collision for 1 second

press right mouse button throw

 

{$CLEO .cs}:Objectthrow_003A4: name_thread 'OTHROW'//1598, beachball, beachball, 50, 128//standart collisionsfunction by default, explosion dynamical, throwable, collisionscheck,//3065, BBALL_col, bballX, 30, 0//standart collisionsfunction by default, explosion dynamical, throwable, collisionscheck, damage to cars//2891, kmb_packet, kmb_packet, 100, 0//standart collisionsfunction by default, explosion dynamical, throwable, collisionscheck, damage to cars//3054, DYN_WREKING_BALL, BREAK_ballX, 100, 0//standart collisionsfunction by default, explosion dynamical, throwable, collisionscheck, damage to cars//1305, dyn_quarryrock01, dynquarryrock, 100, 128//standart collisionsfunction by default, explosion dynamical, throwable, collisionscheck, damage to cars//1582, pizzabox, prop_pizzabox, 40, 128//standart collisionsfunction by default, breakable instead explosion dynamical, throwable, collisionscheck:Objectthrow_1wait  0 msif0256: player $PLAYER_CHAR defined004D: jump_if_false @Objectthrow_1if0AB0:   key_pressed 2//-----------------------------press right mouse button004D: jump_if_false @Objectthrow_10247: request_model 1598:Objectthrow_3wait  0 msif0248:   model 1598  available004D: jump_if_false @Objectthrow_304C4: create_coordinate [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR offset  0.0 2.0  0.50107: [email protected] = create_object 1598  at  [email protected] [email protected] [email protected]: set_object [email protected] visibility 1 04D9: object [email protected] set_scripted_collision_check 1 0382: set_object [email protected] collision_detection 1 0906: set_object [email protected] mass_to 30000.0 // float 0908: set_object [email protected] turn_mass_to 30000.0 // float0172: [email protected] = actor $PLAYER_ACTOR Z_angle0453: set_object [email protected] XY_rotation 0.0 0.0 angle [email protected] 02F6: [email protected] = sine [email protected] // (float) 02F7: [email protected] = cosine [email protected] // (float) [email protected] *= 60.0 // (float) [email protected] *= 60.0 // (float) [email protected] *= -1.0 0819: [email protected] = actor $PLAYER_ACTOR [email protected] += 3.0 // (float) 0392: make_object [email protected] moveable 1 0381: throw_object [email protected] velocity_in_direction [email protected] [email protected] [email protected]@ = 0:Objectthrow_5wait  0 msif0256: player $PLAYER_CHAR defined004D: jump_if_false @Objectthrow_130400: store_coords_to [email protected] [email protected] [email protected] from_object [email protected] with_offset 0.0 -2.0 0.00381: throw_object [email protected] velocity_in_direction [email protected] [email protected] [email protected] or04DA:   has_object [email protected] collided 8474:   not actor $PLAYER_ACTOR near_object_in_cube [email protected] radius 200.0 200.0 200.0 flag 0 0019:   [email protected] > 7000 004D: jump_if_false @Objectthrow_50392: make_object [email protected] moveable 00382: set_object [email protected] collision_detection 000A1: put_actor $PLAYER_ACTOR at [email protected] [email protected] [email protected] wait  1000 ms0392: make_object [email protected] moveable 10382: set_object [email protected] collision_detection 1wait  1000 ms:Objectthrow_130465: remove_actor $PLAYER_ACTOR from_turret_mode0792: disembark_instantly_actor $PLAYER_ACTOR0108: destroy_object [email protected]: release_model 15980002: jump @Objectthrow_1

 

Link to comment
Share on other sites

wow, thanks this is awesome!

as soon as i get the time, ill test it. i already got a way to aim.

 

I attach the cam to the back of the car and make it look to a point, 7meters behind the car, then i can change that points coords with the arrow keys.

 

I have planned two parts of that script. One way, that uses the hook to stop the car and another way to kinda "drag" other cars or dynamic objects. And I already got an idea how this could work.

 

Thanks for your help smile.gif

 

I will post other questions here if there will be some.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

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