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. Forum Support

    3. Suggestions

[SA|TUT|WIP] Sliding Doors (with ZM2)


AVTOMAN
 Share

Recommended Posts

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 -Bonnet
1 - Boot
2 - Left Front Door
3 - Right Front Door
4 - Left Rear Door
5 - 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:
fig1.jpg
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.
fig2.jpg
Unfortunately, instead of seeking the 3rd 3D mesh, we should look for the 4th! XD
.
Our hierarchy will therefore be made necessarily so:
fig3.jpg
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! XD
As 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:
fig4.jpg
.
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
  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

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

  • 2 weeks later...

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

Nathan Ferdinand

Let me explain how those things work:

 

BEFORE:

gta_sa2015-12-2912-07kpsrp.png

 

IN PROCESS:

gta_sa2015-12-2912-073wsyf.png

 

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:

gta_sa2015-12-2912-0699sy6.png

 

Later, I will send you an example model containing this sliding door method.

Link to comment
Share on other sites

  • 2 weeks later...
ngr_ardiansyah

is it possible for koenigsegg style doors? (rotating while moving to side and forward)

Link to comment
Share on other sites

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

  • 1 year later...

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.