An Advanced Guide to Map Editor / Joints |
Holomouse « Citoyen » 1359761520000
| 1 | ||
Foreword: A huge thank you goes to Tuliomumic for letting me use some of his stuff and Rype for being of great help to understanding the joints. Joints are one of the most important and interesting parts of the Map Editor. In this thread, I will attempt to explain all of the joint types and different things you can create with them. If you'd like something being made or you're having problems with any of your maps with joints, simply post below and I'll try to answer your question. Before starting with explaining the joints, you should understand where to add the joints. Adding joints can be done only manually by editing the XML. To add them, you need the <L> and </L> tags. Simply add the both of them after the object tag <O />, or before the </Z> one. Between <L> and </L> tags you will list all the possible joints. Example: A basic connection with the JD joint a dit : --------------------------------------------------------------- • Default Values These are default values that can be used for all joints. Format: <J? M1="A" M2="B" P1="Xa,Ya" P2="Xb,Yb" c="color,thickness,alpha,foreground" /> J? = Here specify the type of the joint. Currently there are four known ones JD, JP, JR and JPL. M1 = First ground you pick. The joint is made by specifying the Z value of the ground you want to link. M2 = A second ground to pick to make the joint work. P1 = A point in M1 to specify the coordinates of the first link. Xa,Ya values are x;y coordinates in the map. P2 = A point in M2 to specify the second link. The point can be outside the ground mass. c="color,thickness,alpha,foreground" = Joint color. - color = the hex value (19526E for example) - thickness, max value = 255 - alpha is on a range from 0 to 1. (0.5 for half transparency) - foreground = 1 or 0 Example: [quote=The example below shows the use of point coordinates(P1/2) and the color parameter.] <C> <P /> <Z> <S> <S Y="390" T="12" P="0,0,0.3,0.2,0,0,0,0" L="800" o="324650" X="400" H="40" /> <S Y="340" T="12" P="1,0,0.3,0.2,0,0,0,0" L="60" o="5b87" X="250" H="60" /> <S Y="340" T="12" P="1,0,0.3,0.2,0,0,0,0" L="60" o="7b1336" X="550" H="60" /> </S> <D /> <O /> <L> <JD M1="1" M2="2" c="C5C0BB,20,1,0" /> <JD M1="1" M2="2" P1="270,360" P2="530,360" c="0A8C7D,30,0.4,1" /> </L> </Z> </C> [/quote] --------------------------------------------------------------- • JD - Distance Joint Distance joint links two grounds together with a rigid connection that maintains the distance between them. Each ground is free to rotate around the connection points. Format: <JD M1="A" M2="B" HZ="x" AMP="y" /> HZ = Oscillation frequency, low values will make it oscillate slowly and the joint will be more elastic. The higher the value is, the tighter the joint will be. AMP = Oscillation damp. Used along with HZ, it damps the oscillation to a fast/slow equilibrium. The higher this value, the harder the joint will oscillate back and forth. Example: [quote=JD example, HZ makes the joint elastic.] <C> <P /> <Z> <S> <S Y="390" T="12" P="0,0,0.3,0.2,0,0,0,0" L="800" o="324650" X="400" H="40" /> <S Y="100" T="12" P="1,-1,0.3,0.2,0,0,0,0" L="80" o="5b87" X="400" H="20" /> <S Y="300" T="12" P="1,0,0.3,0.2,0,1,0,0" L="60" o="7b1336" X="400" H="60" /> </S> <D /> <O> <O Y="120" P="0,1" X="410" C="10" /> </O> <L> <JD HZ="1" AMP="5" M1="1" M2="2" c="000000,5,0.1,0" /> </L> </Z> </C> [/quote] --------------------------------------------------------------- • JP - Prismatic Joint The prismatic joint is probably more commonly known as a slider joint. The two joined grounds have their rotation held fixed relative to each other, and they can only move along a specified axis. Prismatic joints can be given limits so that the grounds can only move along the axis within a specific range. They can also be given a motor so that the grounds will try to move at a given speed, with a given force Format: <JP M1="A" M2="B" AXIS="x,y" MV="P,V" LIM1="value" LIM2="value" A="value" /> AXIS = Axis that the joint will move LIM1 = Lower limit. Restricts movement in a given point of the opposite direction in the AXIS. LIM2 = Upper limit. Restricts movement in a given point along the direction of the AXIS. MV = Motor, will only work if there is an AXIS. - P = Power (motor strength) - The higher the strength value, the less the possibility to stop the motors movement. - V = Velocity (motor speed) - Negative value will make it move in the opposite direction. A = Angle difference between two grounds so they can keep synchronized without glitching. The value is given in radians. The A(angle difference) when not specified is automatically set to 0 by default. This will make the grounds have the same rotation however much you rotate them in editor. AXIS Guide |---------|---------|---------| | | | | | -1,1 | 0,1 | 1,1 | | | | | |---------|---------|---------| | | | | | -1,0 | 0,0 | 1,0 | | | | | |---------|---------|---------| | | | | | -1,-1 | 0,-1 | 1,-1 | | | | | |---------|---------|---------| JP Limit Values (for 1 unit the ground moves by 30 pixels only): 10px = 0.3333 20px = 0.6666 30px = 1 40px = 1.3333 50px = 1.6666 60px = 2 70px = 2.3333 80px = 2.6666 90px = 3 100px = 3.3333 200px = 6.6666 300px = 10 400px = 13.3333 500px = 16.6666 Example: [quote=JP example. The limit makes the ground stop at about 150px length and using a low motor power strength, when you step on the ground it goes down and back up if you step off it.] <C> <P /> <Z> <S> <S Y="395" T="12" P="0,0,0.3,0.2,0,0,0,0" L="800" o="324650" X="400" H="40" /> <S Y="335" T="12" P="1,-1,0.3,0.2,0,0,0,0" L="100" o="3752" X="400" H="80" /> <S Y="335" T="12" P="1,10,0.3,0.2,0,1,0,0" c="1" L="20" o="3752" X="465" H="80" /> <S Y="195" T="12" P="0,0,0.3,0.2,0,0,0,0" L="280" o="324650" X="300" H="40" /> </S> <D> <DS Y="160" X="330" /> <F Y="170" X="390" /> </D> <O /> <L> <JP M1="1" M2="2" AXIS="0,-1" MV="500,2" LIM2="5" /> </L> </Z> </C> [/quote] --------------------------------------------------------------- • JR - Revolute Joint Revolute joints can be used to create rotating joints (aka motors). You can place angular limits to stop the rotation movement at a point. Format: <JR M1="A" M2="B" MV="P,V" LIM1="value" LIM2="value" /> LIM1 = Lower limit. Restricts rotation anticlockwise the motion. LIM2 = Upper limit. Restricts rotation clockwise the motion. MV = Rotating motor. - P = Power (motor strength) - The higher the strength value, the less the possibility to stop the motors movement. - V = Velocity (motor speed) - Negative value will make it spin in the opposite direction. Observation *If you don't put P1 or P2 in a JR, the "anchor" will be set to the core of M2. JR Limit Values (value in radians): 5° = 0.0873 10° = 0.1745 15° = 0.2618 20° = 0.3491 25° = 0.4363 30° = 0.5236 45° = 0.7854 60° = 1.0572 90° = 1.5708 135° = 2.3562 180° = 3.1416 270° = 5.7124 360º = 6.2832 Or you can find the specific value about any angle here http://mathsolutions.50webs.com/degrad.html Example: [quote=JR example. The limit makes the ground stop at about 135 degrees. I specified LIM2 as the upper limit to make it stop clockwise. LIM1 is auto specified as 0 or where the ground begins it's movement, so there's no need specifying it, unless you want the ground to stop further backwards.] <C> <P /> <Z> <S> <S Y="390" T="12" P="0,0,0.3,0.2,0,0,0,0" L="800" o="324650" X="400" H="30" /> <S Y="180" T="12" P="0,0,0.3,0.2,0,0,0,0" H="10" L="10" o="53d5a" X="400" c="4" /> <S Y="225" T="12" P="1,0,0.3,0.2,0,0,0,0" H="180" L="40" o="53d5a" X="400" c="1" /> </S> <D> <T Y="375" X="163" /> </D> <O /> <L> <JR MV="50000,2" LIM2="2.35" M1="2" M2="1" /> </L> </Z> </C> [/quote] --------------------------------------------------------------- • JPL - Pulley Joint Pulley joint, as the name suggests it is used for creating a pulley system. You can specify a ratio of how far one side changes compared to the other. Format: <JPL M1="A" M2="B" P3="x,y" P4="x,y" R="value" /> P3 = A point you will pick in the map to link the first ground or a point of it P4 = A point you will pick in the map to link the second ground or a point of it R = Constraint strength ratio, R="1" is the default value and will keep grounds in place. If R="0.1" means that the constraint binding M2 to P4 will be 10 times weaker than the one uniting M1 with P3. Alternatively, R="2" means that M1 will be weaker compared to M2. Example: [quote=JPL example. A normal pulley. The contraint parameter(R) makes the M2 ground fall down. To keep things even, simply remove it.] <C> <P /> <Z> <S> <S Y="390" T="12" P="0,0,0.3,0.2,0,0,0,0" L="800" o="324650" X="400" H="40" /> <S Y="200" T="12" P="1,0,0.3,0.2,0,1,0,0" L="40" o="5b87" X="300" H="40" /> <S Y="200" T="12" P="1,0,0.3,0.2,0,1,0,0" L="40" o="7b1336" X="500" H="40" /> </S> <D> <T Y="370" X="400" /> </D> <O /> <L> <JPL M1="1" P3="300,100" M2="2" P4="500,100" R="0.5" c="000000,5,1,0" /> </L> </Z> </C> [/quote] --------------------------------------------------------------- • Other Stuff - If there's no M1/M2 or only one of them specified in the joint, the unspecified M1/M2 will be auto linked to the ground with the 0 Z-value. This is why when trying to show line art, the line art will not show if there's no ground in the map! - If one of the M1/M2 grounds is a static one and the other ground dynamic, the dynamic ground will pass through other grounds, but stop when hit by mice or shaman objects. To stop this, simply make the static ground negative mass. • Helpful threads: Viprin's Drawing Editor! - Topic-162564 ImpureDeath's Mapeditor Tutorial Videos - Topic-22 Color Joint Generator - Topic-207930 |
Holomouse « Citoyen » 1359761520000
| 0 | ||
Reserved for more cool stuff. Will add various XML examples here. |
0 | ||
Holomouse a dit : Why not share the formulas to calculate these instead of a predefined set of degrees? Since it looks like it's just pi, x/360*Math.PI/180 |
Holomouse « Citoyen » 1359762000000
| 0 | ||
Yeah, sorry, forgot to explain that. :P It's just the radian value of the degrees. Will add that when I revamp the guide. |
Juliiien « Citoyen » 1359775200000
| 0 | ||
Nice ! Thanks Holo ! |
Mumich « Citoyen » 1359775980000
| 0 | ||
I just made that values since they are "useful values", but there are some nice radians converters in the internet, like this one: http://mathsolutions.50webs.com/degrad.html, you could list it Holo. You will also need to fix the Axis Guide Another thing that was wrong in my files that I already fixed: A = Angle difference between two grounds so they can keep synchronized without glitching. The value must be used in radians Should be in Prismatic, not in Revolute |
Arthiola « Citoyen » 1359778380000
| 0 | ||
Nice thread Holo :D |
Anaqizxc « Citoyen » 1359810900000
| 0 | ||
Nicee !! Good Job Holo :D |
Holomouse « Citoyen » 1359811320000
| 0 | ||
Thanks! Added/fixed some small stuff. Wow Tulio, I trusted you! I thought A="" was for other joints as well, so left it there. :P |
0 | ||
All this mathematical talk makes me feel like a bigfatnib. But it halped so thanks qtest Holochie~ |
Deadlag « Citoyen » 1359909960000
| 0 | ||
Great guide! The examples would help so much a noob like myself. |
Holomouse « Citoyen » 1360363380000
| 0 | ||
Added examples! Some feedback on them would be appreciated. :P Will going to add some quick joint contraptions/mechanism you can do with joints in the second post soon. |
Lupersinio « Citoyen » 1360364160000
| 0 | ||
Nice Holo!! |
Mousechris « Censeur » 1360385520000
| 0 | ||
This is very understandable for me, great job holo :) |
0 | ||
We all love Holo |
0 | ||
Holo, very useful guide. But you forgot about P1="x1,y1" and P2="x2,y2" for <JPL>,<JD> and <JR> |
Tomciogol « Citoyen » 1360526040000
| 0 | ||
Still don't get it ;-; |
Holomouse « Citoyen » 1360532820000
| 0 | ||
P1/P2 is practically the same for every joint. But will try to explain things more in depth. Still there are alot of things to cover just a busy period for me right now. :x Tomciogol, try to load the xml's in editor and play around with them. |
Tomciogol « Citoyen » 1360785480000
| 0 | ||
How to make boosters ? I am trying to make them but it doesn't work. Could you give a xml of it ? Please |
Holomouse « Citoyen » 1360858980000
| 0 | ||
Tomciogol a dit : Lots of ways to make them. :P Impure has some nice tutorials if you follow carefully. Some basic xml's to make them with joints: http://tny.cz/2bd54b2e This is a horizontal right treadmill. To make it go the other way, simply change the speed value in MV to negative. To make it go upwards, change the axis to AXIS="0,1" You should block the way the ground moves with another ground, but it shouldnt be too close together else it won't work. Also, last things, always link it to a negative mass ground to keep it in place and the strength of the treadmill is based on it's friction, so change that according to your likes. Hope this helped you a bit. ^^ As said above, there are tons of other ways to make a treadmill. Also there's a new way to make boosters that speed you up with the new update. Downside is that they're only used once. Will edit in my post above how to make these a bit later. |