people playing: 307
servers online: 82
games played: 73,268,055

  Toribash Community » Toribash » Tutorials
Reply
 
Thread Tools Display Modes
Old Sep 29, 2009   #1
culapou
Elitist
 
Master Belt
Join Date: Dec 2007
Posts: 6,025



Weekly Mod Mini Tutorials (4:) Advanced Notepad Editing & Basic Body Editing
Week 1, Basic Making and Saving
Week 2, Advanced Worldbuilder and Basic Notepad
Week 3, Intermediate Notepad Editing
Week 4, Advanced Notepad & Basic Body Editing

Make sure to read previous tutorials before this one!

Week 4- Advanced Notepad & Basic Body Editing


Starting
-Ok, so today we will be learning about more env_obj_joint options, most importantly make it rotate.
-Lets open toribash and start worldbuilder as usual, to demonstrate how rotation on an obj_joint works I will make a bike with wheels that will eventually turn.
-I made the bike body a bit heavier so it wont flip over.
-I also made a ramp for more fun:

-Right now this is a bit unevenly matched, tori can just roll all over uke, we will change this in a bit.
-Save the mod and grab it from your scripts folder and load it up in notepad.
-DON'T UNLOAD WORLDBUILDER

Obj_Joint Placement
-The ramp is static, so I wont need to joint those together, but I need to joint the dynamic bike together
-One shortcut for this is to make a small circular object in worldbuilder and then place it where you want to joint to be located:

-Now I can copy the location from the information pallete on the right side of my screen and put it under my object joint layout:

env_obj_joint 1 1 4
pos 1 9.125 2
visible 1

-So, this is my first object joint, the bike body is object one, and the handlebar is object 4, so I write the position, and I want it visible this time. (By default it is invisible)
-Now, since I want my wheels to rotate around an "axle" in this case my obj_joint, I will put the joint on the same position as the wheel:

env_obj_joint 2 1 2
pos 1 9 0.3125

env_obj_joint 3 1 3
pos 1 10.875 0.3125

Joint Rotation
-Ok, now to make my wheels rotate, this is what I will write under the env_obj_joint 2 and 3:

env_obj_joint 2 1 2
pos 1 9 0.3125
axis -1 0 0
range 5 -5
strength 1.3
velocity 80

env_obj_joint 3 1 3
pos 1 10.875 0.3125
axis -1 0 0
range 5 -5
strength 1.3
velocity 80

-Ok, we already know what the stuff on the same line as the env_obj_joint means, and what pos means, but other stuff is confusing:

Axis: Is the way the wheel will turn, I want it to go forward, so I have to change the X axis, and it goes towards the center of the toriworld, so I need to Lower it towards zero, that's why it's -1. (If it was uke it would be positive 1)

Range: Is how much freedom the joint has to move, the numbers are a bit confusing to explain, but 5 -5 is no joint restriction 4 -4 is little joint restriction, etc. You can use decimals, and if you where to make a whip like object you would have something like 3 -3

Strength: This is hard to explain, but is very similar to velocity. Strength is like how fast it can reach it's maximum speed, 1.3 is rather low, so it will take a longer time to speed up, this prevents it from flipping.

Velocity: This is sort of like how fast the joint will rotate, Strength and velocity work together. I believe both strength and velocity work only when an object is turning 360. (correct me if I am wrong)

-Ok, and that is all, now the wheels should turn when I load the mod.

Basic Body Modding
-Alright, as I said earlier, in this mod uke doesn't stand a chance, I will show some basic body modding options to help him out
-What I will do is get some empty space below the env_obj_joints, then type player1 on a new line
-What this will do is start an "information box" for every word bellow it, untill another information box is formed, (like an object information box, or joint information box, etc.)
-player0 is tori, and player1 is uke, so I will mod player1
-Under player1 I will write out different body parts, this is another information box, but it is a sub-category of the player1 information box, so it is ok.
-I will make uke's ankles stronger so he can jump really high, and make his body lighter so he can get even higher
-So under player1 I will write this:

player 1
joint r_ankle
velocity 90
strength 2

joint l_ankle
velocity 90
strength 2

body head
density .05

body r_hand
density .05

body l_hand
density .05

body r_triceps
density .05

body l_triceps
density .05

body r_biceps
density .05

body l_biceps
density .05

-Ok, so if you want to edit a joint you say joint, then the joint name, in this case I edited the l and r_ankles
-The velocity and thrust have the same properties as the env_joint, but this time they can be used without having to have full range
-I set very high velocity, and lowish force, this will propel me into the air, but cause tons of stress on my ankles, so I have to raise dismember threshold
-Now, If I want to edit a body part I do the same as what I did to edit a joint, but with body instead of joint, body l_biceps, etc.
-Density is used as the weight for body parts, and mass is used for environment objects, so under the body parts I will write density .05 to make them lighter, you can go as light or as heavy as possible, 50 is like stuck to the ground, and .005 is very very fast, and has no force exerted to the rest of the body
-There are more body options, and I will get to those in a later tutorial, but now our uke upgrade is finished, he can now jump like this:

-If you want you can give uke a weapon from what we learned in lesson 3

Finishing
We are done, save the mod and drag it into the mods folder, close worlduilder and play around with it.
You can use what you have learned today to make other interesting mods, such as a ferris wheel, or a fan and much more!
-Here is my final product:

-And this is what It looks like in notepad

# MotoBike by culapou
######################################


