Roflcake Posted November 8, 2010 Share Posted November 8, 2010 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 More sharing options...
ZAZ Posted November 8, 2010 Share Posted November 8, 2010 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 CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
Roflcake Posted November 8, 2010 Author Share Posted November 8, 2010 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 I will post other questions here if there will be some. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now