AVTOMAN Posted December 10, 2015 Share Posted December 10, 2015 For this tutorial I based on a script Albreht:http://gtaforums.com/user/631482-albreht/which I think is no longer active... .With Cleo script we can only handle rotation doors.They are considered doors also bonnet and boot, more precisely defined components. 08A6: set_car [email protected] componentA 4 rotation_to 0.0 // close, 0°08A6: set_car [email protected] componentA 4 rotation_to 1.0 // open, ~45° boot/bonnet, ~ 80° doors. The list of components is:0 -Bonnet1 - Boot2 - Left Front Door3 - Right Front Door4 - Left Rear Door5 - Right Rear Door.We are interested only component 4 and 5. The rear doors.The concept is to have a component 3D mesh in the 3D file .dff, to move instead of rotating.Since it can not begin working classics, using a method that acts directly on the memory of the game: 0AA6: call_method 5878048 struct [email protected] num_params 3 pop 0 0.0 0.0 0.0 The component [email protected] must look for it, and honestly this part of me is still obscure: 0A97: [email protected] = car [email protected] [email protected] += 16120A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0if not [email protected] == 0else_jump @MB_SL_R_514 // Actor is in [email protected] += 1520A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0if not [email protected] == 0else_jump @MB_SL_R_514 // Actor is in [email protected] += 16 // 2° 3D mesh. As we indicated, in our case is the 2# 3D mesh in the file .dff, immediately after the 3D chassis..I must say that in any case our 3D mesh will not be any, but the rear doors themselves. Why?!...Because ZM2 sides with glass are always an issue, unfortunately!Not only that, the part with the glass must be separated from the rest, and put in a parent/child relationship in the hierarchy:There is another problem, even if this does not occur with a non-standard 3D mesh. If the model has an extra heavy, about 10,000 polygons, this will not be seen through the glass....Sometimes we are lucky, and in this case moving the 3D mesh parent also will move the 3D mesh child.Unfortunately, instead of seeking the 3rd 3D mesh, we should look for the 4th! XD.Our hierarchy will therefore be made necessarily so:Why 3D doors are not within their dummy? ...Because otherwise the program would rotate them and they would move at the same time.Why then the doors dummies are the same?Because else peds would not know where to go! It is important that the doors dummies are positioned correctly on the basis of 3D doors, otherwise peds have also problems to enter in the vehicle...Where do they place the Axes of 3D doors? At the center, "Reset to the World."This is because the scripts of movement start from there, and the place still Axes 3D doors of the center..Manage the movement of 3D doors is simple. I added the effect of the movement, instead of moving only: :MB_SL_R_261095F: get_car [email protected] door 5 angle_to [email protected] not [email protected] == 0.0else_jump @MB_SL_R_514 // Actor is in car?0AA6: call_method 5878048 struct [email protected] num_params 3 pop 0 0.0 0.0 0.0 [email protected] += 480A8C: write_memory [email protected] size 4 value 0.1 virtual_protect 0 // transverse +0.1 [email protected] += 40A8C: write_memory [email protected] size 4 value -0.1 virtual_protect 0 // lateral -1.0 meterwait 10A8C: write_memory [email protected] size 4 value -0.3 virtual_protect 0 // lateral -1.0 meterwait 10A8C: write_memory [email protected] size 4 value -0.5 virtual_protect 0 // lateral -1.0 meterwait 10A8C: write_memory [email protected] size 4 value -0.7 virtual_protect 0 // lateral -1.0 meterwait 10A8C: write_memory [email protected] size 4 value -1.0 virtual_protect 0 // lateral -1.0 [email protected] += 40A8C: write_memory [email protected] size 4 value 0.0 virtual_protect 0 // vertical [email protected] -= 56//----------------:MB_SL_R_262wait 0095F: get_car [email protected] door 5 angle_to [email protected] [email protected] == 0.0else_jump @MB_SL_R_2620AA6: call_method 5878048 struct [email protected] num_params 3 pop 0 0.0 0.0 0.0 [email protected] += 520A8C: write_memory [email protected] size 4 value -0.7 virtual_protect 0 // lateral 0 meterwait 10A8C: write_memory [email protected] size 4 value -0.5 virtual_protect 0 // lateral 0 meterwait 10A8C: write_memory [email protected] size 4 value -0.3 virtual_protect 0 // lateral 0 meterwait 10A8C: write_memory [email protected] size 4 value -0.1 virtual_protect 0 // lateral 0 meterwait 10A8C: write_memory [email protected] size 4 value 0.0 virtual_protect 0 // lateral 0 [email protected] -= 40A8C: write_memory [email protected] size 4 value 0.0 virtual_protect 0 // transverse 0 [email protected] += 80A8C: write_memory [email protected] size 4 value 0.0 virtual_protect 0 // vertical [email protected] -= 56 When the door is opened, the angle is not more than zero, and the door is moved.When closed, the angle returns to zero, and the door reverses.This happens as a result, and no matter whether the ped goes up or down.The control: else_jump @MB_SL_R_514 // Actor is in car? only it serves to open the door. Especially if the car exploded when everyone is still inside! XDAs shown the movement is simple to guess; transverse movement is in a single solution by 0.1 meters. That lateral is in 5 steep to 1.0 meters.Vertical not there. Obviously this depends on the position and size of the doors.To manage the correct offset:.It is appropriate to have two separate scripts, one for the left rear door and one for the right rear door.For now I can only handle a 3D mesh, I hope to find soon the 4th 3D mesh! {$CLEO .cs}thread 'MB_SLIDE_DOOR_R':MB_SL_R_19wait 0if and056D: actor $PLAYER_ACTOR defined Player.Defined($PLAYER_CHAR)else_jump @MB_SL_R_190A8D: [email protected] = read_memory 12010644 size 4 virtual_protect [email protected] += 40A8D: [email protected] = read_memory [email protected] size 4 virtual_protect [email protected] = 0//----------------:MB_SL_R_910A8D: [email protected] = read_memory [email protected] size 1 virtual_protect [email protected] += 1if and [email protected] >= 0 128 > [email protected]_jump @MB_SL_R_514005A: [email protected] += [email protected] // (int)if Car.Model([email protected]) == #MOONBEAMelse_jump @MB_SL_R_514//=====================================0A97: [email protected] = car [email protected] [email protected] += 16120A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0if not [email protected] == 0else_jump @[email protected] += 1520A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0if not [email protected] == 0else_jump @[email protected] += 16 // 2° 3D mesh.//=====================================:MB_SL_R_261095F: get_car [email protected] door 5 angle_to [email protected] not [email protected] == 0.0else_jump @MB_SL_R_5140AA6: call_method 5878048 struct [email protected] num_params 3 pop 0 0.0 0.0 0.0 [email protected] += 480A8C: write_memory [email protected] size 4 value 0.1 virtual_protect 0 // transverse +0.1 [email protected] += 40A8C: write_memory [email protected] size 4 value -0.1 virtual_protect 0 // lateral -1.0 meterwait 10A8C: write_memory [email protected] size 4 value -0.3 virtual_protect 0 // lateral -1.0 meterwait 10A8C: write_memory [email protected] size 4 value -0.5 virtual_protect 0 // lateral -1.0 meterwait 10A8C: write_memory [email protected] size 4 value -0.7 virtual_protect 0 // lateral -1.0 meterwait 10A8C: write_memory [email protected] size 4 value -1.0 virtual_protect 0 // lateral -1.0 [email protected] += 40A8C: write_memory [email protected] size 4 value 0.0 virtual_protect 0 // vertical [email protected] -= 56//----------------:MB_SL_R_262wait 0095F: get_car [email protected] door 5 angle_to [email protected] [email protected] == 0.0else_jump @MB_SL_R_2620AA6: call_method 5878048 struct [email protected] num_params 3 pop 0 0.0 0.0 0.0 [email protected] += 520A8C: write_memory [email protected] size 4 value -0.7 virtual_protect 0 // lateral 0 meterwait 10A8C: write_memory [email protected] size 4 value -0.5 virtual_protect 0 // lateral 0 meterwait 10A8C: write_memory [email protected] size 4 value -0.3 virtual_protect 0 // lateral 0 meterwait 10A8C: write_memory [email protected] size 4 value -0.1 virtual_protect 0 // lateral 0 meterwait 10A8C: write_memory [email protected] size 4 value 0.0 virtual_protect 0 // lateral 0 [email protected] -= 40A8C: write_memory [email protected] size 4 value 0.0 virtual_protect 0 // transverse 0 [email protected] += 80A8C: write_memory [email protected] size 4 value 0.0 virtual_protect 0 // vertical [email protected] -= 56//=====================================:[email protected] += 256 [email protected] > 35584else_jump @MB_SL_R_91jump @MB_SL_R_19 Norway-_-1999 1 Link to comment Share on other sites More sharing options...
El'azar Posted December 19, 2015 Share Posted December 19, 2015 sliding doors will be very useful in my vehicle conversions but i dont understand anything said here xD :'( Link to comment Share on other sites More sharing options...
AVTOMAN Posted December 20, 2015 Author Share Posted December 20, 2015 Nothing is a bit too much, I can just quote all! X( X( X( Link to comment Share on other sites More sharing options...
Nathan Ferdinand Posted December 29, 2015 Share Posted December 29, 2015 You don't actually need those scripts to make the sliding doors work. Izerli has those scripts to make everything work: https://youtu.be/LKevmJ36vaI Link to comment Share on other sites More sharing options...
AVTOMAN Posted December 29, 2015 Author Share Posted December 29, 2015 Thanks! As I said there are four issues that are not taken into account in the other mod:1) Sliding door of a single door.2) With ZM2 must have the 3D door glasses separate.3) Not must be the player to activate the door, but the Ped entering by car.4) The displacement must not be instantaneous.Unfortunately I can not see the video until December 31, and I do not know if the model shown satisfies these four points. Link to comment Share on other sites More sharing options...
Nathan Ferdinand Posted December 29, 2015 Share Posted December 29, 2015 Let me explain how those things work: BEFORE: IN PROCESS: Explanation: glass is attached to the door, because the door part must be a single mesh, and damaged parts won't work with this. The glass is transparent. AFTER: Later, I will send you an example model containing this sliding door method. Link to comment Share on other sites More sharing options...
AVTOMAN Posted December 29, 2015 Author Share Posted December 29, 2015 Mmm ... Step 3 is not satisfied! Link to comment Share on other sites More sharing options...
ngr_ardiansyah Posted January 11, 2016 Share Posted January 11, 2016 is it possible for koenigsegg style doors? (rotating while moving to side and forward) Link to comment Share on other sites More sharing options...
AVTOMAN Posted January 11, 2016 Author Share Posted January 11, 2016 Yes, it is possible. My master Wesser made a script for the sliding doors, but always open from Player. The interesting thing is that it uses the component door_xx_ok, so if control passes to the opening program, intercepting when the rotation is the same as or different from zero as in my script, the doors will be moved and rotated. No good for the only sliding doors, though, because they would always rotated. Link to comment Share on other sites More sharing options...
AVTOMAN Posted November 22, 2017 Author Share Posted November 22, 2017 New method for all rear doors: http://gtaforums.com/topic/899574-sareltut-sliding-doors/ For front doors, like koenigsegg, this opcode is needed: because as long as the player is not in the vehicle, the model is unavailable for manipulating its parts, with the current opcode.... Groza 1 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