gamerule
ed 2000
eh 40
dt 220
tf 10,10,10,200,100,50,40,30,50,100,100
mf 800
dq 1

env_obj 1
shape box
pos 1 9.9375 1.1875
color 0 0.5 1.1 1.1
rot 0 0 0
sides 0.125 1.625 1
material steel
mass .5
flag 0
friction 0
#END 1

env_obj 2
shape sphere
pos 1 9 0.3125
color 0 -0.1 -0.1 1.1
rot 0 0 0
sides 0.3125 1.5625 1
material steel
mass 0.1
flag 0
#END 2

env_obj 3
shape sphere
pos 1 10.875 0.3125
color 0 -0.1 -0.1 1.1
rot 0 0 0
sides 0.3125 1.5625 1
material steel
mass 0.1
flag 0
#END 3

env_obj 4
shape box
pos 1 9.0625 2.25
color 0 -0.1 -0.1 1.1
rot 0 0 0
sides 0.8125 0.0625 0.125
material steel
mass 0.4
flag 0
#END 4

env_obj 5
shape box
pos 1 -1.4375 0.1875
color 0 -0.1 -0.1 1.1
rot -78 0 0
sides 2.8125 0.0625 1.9375
material steel
mass 0.1
flag 8
#END 5

env_obj 6
shape box
pos 1 -3.125 0.8125
color 0 -0.1 -0.1 1.1
rot -62 0 0
sides 2.8125 0.0625 1.9375
material steel
mass 0.1
flag 8
#END 6

env_obj 7
shape box
pos -0.375 -4.0625 0.5625
color 0 -0.1 -0.1 1.1
rot 0 90 -6
sides 1.4375 0.0625 0.125
material steel
mass 0.1
flag 8
#END 7

env_obj 8
shape box
pos 2.375 -4.0625 0.5625
color 0 -0.1 -0.1 1.1
rot 0 90 -6
sides 1.4375 0.0625 0.125
material steel
mass 0.1
flag 8
#END 8


env_obj_joint 1 1 4
pos 1 9.125 2
visible 1

env_obj_joint 2 1 2
pos 1 9 0.3125
axis -1 0 0
range 5 -5
strength 1.3
velocity 80

env_obj_joint 3 1 3
pos 1 10.875 0.3125
axis -1 0 0
range 5 -5
strength 1.3
velocity 80

player 1
joint r_ankle
velocity 90
strength 2

joint l_ankle
velocity 90
strength 2

body head
density .05

body r_hand
density .05

body l_hand
density .05

body r_triceps
density .05

body l_triceps
density .05

body r_biceps
density .05

body l_biceps
density .05



Have fun,
post your mods, comments, and questions here please!


Next week: Week 5: Weapons special
the god

Last edited by culapou; Sep 29, 2009 at 03:26 AM..
culapou is offline   Reply With Quote
Old Sep 29, 2009   #2
granate08
Senior Member
 
3rd Dan Black Belt
Join Date: Jul 2009
Posts: 1,047



Awesome tut like the other ones.

And can't wait for the Weapons special. ^^
granate08 is offline   Reply With Quote
Old Sep 29, 2009   #3
crux
Diamonds are not a joke
 
Custom Belt
Join Date: Jul 2007
Posts: 4,585



Very helpful tutorials. Helped me with some things I wasn't sure about.

Thanks cula.

Last edited by crux; Sep 29, 2009 at 03:52 PM..
crux is offline   Reply With Quote
Old Oct 2, 2009   #4
MrPoptart
letsmodtheworld
 
5th Dan Black Belt
Join Date: Mar 2007
Posts: 5,129
Clan: [T]



I believe both strength and velocity work only when an object is turning 360. (correct me if I am wrong)

It'l work regardless of the range. If the strength and velocity are very high, the joint will just move very fast until it hits it's maximum or minimum range then stop. An example would be uke or tori's joints, which aren't 360, but have the same options.
MrPoptart is offline   Reply With Quote
Old Oct 2, 2009   #5
danjrdood
Member
 
Black Belt
Join Date: May 2009
Posts: 162



I can't figure out how to get my mod in Notepad. Can you help?
danjrdood is offline   Reply With Quote
Old Oct 2, 2009   #6
culapou
Elitist
 
Master Belt
Join Date: Dec 2007
Posts: 6,025



Uhm, read tutorial 1.

right click it, open with notepad.
the god
culapou is offline   Reply With Quote
Old Oct 3, 2009   #7
danjrdood
Member
 
Black Belt
Join Date: May 2009
Posts: 162



It doesn't appear in my scripts folder. I saved it and added the .tbm tag.
danjrdood is offline   Reply With Quote
Old Oct 3, 2009   #8
culapou
Elitist
 
Master Belt
Join Date: Dec 2007
Posts: 6,025



If you save it properly it must appear in the scripts folder, I can't help you.

Try downloading the newest version of toribash.
the god
culapou is offline   Reply With Quote
Old Oct 3, 2009   #9
danjrdood
Member
 
Black Belt
Join Date: May 2009
Posts: 162



Is that 3.8?
danjrdood is offline   Reply With Quote
Old Oct 3, 2009   #10
culapou
Elitist
 
Master Belt
Join Date: Dec 2007
Posts: 6,025



yes, whatever is on the toribash home page.
the god
culapou is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:46 AM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
ragdoll fighting game physics fighting game ragdoll fighting physics funmotion joints martial arts karate pc mac free game turn based game