Hello everyone!
I am Automan, I made the Misterix mod, Gundam and other.
I should contact Mr Albreht , in order to complete my tutorial. Can someone help me? Many thanks!
vvvvvvvvvvvvv
For this tutorial I based on a Cleo script Albreht:
With Cleo script we can only handle rotation doors.
They are considered doors also bonnet and boot, more precisely defined components.
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:
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:
link: http://postimg.org/image/mqczxolzx/
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.
link: http://postimg.org/image/gnshyzs41/
Unfortunately, instead of seeking the 3rd 3D mesh, we should look for the 4th!
Our hierarchy will therefore be made necessarily so:
link: http://postimg.org/image/6g4tdwxif/
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:
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:
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:
link: http://postimg.org/image/e1ug3zvq5/
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 first 3D mesh, I hope to find soon the 4th 3D mesh in structure of the memory game!
I am Automan, I made the Misterix mod, Gundam and other.
I should contact Mr Albreht , in order to complete my tutorial. Can someone help me? Many thanks!
vvvvvvvvvvvvv
For this tutorial I based on a Cleo script Albreht:
With Cleo script we can only handle rotation doors.
They are considered doors also bonnet and boot, more precisely defined components.
- Code:
08A6: set_car 0@ componentA 4 rotation_to 0.0 // close, 0°
08A6: set_car 0@ componentA 4 rotation_to 1.0 // open, ~45° boot/bonnet, ~ 80° doors.
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:
- Code:
0AA6: call_method 5878048 struct 31@ num_params 3 pop 0 0.0 0.0 0.0
- Code:
0A97: 31@ = car 26@ struct
31@ += 1612
0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0
if
not 31@ == 0
else_jump @MB_SL_R_514 // Actor is in car?
31@ += 152
0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0
if
not 31@ == 0
else_jump @MB_SL_R_514 // Actor is in car?
31@ += 16 // 2° 3D mesh.
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:
link: http://postimg.org/image/mqczxolzx/
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.
link: http://postimg.org/image/gnshyzs41/
Unfortunately, instead of seeking the 3rd 3D mesh, we should look for the 4th!
Our hierarchy will therefore be made necessarily so:
link: http://postimg.org/image/6g4tdwxif/
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:
- Code:
:MB_SL_R_261
095F: get_car 26@ door 5 angle_to 12@
if
not 12@ == 0.0
else_jump @MB_SL_R_514 // Actor is in car?
0AA6: call_method 5878048 struct 31@ num_params 3 pop 0 0.0 0.0 0.0
31@ += 48
0A8C: write_memory 31@ size 4 value 0.1 virtual_protect 0 // transverse +0.1 meter
31@ += 4
0A8C: write_memory 31@ size 4 value -0.1 virtual_protect 0 // lateral -1.0 meter
wait 1
0A8C: write_memory 31@ size 4 value -0.3 virtual_protect 0 // lateral -1.0 meter
wait 1
0A8C: write_memory 31@ size 4 value -0.5 virtual_protect 0 // lateral -1.0 meter
wait 1
0A8C: write_memory 31@ size 4 value -0.7 virtual_protect 0 // lateral -1.0 meter
wait 1
0A8C: write_memory 31@ size 4 value -1.0 virtual_protect 0 // lateral -1.0 meter
31@ += 4
0A8C: write_memory 31@ size 4 value 0.0 virtual_protect 0 // vertical NOT
31@ -= 56
//----------------
:MB_SL_R_262
wait 0
095F: get_car 26@ door 5 angle_to 12@
if
12@ == 0.0
else_jump @MB_SL_R_262
0AA6: call_method 5878048 struct 31@ num_params 3 pop 0 0.0 0.0 0.0
31@ += 52
0A8C: write_memory 31@ size 4 value -0.7 virtual_protect 0 // lateral 0 meter
wait 1
0A8C: write_memory 31@ size 4 value -0.5 virtual_protect 0 // lateral 0 meter
wait 1
0A8C: write_memory 31@ size 4 value -0.3 virtual_protect 0 // lateral 0 meter
wait 1
0A8C: write_memory 31@ size 4 value -0.1 virtual_protect 0 // lateral 0 meter
wait 1
0A8C: write_memory 31@ size 4 value 0.0 virtual_protect 0 // lateral 0 meter
31@ -= 4
0A8C: write_memory 31@ size 4 value 0.0 virtual_protect 0 // transverse 0 meter
31@ += 8
0A8C: write_memory 31@ size 4 value 0.0 virtual_protect 0 // vertical NOT
31@ -= 56
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:
- Code:
else_jump @MB_SL_R_514 // Actor is in car?
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:
link: http://postimg.org/image/e1ug3zvq5/
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 first 3D mesh, I hope to find soon the 4th 3D mesh in structure of the memory game!
- Code:
{$CLEO .cs}
thread 'MB_SLIDE_DOOR_R'
:MB_SL_R_19
wait 0
if and
056D: actor $PLAYER_ACTOR defined
Player.Defined($PLAYER_CHAR)
else_jump @MB_SL_R_19
0A8D: 27@ = read_memory 12010644 size 4 virtual_protect 0
27@ += 4
0A8D: 27@ = read_memory 27@ size 4 virtual_protect 0
28@ = 0
//----------------
:MB_SL_R_91
0A8D: 26@ = read_memory 27@ size 1 virtual_protect 0
27@ += 1
if and
26@ >= 0
128 > 26@
else_jump @MB_SL_R_514
005A: 26@ += 28@ // (int)
if
Car.Model(26@) == #MOONBEAM
else_jump @MB_SL_R_514
//=====================================
0A97: 31@ = car 26@ struct
31@ += 1612
0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0
if
not 31@ == 0
else_jump @MB_SL_R_514
31@ += 152
0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0
if
not 31@ == 0
else_jump @MB_SL_R_514
31@ += 16 // 2° 3D mesh.
//=====================================
:MB_SL_R_261
095F: get_car 26@ door 5 angle_to 12@
if
not 12@ == 0.0
else_jump @MB_SL_R_514
0AA6: call_method 5878048 struct 31@ num_params 3 pop 0 0.0 0.0 0.0
31@ += 48
0A8C: write_memory 31@ size 4 value 0.1 virtual_protect 0 // transverse +0.1 meter
31@ += 4
0A8C: write_memory 31@ size 4 value -0.1 virtual_protect 0 // lateral -1.0 meter
wait 1
0A8C: write_memory 31@ size 4 value -0.3 virtual_protect 0 // lateral -1.0 meter
wait 1
0A8C: write_memory 31@ size 4 value -0.5 virtual_protect 0 // lateral -1.0 meter
wait 1
0A8C: write_memory 31@ size 4 value -0.7 virtual_protect 0 // lateral -1.0 meter
wait 1
0A8C: write_memory 31@ size 4 value -1.0 virtual_protect 0 // lateral -1.0 meter
31@ += 4
0A8C: write_memory 31@ size 4 value 0.0 virtual_protect 0 // vertical NOT
31@ -= 56
//----------------
:MB_SL_R_262
wait 0
095F: get_car 26@ door 5 angle_to 12@
if
12@ == 0.0
else_jump @MB_SL_R_262
0AA6: call_method 5878048 struct 31@ num_params 3 pop 0 0.0 0.0 0.0
31@ += 52
0A8C: write_memory 31@ size 4 value -0.7 virtual_protect 0 // lateral 0 meter
wait 1
0A8C: write_memory 31@ size 4 value -0.5 virtual_protect 0 // lateral 0 meter
wait 1
0A8C: write_memory 31@ size 4 value -0.3 virtual_protect 0 // lateral 0 meter
wait 1
0A8C: write_memory 31@ size 4 value -0.1 virtual_protect 0 // lateral 0 meter
wait 1
0A8C: write_memory 31@ size 4 value 0.0 virtual_protect 0 // lateral 0 meter
31@ -= 4
0A8C: write_memory 31@ size 4 value 0.0 virtual_protect 0 // transverse 0 meter
31@ += 8
0A8C: write_memory 31@ size 4 value 0.0 virtual_protect 0 // vertical NOT
31@ -= 56
//=====================================
:MB_SL_R_514
28@ += 256
28@ > 35584
else_jump @MB_SL_R_91
jump @MB_SL_R_19