project reality header
Go Back   Project Reality Forums > PR:BF2 Mod Forums > PR:BF2 Community Modding > Modding Tutorials
20 Sep 2024, 00:00:00 (PRT)
Register Developer Blogs Members List Search Quick Links
Modding Tutorials Information and tutorials related to modding BF2.

Reply
 
Thread Tools Display Modes
Old 2007-06-08, 16:06   #1
Rhino
Retired PR Developer
Supporting Member

Rhino's Avatar
Arrow Adding Children to Statics

In this tutorial I will show you how to attach an object, or mutible objects such as ladders, other bits of building sections etc to an object as a child, which will overall save time when placing these objects in the map.

This is not the building I'm going to use to show you how to do it in this tut, but I'm just going to show you this one as an exsample of one I have done earlyer.

Basicly you can add all the objects in the object editor, to change this building, from this:


To this:


Diffrences being the 2nd part (the balconey) has been attached as a child, and also 6 ladders thou you can only see one of the ladders in the 2nd pic.


Thou as I have already done that building, I am going to use this building as an exsample:


Before I start this tut is very simple and it shouldnt take very long to get to grips with it, I only just had my first go at this last night before going to bed and did 2 buildings

Tools you will need:
Step 1: Setting up your editor to reload the .con and .tweak files.
This is important so that you do not have to reload the editor every time you change something in the code by hand.
Go to Tools>Options at the top of the editor

Exspand the "ReloadFileSettings" and inside the check every box so it looks like this:

Then click ok to apply the settings.

Step 2: Setting up the static so it can take children.
First open up the .con file of your staticobject with your text editor (I would use the Crimson Editor).
Look/Search for the line "ObjectTemplate.create SimpleObject". After you have found it, we want to change this object from a SimpleObject to a Bundle, so just replace "ObjectTemplate.create SimpleObject" with "ObjectTemplate.create Bundle" and save the .con file, then you can close it.
The Editor may ask at this point if you want to reload the object, you can ignore it for the time being and leave it, or press yes.

Step 3: Adding a child.
Open up the .tweak of your staticobject with your text editor (this is the one you really want the Crimson Editor for).
Now I want to add a "ladder_3m" to my static, so all I need to do is add these lines to the very bottom of my .tweak file.
Code:
rem -------------------------------------
ObjectTemplate.addTemplate ladder_3m
rem -------------------------------------
so it looks like this.

Note: if you want to add anouther kind of static other than a ladder_3m, just find out its file name, and repalce the "ladder_3m" above with the file name of your object.
then save the .tweak and the editor should pop up a window asking if you want to reload the file, press yes.
Now if you look in the editor, you will noticed on the left in the recorces bar, that you now have your new object there.


Step 3: Putting the child in the correct spot.
At the moment the object is located at excatly 0/0/0 of the pearent object, as we have not yet defeined any cordinets for it to be in, it also has a 0/0/0 rotation as we have not defeind any rotation as well.


To put the object into the correct postion, simpley move it there and when its set, save the object.

When you save the object, if you are using the Crimson Editor it will ask you if you want to reload the file, click yes and it will update it with the changes, if you are using notepad or something you will need to exit notepad, and reload the .tweak file.
If you look back you will notice it has added a new line under your new object with its x/y/z cordinets.


Now That I have done the first ladder, time to move onto the next ladder. I want to put a ladder at the back of this building, to do this we simpley follow the same prcedia as above, but now we want to also rotate the ladder 180degs. This ladder is longer so I want to add a ladder_7m.
Under the last object, just add the new object so it looks like this:

Now to rotate it 180degs, simpley add this line of code under the new object.
Code:
ObjectTemplate.setRotation 180/0/0
so it looks like this:

Now save the .tweak up, and click yes for the editor to reload the file.
Now you will find your new object sitting in the middle of your building, that now just needs moving into postion.
When the new object is in postion, just save it up again, and keep on doing this till all your new objects are on your building

Now Mappers can simpley drag and drop the pearent object into there map and will not need to place all the ladders, 2nd parts to the objects etc into there map wasting lots of time.


Note: only 2 objects placed on the left in the recorces tab.

Now just to make sure you guys know, if the mapper wants to for w/e reason, take off all the children from an object and maybe place them by hand in other areas, or so he dont have any ladders etc on them this is easily done by just checking this box when you have the object selected in the level editor, in the tweaker bar: DisableChildren


Which will resault in all the objects being removed, left with only the pearnt.


Then you can go about in the level editor adding them back by hand if you wanted to, just for an exsample im going to add the balconey number 2 onto it


Note: there are no ladders on the side.

Hope this tut helps!

Credit to matt.b for the statics, they are not my statics

Rhino is offline Reply With Quote
Old 2007-06-11, 23:15   #2
ub3rxn00b
Default

Where can I get some of these statics?
ub3rxn00b is offline Reply With Quote
Old 2007-06-11, 23:20   #3
Katarn
Retired PR Developer
Default

you cannot. Matt.B and all his work is copyright of the Project Reality dev team. Har har.
Katarn is offline Reply With Quote
Old 2007-06-11, 23:33   #4
El_Vikingo

El_Vikingo's Avatar
Default

Why would you add children to statics?
El_Vikingo is offline Reply With Quote
Old 2007-06-11, 23:37   #5
Rambo Hunter
Default

so it's easier and faster to add them without modeling new statics?
Rambo Hunter is offline Reply With Quote
Old 2007-06-11, 23:39   #6
El_Vikingo

El_Vikingo's Avatar
Default

Well, maybe the children don't want to be added to statics...they're only children.
El_Vikingo is offline Reply With Quote
Old 2007-06-11, 23:58   #7
ub3rxn00b
Default

Quote:
Originally Posted by [R-DEV]Katarn
you cannot. Matt.B and all his work is copyright of the Project Reality dev team. Har har.
Are you being serious? If so, what if I was to make a high-quality map for PR to use? Would I then have access?
ub3rxn00b is offline Reply With Quote
Old 2007-06-12, 01:07   #8
Rhino
Retired PR Developer
Supporting Member

Rhino's Avatar
Default

Quote:
Originally Posted by ub3rxn00b
Are you being serious? If so, what if I was to make a high-quality map for PR to use? Would I then have access?
you must be on the dev team, or the R-CON team at the very least to use them.

Rhino is offline Reply With Quote
Old 2007-06-12, 01:27   #9
IronTaxi
Retired PR Developer

IronTaxi's Avatar
Default

the whole point is us getting to use our hard work in the manner in whihc we designed them to be used BEFORE we release them to the general public modding community..once they are in a map and being used you are free to use whichever you like...

IronTaxi is offline Reply With Quote
Old 2007-06-12, 01:38   #10
Rhino
Retired PR Developer
Supporting Member

Rhino's Avatar
Default

Quote:
Originally Posted by [R-DEV]IronTaxi
once they are in a map and being used you are free to use whichever you like...
As long as you use them for the PR mod, and not any other mod or vBF2.

Rhino is offline Reply With Quote
Reply


Tags
adding, children, static, statics, tutorial

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



All times are GMT. The time now is 08:38.