Ducimus
04-30-08, 02:35 PM
This is a tutorial on how to do the following in the latest version of S3D:
A. Isolate an object you want to use elsewhere as "reuseable code"
B. Insert your "reuseable code" into an existing dat file
C. Placing the object in 3d (the hard way if you have no 3d editor skills).
Isolating the object you want to use elsewhere:
In this step by step tutorial, ill be isoloating an engine exhaust node that id like to use on the S class.
1. Take the file that has the item you want, copy it somewhere handy (i use my desktop), and rename it.
2. Open the dat your working with in S3D, and start cleaning up the dat file by remove EVERYTHING from it except the item you want to use. Now, this can be rather tricky if the item you want is nested inside a node or two. So heres a picture
http://www.ducimus.net/sh4/tec/s3d_tut1_01.jpg
In this picture you can see that ive
a.) Orginally used a gato dat file
b.) ive renamed it.
c.) Ive highlighted the item i want to isolate and use elsewhere. Trouble is, its nested inside the gato object, so onto the next step.
3.) Ive marked out the parent ID of this object in the above picture, which is the NSS Gato object, i want to break this parent->child relationship. So i CNTRL click on the parent ID of this object. What i often find handy for this, is the 3D model box as it contains a 0 hex address/ node ID. This is what i need to break the parent->child relationship from the node i want, as shown in this picture:
(Note the new Parent ID of the exhaust node, and its location in the node tree. It is completely free of the gato object now.)
http://www.ducimus.net/sh4/tec/s3d_tut1_02.jpg
4.) Delete EVERYTHING else from the dat file now. You should also remap all the ID's, so you don't forget to do it later. It should look like this:
(note that ive circled out its new ID if you compare it to the previous pic)
http://www.ducimus.net/sh4/tec/s3d_tut1_03.jpg
*note: You'll be importing this dat file later, ANYTHING you leave inside a dat file gets imported along with it. Author info, etc, you'll end up with duplicate EOF markers and indexs as well, so its very important to clean EVERYTHING out except the item you want to use.
I now have a nice little dat file with what is tantamount to reuseable code. On to the next part, inserting it into another file.
Insert your "reuseable code" into an existing dat file
1.) Create a test modlet. Dont work on files you want to keep.
2.) Open the file you want to work on in S3D, handy tip here, if you keep a mods shortcut on your desktop, you can navigate straight to your mods, regardless of where they're located, thereby saving you alot of needless scrolling around for files:
http://www.ducimus.net/sh4/tec/s3d_tut1_04.jpg
Note my reuseable code on the desktop.
3.) Having your test file open, scroll down to where you want to insert the new node. WHAT ORDER NODES APPEAR IN, DOES MATTER. As standard practice, i NEVER insert anything before the rendering controller. I do however want to insert my node right after it. Heres a picture:
http://www.ducimus.net/sh4/tec/s3d_tut1_05.jpg
What im doing here is im scrolling down to where i want to insert my new node. Note the number indexes. S3D is smart enough to change these on its own now. In this example, i want to insert my node right after the unified render controller. Whos properties end at index number 10. If i highlight number 10, and insert my dat here, S3D is smart enough to say, "oh, ok, ill insert your stuff as number 11, and bump everything down in sequence".
So at this point, right click where ive higlighted, and insert a dat file. If you've done this correctly, you'll get this dialog box:
http://www.ducimus.net/sh4/tec/s3d_tut1_06.jpg
Click yes.
What will happen is this:
http://www.ducimus.net/sh4/tec/s3d_tut1_07.jpg
Note here that my exhaust node has been inserted, starting as index number 11, but it does not have a parent-> child relationship with anything yet. But the point of this here is you can see how S3D has changed the indexes of your import.
4.) Establish the parent->child relationship. Its quite simple, just take the parent ID of the object you want your node embedded in, and and paste it into the parent ID box of your new node,
http://www.ducimus.net/sh4/tec/s3d_tut1_08.jpg
What will happen is this:
http://www.ducimus.net/sh4/tec/s3d_tut1_09.jpg
Notice how everything is sequential. So in summary, PAY ATTENTION TO YOUR INSERTION POINT WHEN IMPORTING DAT FILES.
So, now that wev'e successfully imported reuseable code into the dat file, its time to place it.
Placing the object in 3d (the hard way).
1. We enable our S boat test modlet, and go look at it in game. Since the node i used was addressed to work on other boats, i dont expect it to line up perfectly, but be in the general area. Here is my new exhaust node for the s boat:
http://www.ducimus.net/sh4/tec/s3d_tut1_10.jpg
Not quite where you'd like it. Now we have to fix that.
2. Your going to have to find the X,y,Z grid orientation of the object your working on. This is done mostly through trial and error of moving objects and see which way they go. In the case of submarines, its something like this.
http://www.ducimus.net/sh4/tec/s3d_tut1_11.jpg
Where the axis intersect is the 0,0 point. All object placement is relative to that point.
3.) Moving the Z coordinate.
(note the node positioning coordinate)
http://www.ducimus.net/sh4/tec/s3d_tut1_12.jpg
Since our exhaust is obviously too far aft, i have to move it forward. In this example, im moving the z coordinate closer to 0 (and subsquently toward the bow) by changing
the z coordinate to a number closer to 0. In this case im moving it from -2.4 to -1.75
This is the result:
http://www.ducimus.net/sh4/tec/s3d_tut1_13.jpg
If you compare the node placement now as compared to the last pic of an S class, you'll see it has indeed moved forward. However, its still out there floating in the breeze. So we have to bring it closer to the hull.
4.) Moving the X coordinate. Basically the same thing as moving the Y coordinate, just using a different number. In this example, if you refer to the above pic in step 3, im moving the x axis from 0.25, closer to 0 to a value of 0.14 This is the result:
http://www.ducimus.net/sh4/tec/s3d_tut1_14.jpg
5.) Moving the Y coordinate. In this example, the Y coordinate is the up and down placment of the node. Since it seems "about" right, im not going to alter it.
6.) Now that i have a working node that is properly placed, its time to rename it, in preperation of inserting another node just like it.
http://www.ducimus.net/sh4/tec/s3d_tut1_15.jpg
7). Now its time to reinsert another node. Open up your reuseable code dat file, remap the IDs again, and find your insertion point, import the dat, and establish its parent->child relationship to the main node of the dat file.
Study this picture for a moment:
http://www.ducimus.net/sh4/tec/s3d_tut1_16.jpg
- My insertion point was index number 18, which forced the import to be at the next higher number, and everything after it properly sequenced.
- ive established the parent child relationship
8.) Now that ive got this node it, its time to give it a proper name, and position it. YOU ALREADY HAVE THE COORDINATES IN YOUR FIRST NODE!!!!
So all you have to do, is copy and paste the coordiantes from your first node, into your second node, with one minor exception:
http://www.ducimus.net/sh4/tec/s3d_tut1_17.jpg
Since this node is going to be on the opposite side of the ship, all i had to do, was insert a negative mark on the Xaxis, which essentually flips it in orientation. (refer to above pic of coord mapping)
9. Give er a test run!
http://www.ducimus.net/sh4/tec/s3d_tut1_18.jpg
You can d/l the result of this tutorial here:
http://files.filefront.com/z+Test+SClass7z/;10108830;/fileinfo.html
This can be some very time consuming work. The basic principles of described here can be applied to most anything.
As an side, given the size of this object:
http://www.ducimus.net/sh4/tec/s3d_tut1_19.jpg
This, was alot of "fun".
http://www.ducimus.net/sh4/tec/s3d_tut1_20.jpg
I hope this tutorial is easy to understand, i type this in a hurry, i'll probably have to go back and change some wording here or there later.
A. Isolate an object you want to use elsewhere as "reuseable code"
B. Insert your "reuseable code" into an existing dat file
C. Placing the object in 3d (the hard way if you have no 3d editor skills).
Isolating the object you want to use elsewhere:
In this step by step tutorial, ill be isoloating an engine exhaust node that id like to use on the S class.
1. Take the file that has the item you want, copy it somewhere handy (i use my desktop), and rename it.
2. Open the dat your working with in S3D, and start cleaning up the dat file by remove EVERYTHING from it except the item you want to use. Now, this can be rather tricky if the item you want is nested inside a node or two. So heres a picture
http://www.ducimus.net/sh4/tec/s3d_tut1_01.jpg
In this picture you can see that ive
a.) Orginally used a gato dat file
b.) ive renamed it.
c.) Ive highlighted the item i want to isolate and use elsewhere. Trouble is, its nested inside the gato object, so onto the next step.
3.) Ive marked out the parent ID of this object in the above picture, which is the NSS Gato object, i want to break this parent->child relationship. So i CNTRL click on the parent ID of this object. What i often find handy for this, is the 3D model box as it contains a 0 hex address/ node ID. This is what i need to break the parent->child relationship from the node i want, as shown in this picture:
(Note the new Parent ID of the exhaust node, and its location in the node tree. It is completely free of the gato object now.)
http://www.ducimus.net/sh4/tec/s3d_tut1_02.jpg
4.) Delete EVERYTHING else from the dat file now. You should also remap all the ID's, so you don't forget to do it later. It should look like this:
(note that ive circled out its new ID if you compare it to the previous pic)
http://www.ducimus.net/sh4/tec/s3d_tut1_03.jpg
*note: You'll be importing this dat file later, ANYTHING you leave inside a dat file gets imported along with it. Author info, etc, you'll end up with duplicate EOF markers and indexs as well, so its very important to clean EVERYTHING out except the item you want to use.
I now have a nice little dat file with what is tantamount to reuseable code. On to the next part, inserting it into another file.
Insert your "reuseable code" into an existing dat file
1.) Create a test modlet. Dont work on files you want to keep.
2.) Open the file you want to work on in S3D, handy tip here, if you keep a mods shortcut on your desktop, you can navigate straight to your mods, regardless of where they're located, thereby saving you alot of needless scrolling around for files:
http://www.ducimus.net/sh4/tec/s3d_tut1_04.jpg
Note my reuseable code on the desktop.
3.) Having your test file open, scroll down to where you want to insert the new node. WHAT ORDER NODES APPEAR IN, DOES MATTER. As standard practice, i NEVER insert anything before the rendering controller. I do however want to insert my node right after it. Heres a picture:
http://www.ducimus.net/sh4/tec/s3d_tut1_05.jpg
What im doing here is im scrolling down to where i want to insert my new node. Note the number indexes. S3D is smart enough to change these on its own now. In this example, i want to insert my node right after the unified render controller. Whos properties end at index number 10. If i highlight number 10, and insert my dat here, S3D is smart enough to say, "oh, ok, ill insert your stuff as number 11, and bump everything down in sequence".
So at this point, right click where ive higlighted, and insert a dat file. If you've done this correctly, you'll get this dialog box:
http://www.ducimus.net/sh4/tec/s3d_tut1_06.jpg
Click yes.
What will happen is this:
http://www.ducimus.net/sh4/tec/s3d_tut1_07.jpg
Note here that my exhaust node has been inserted, starting as index number 11, but it does not have a parent-> child relationship with anything yet. But the point of this here is you can see how S3D has changed the indexes of your import.
4.) Establish the parent->child relationship. Its quite simple, just take the parent ID of the object you want your node embedded in, and and paste it into the parent ID box of your new node,
http://www.ducimus.net/sh4/tec/s3d_tut1_08.jpg
What will happen is this:
http://www.ducimus.net/sh4/tec/s3d_tut1_09.jpg
Notice how everything is sequential. So in summary, PAY ATTENTION TO YOUR INSERTION POINT WHEN IMPORTING DAT FILES.
So, now that wev'e successfully imported reuseable code into the dat file, its time to place it.
Placing the object in 3d (the hard way).
1. We enable our S boat test modlet, and go look at it in game. Since the node i used was addressed to work on other boats, i dont expect it to line up perfectly, but be in the general area. Here is my new exhaust node for the s boat:
http://www.ducimus.net/sh4/tec/s3d_tut1_10.jpg
Not quite where you'd like it. Now we have to fix that.
2. Your going to have to find the X,y,Z grid orientation of the object your working on. This is done mostly through trial and error of moving objects and see which way they go. In the case of submarines, its something like this.
http://www.ducimus.net/sh4/tec/s3d_tut1_11.jpg
Where the axis intersect is the 0,0 point. All object placement is relative to that point.
3.) Moving the Z coordinate.
(note the node positioning coordinate)
http://www.ducimus.net/sh4/tec/s3d_tut1_12.jpg
Since our exhaust is obviously too far aft, i have to move it forward. In this example, im moving the z coordinate closer to 0 (and subsquently toward the bow) by changing
the z coordinate to a number closer to 0. In this case im moving it from -2.4 to -1.75
This is the result:
http://www.ducimus.net/sh4/tec/s3d_tut1_13.jpg
If you compare the node placement now as compared to the last pic of an S class, you'll see it has indeed moved forward. However, its still out there floating in the breeze. So we have to bring it closer to the hull.
4.) Moving the X coordinate. Basically the same thing as moving the Y coordinate, just using a different number. In this example, if you refer to the above pic in step 3, im moving the x axis from 0.25, closer to 0 to a value of 0.14 This is the result:
http://www.ducimus.net/sh4/tec/s3d_tut1_14.jpg
5.) Moving the Y coordinate. In this example, the Y coordinate is the up and down placment of the node. Since it seems "about" right, im not going to alter it.
6.) Now that i have a working node that is properly placed, its time to rename it, in preperation of inserting another node just like it.
http://www.ducimus.net/sh4/tec/s3d_tut1_15.jpg
7). Now its time to reinsert another node. Open up your reuseable code dat file, remap the IDs again, and find your insertion point, import the dat, and establish its parent->child relationship to the main node of the dat file.
Study this picture for a moment:
http://www.ducimus.net/sh4/tec/s3d_tut1_16.jpg
- My insertion point was index number 18, which forced the import to be at the next higher number, and everything after it properly sequenced.
- ive established the parent child relationship
8.) Now that ive got this node it, its time to give it a proper name, and position it. YOU ALREADY HAVE THE COORDINATES IN YOUR FIRST NODE!!!!
So all you have to do, is copy and paste the coordiantes from your first node, into your second node, with one minor exception:
http://www.ducimus.net/sh4/tec/s3d_tut1_17.jpg
Since this node is going to be on the opposite side of the ship, all i had to do, was insert a negative mark on the Xaxis, which essentually flips it in orientation. (refer to above pic of coord mapping)
9. Give er a test run!
http://www.ducimus.net/sh4/tec/s3d_tut1_18.jpg
You can d/l the result of this tutorial here:
http://files.filefront.com/z+Test+SClass7z/;10108830;/fileinfo.html
This can be some very time consuming work. The basic principles of described here can be applied to most anything.
As an side, given the size of this object:
http://www.ducimus.net/sh4/tec/s3d_tut1_19.jpg
This, was alot of "fun".
http://www.ducimus.net/sh4/tec/s3d_tut1_20.jpg
I hope this tutorial is easy to understand, i type this in a hurry, i'll probably have to go back and change some wording here or there later.