Printer-friendly copy
Top MechCommander MechCommander 2 topic #5521
View in linear mode

Subject: "Buildings, wehicles, weapons magics release" Previous topic | Next topic
MagicMon Nov-15-10 11:43 AM
Charter member
647 posts
Click to send email to this author Click to send private message to this authorClick to view this author's profileClick to add this author to your buddy list
"Buildings, wehicles, weapons magics release"
Mon Jul-18-11 09:26 AM by Magic

          

My MC2 Buildings:

http://www.filesonic.com/file/1443477034

My MC2 vehicles:

http://www.filesonic.com/file/1443598974

Some of my MC2 weapons:

http://www.filesonic.com/file/1443477044

As an example.

How to add buildings to MC2

1. You need textured 3D model.
2. Texture must be 128x128 .TGA format.

1. Export to ase and copy to your MC2\data\tgl folder.

You must have following files:
1. your_building.ini (download my buildings and see examples)
2. your_building.ase (game will translate to .tgl)
3. your_buildingx.ase (lowest poly model of your building - used for shadow - will translate to tgl)
4. your_buildingdam.ase (model of the destroyed building - tgl)
5. your_buildingdamx.ase (lowest poly model of the destroyed building (shadow of the distroyed building - tgl)

Place all texture files you used for your_building in MC2\data\tgl\128 folder.
And you are done? No unfortunately not.

You need fit file for the building in object2.pak and name string in mc2res.dll and reference in the file MC2\data\art\buildings.csv (?!?!)

Add line to buildings.csv file, example:

City2StoryG,11,34243,BUILDING,258,,1,0,0,0,,0.8

In your case:

Your_building,11(your building type),XXXXX (reference number to name string of your_building in mc2res.dll),BUILDING,X (file number of the file for your_building in object2.pak - no leading zeroes just number),,1,0,0,0,,0.8

For other values in the line open the file and see the header.

Download my unpacked object2.

Example of the building file for City2StoryG:

FITini


l ObjectTypeNum=1


st Name="City2StoryG"
st AppearanceName="City2StoryG"
l ExplosionObject=727
l DestroyedObject=0
f ExtentRadius=35.000000


ul DmgLevel=25
f ExtentRadius=35.000000
f ExplosionRadius=0.000000
f ExplosionDamage=0.000000
l BuildingName=30163
l SetImpassable=1
l XImpasse=0
l YImpasse=0
ul NormalEffectId=0
ul BlownEffectId=0
ul DamageEffectId=0
b CanRefit=FALSE
b MechBay=FALSE
f TimeToBurnDamage=5.000000
f BurnDamagePerTime=1.000000
f DamageLvlForBurn=22.000000
f SensorRange=-1.000000
l TeamID=-1
l Tonnage=20
l BattleRating=20
l NumMarines=0
b blockLineOfFire=FALSE
l LowTemplate=939524096
l HighTemplate=14392
l PotentialContact=0
l BasePixelOffsetX=4
l BasePixelOffsetY=70
b ImpassableWhenDestroyed = false
FITend

Find in the files from a0000.fit through a1187.fit something like this:

FITini


l ObjectTypeNum=24


st Name=""
st AppearanceName="NONE"
l ExplosionObject=0
l DestroyedObject=0
f ExtentRadius=0.000000


f ProjectileLength=0.000000
f BulgeLength=0.000000
f BulgeWidth=0.000000
f Velocity=0.000000
st FiringEffectName="NONE"
st TrailEffectName="NONE"
l HitEffect=0
l MissEffect=0
l FiringSoundFX=0
l LightEffect=0
ul FrontRGB=0
ul MidEdgeRGB=0
ul MiddleRGB=0
ul BackRGB=0
uc EdgeAlpha=255
uc BoltAlpha=255
FITend

And replace with data for your building like in example above.
Save the file axxxx.fit and dbl click mkObject2.bat. Now you have object2.pak with your file inside. Dont forget to write the number of axxxx.fit, its the reference number for buildings.csv.

Its not over yet. The last thing you need is name string in mc2res.dll. If you know how to edit mc2res.dll ok (it can be done with hex editor with warning that the string length of you new string must be the same length as the string being replaced. If your string is shorter fill the rest with blank spaces, cant be longer). Or use c++ to modify mc2res from the project. If you dont know what to do with mc2res post here and I will add the string for you. Dont forget to write resource (string) number it will be your reference number for buildings.csv.

That should be all, You should be able to see your_building in mc2 editor.

  

Alert Printer-friendly copy | Reply | Reply with quote | Top

Replies to this topic
Subject Author Message Date ID
RE: Buildings, wehicles, weapons magics release
Nov 15th 2010
1
RE: Buildings, wehicles, weapons magics release
Nov 15th 2010
2
RE: Buildings, wehicles, weapons magics release
Nov 16th 2010
4
RE: Buildings, wehicles, weapons magics release
Nov 16th 2010
3
RE: Buildings, wehicles, weapons magics release
Nov 17th 2010
5
RE: Buildings, wehicles, weapons magics release
Nov 17th 2010
6
RE: Buildings, wehicles, weapons magics release
Nov 17th 2010
7
RE: Buildings, wehicles, weapons magics release
Nov 17th 2010
8
RE: Buildings, wehicles, weapons magics release
Nov 18th 2010
10
RE: Buildings, wehicles, weapons magics release
Nov 18th 2010
9
      RE: Buildings, wehicles, weapons magics release
Nov 20th 2010
11
           RE: Buildings, wehicles, weapons magics release
Nov 22nd 2010
12
                RE: Buildings, wehicles, weapons magics release
Nov 22nd 2010
13
                     RE: Buildings, wehicles, weapons magics release
Nov 23rd 2010
14
                          RE: Buildings, wehicles, weapons magics release
Nov 24th 2010
15
                          RE: Buildings, wehicles, weapons magics release
Nov 25th 2010
16

rollinMon Nov-15-10 01:13 PM
Member since Aug 25th 2010
114 posts
Click to send email to this author Click to send private message to this authorClick to add this author to your buddy list
#1. "RE: Buildings, wehicles, weapons magics release"
In response to Reply # 0


          

nice!!

  

Alert Printer-friendly copy | Reply | Reply with quote | Top

Starman01Mon Nov-15-10 04:07 PM
Member since Nov 10th 2010
110 posts
Click to send email to this author Click to send private message to this authorClick to view this author's profileClick to add this author to your buddy list
#2. "RE: Buildings, wehicles, weapons magics release"
In response to Reply # 0


          

Indeed, that's great Anything were you need helping testing in that, or is it already finished ?

  

Alert Printer-friendly copy | Reply | Reply with quote | Top

    
MagicTue Nov-16-10 06:40 AM
Charter member
647 posts
Click to send email to this author Click to send private message to this authorClick to view this author's profileClick to add this author to your buddy list
#4. "RE: Buildings, wehicles, weapons magics release"
In response to Reply # 2


          

Its finished long time ago.

Most of it should be in Wolfmans expansion.

  

Alert Printer-friendly copy | Reply | Reply with quote | Top

KarlTue Nov-16-10 12:33 AM
Member since Sep 28th 2010
132 posts
Click to send email to this author Click to send private message to this authorClick to view this author's profileClick to add this author to your buddy list
#3. "RE: Buildings, wehicles, weapons magics release"
In response to Reply # 0


          

Thanks Magic

  

Alert Printer-friendly copy | Reply | Reply with quote | Top

MagicWed Nov-17-10 08:29 AM
Charter member
647 posts
Click to send email to this author Click to send private message to this authorClick to view this author's profileClick to add this author to your buddy list
#5. "RE: Buildings, wehicles, weapons magics release"
In response to Reply # 0


          

Post updated at top

  

Alert Printer-friendly copy | Reply | Reply with quote | Top

    
Starman01Wed Nov-17-10 08:36 AM
Member since Nov 10th 2010
110 posts
Click to send email to this author Click to send private message to this authorClick to view this author's profileClick to add this author to your buddy list
#6. "RE: Buildings, wehicles, weapons magics release"
In response to Reply # 5


          

Many thanks for that "howto". I will try that one

  

Alert Printer-friendly copy | Reply | Reply with quote | Top

Starman01Wed Nov-17-10 01:29 PM
Member since Nov 10th 2010
110 posts
Click to send email to this author Click to send private message to this authorClick to view this author's profileClick to add this author to your buddy list
#7. "RE: Buildings, wehicles, weapons magics release"
In response to Reply # 0


          

@Magic : Do the shadow models need any special textures ? Maybe a placeholder with a specific name or such ?

  

Alert Printer-friendly copy | Reply | Reply with quote | Top

    
Starman01Wed Nov-17-10 09:02 PM
Member since Nov 10th 2010
110 posts
Click to send email to this author Click to send private message to this authorClick to view this author's profileClick to add this author to your buddy list
#8. "RE: Buildings, wehicles, weapons magics release"
In response to Reply # 7


          

One more question, in which game version shall I test the new models ? When I use your unpacked Object file, is it requiring a special MC2 edition, like wolfman's, or the 2.5 variant ? Or does it also work in the retail installation ?

For the shadow, i simply created a black map and named it on the model the like. I will see how it turns out and if it will worl

  

Alert Printer-friendly copy | Reply | Reply with quote | Top

        
MagicThu Nov-18-10 07:22 AM
Charter member
647 posts
Click to send email to this author Click to send private message to this authorClick to view this author's profileClick to add this author to your buddy list
#10. "RE: Buildings, wehicles, weapons magics release"
In response to Reply # 8


          

Quote

One more question, in which game version shall I test the new models ? When I use your unpacked Object file, is it requiring a special MC2 edition, like wolfman's, or the 2.5 variant ? Or does it also work in the retail installation ?

For the shadow, i simply created a black map and named it on the model the like. I will see how it turns out and if it will worl


My unpacked object2 will work with my release and the original. Black or gray with alpha channel (?) I think.

  

Alert Printer-friendly copy | Reply | Reply with quote | Top

    
MagicThu Nov-18-10 07:18 AM
Charter member
647 posts
Click to send email to this author Click to send private message to this authorClick to view this author's profileClick to add this author to your buddy list
#9. "RE: Buildings, wehicles, weapons magics release"
In response to Reply # 7


          

Quote

@Magic : Do the shadow models need any special textures ? Maybe a placeholder with a specific name or such ?


I dont remember take a look in my buildings, should be some shadow textures there.

  

Alert Printer-friendly copy | Reply | Reply with quote | Top

        
Starman01Sat Nov-20-10 07:15 PM
Member since Nov 10th 2010
110 posts
Click to send email to this author Click to send private message to this authorClick to view this author's profileClick to add this author to your buddy list
#11. "RE: Buildings, wehicles, weapons magics release"
In response to Reply # 9
Sat Nov-20-10 07:19 PM by Starman01

          

Hi Magic,

I have a few question regarding adding objects (in this case a building) to the game. For testing purpose, I take the final release folder from the MC2 Sourcecode.

I want to collect the stuff "how to mod", and also intend to create a forum where to collect the information. I would really appreciate, if you would answer the questions and will help me to collect that information.

According to your discription, I want the know the following additional information :

1) The ini-file :

FITini 

(Bounds)
l UpperLeftX=-20
l UpperLeftY=-20
l LowerRightX=20
l LowerRightY=20

(TGLData)
st FileName="datacenter"

st ShadowName="datacenterX"

//Night Lights
ul HotPinkRGB = 0x00A7A783
ul HotYellowRGB = 0x00FEfF91
ul HotGreenRGB = 0x00707070
ul TerrainLightRGB = 0x0099cccc
f TerrainLightIntensity = 0.07
f TerrainLightInnerRadus = 100.0
f TerrainLightOuterRadius = 200.0

(TGLDamage)
st FileName="datacenterdam"

st ShadowName="datacenterdamX"

FITend

a) The parts "TGLData" and "TGLDamage" are clear sofar, these are the references for the solid and destroyed objectfiles and their shadow counterpart.
The "Night Lights" part is also pretty much self explaining. Except the "ul TerrainLightRGB", what's this value for exactly, and how do I get that ? Of course I can simply copy it out of another bulding's ini, but I still want to know. Is this maybe the colour of the lightspot on the ground, while the other 3 values define the colour of the lightcone itself ? I'm not that much familiar with RGB Values, but it's clear that the first three values are the channels itself, but what is the fourth ? The following three values are also pretty clear.

b) "Bounds" is most likely the bounding box for the collision detection. I have taken a look into a few files (including vehicles), and I found everywhere the value "20" . How is that ? Is 20 the unit that stands for a single groundtile in the editor ? If so, how comes that bigger buildings and objects still only have 20 as value ?

c) Where does this file here belong anyway ? Your example files are placed in the "tgl" folder, is this the right spot ? If so, in which file are they supposed to be integrated, is that all stored in tgl.fst ?

2)The building.csv file

Pretty much selfexplaining, needed entries can be copied from other entries.

3) The mc2res.dll file

Worst of them all So you said, this file can either be edited with a hex editor or inside visual studio 2008, I've taken a look into it, and I think the most important stuff for buildings, vehicles, components and mechs is this :

#define IDS_OBJECT_610 30610
#define IDS_OBJECT_611 30611
#define IDS_OBJECT_612 30612
#define IDS_OBJECT_613 30613
#define IDS_OBJECT_614 30614
#define IDS_OBJECT_615 30615
#define IDS_OBJECT_616 30616
#define IDS_OBJECT_617 30617
#define IDS_OBJECT_618 30618

Do I see this right, that the only deeper goal behind the file is to store unique ID numbers for each gameobject and part ? So, I can look for an empty spot and insert my new entry ? Is it important to keep it sorted to mechs, component and so on ? If so, it could be a little hard to find an empty spot.

If I follow these steps above, will then the building show up in the editor with named entry, and later ingame ? I remember downloading the unofficial mechlab extension a few years ago (that was what they took from you afaik), but in the editor all new stuff wasn't named so it was nearly impossible to work with it for good.

Thanks in advance for your help

B/R
Starman

  

Alert Printer-friendly copy | Reply | Reply with quote | Top

            
MagicMon Nov-22-10 08:22 AM
Charter member
647 posts
Click to send email to this author Click to send private message to this authorClick to view this author's profileClick to add this author to your buddy list
#12. "RE: Buildings, wehicles, weapons magics release"
In response to Reply # 11


          

Quote

a) The parts "TGLData" and "TGLDamage" are clear sofar, these are the references for the solid and destroyed objectfiles and their shadow counterpart.
The "Night Lights" part is also pretty much self explaining. Except the "ul TerrainLightRGB", what's this value for exactly, and how do I get that ? Of course I can simply copy it out of another bulding's ini, but I still want to know. Is this maybe the colour of the lightspot on the ground, while the other 3 values define the colour of the lightcone itself ? I'm not that much familiar with RGB Values, but it's clear that the first three values are the channels itself, but what is the fourth ? The following three values are also pretty clear.


I dont know. Mechs were a priority for me, buildings were just a side step.

Quote

b) "Bounds" is most likely the bounding box for the collision detection. I have taken a look into a few files (including vehicles), and I found everywhere the value "20" . How is that ? Is 20 the unit that stands for a single groundtile in the editor ? If so, how comes that bigger buildings and objects still only have 20 as value ?


I think you are right, but I didnt experiment that much on buildings and vehicles. Try some other values and see whats going on.

Quote

c) Where does this file here belong anyway ? Your example files are placed in the "tgl" folder, is this the right spot ? If so, in which file are they supposed to be integrated, is that all stored in tgl.fst ?


TGL folder is the right spot. All my examples have correct folder tree. No need to be integrated anywhere.

Quote

3) The mc2res.dll file

Worst of them all So you said, this file can either be edited with a hex editor or inside visual studio 2008, I've taken a look into it, and I think the most important stuff for buildings, vehicles, components and mechs is this :

#define IDS_OBJECT_610 30610
#define IDS_OBJECT_611 30611
#define IDS_OBJECT_612 30612
#define IDS_OBJECT_613 30613
#define IDS_OBJECT_614 30614
#define IDS_OBJECT_615 30615
#define IDS_OBJECT_616 30616
#define IDS_OBJECT_617 30617
#define IDS_OBJECT_618 30618

Do I see this right, that the only deeper goal behind the file is to store unique ID numbers for each gameobject and part ? So, I can look for an empty spot and insert my new entry ? Is it important to keep it sorted to mechs, component and so on ? If so, it could be a little hard to find an empty spot.

If I follow these steps above, will then the building show up in the editor with named entry, and later ingame ? I remember downloading the unofficial mechlab extension a few years ago (that was what they took from you afaik), but in the editor all new stuff wasn't named so it was nearly impossible to work with it for good.


There are two files that you have to open with studio 2008:

- Resource.h
- script1.rc

Resource.h contains variable definitions With assigned unique values e.g.

#define IDS_OBJECT_611 30611

30611 is the value assigned to IDS_OBJECT_611. You need to remember or copy IDS_OBJECT_611.

script1.rc hold the descriptions. Open script1.rc and look (find) value IDS_OBJECT_611. You should see description on the right side. Find an empty place, type your description or name, write down the number and build your project. You will have mc2res.dll with your values inside.

Description IDS_OBJECT_611 in script1 is "Volcanic Rock Field 2" and it is assigned to number 30611.

  

Alert Printer-friendly copy | Reply | Reply with quote | Top

                
Starman01Mon Nov-22-10 09:18 AM
Member since Nov 10th 2010
110 posts
Click to send email to this author Click to send private message to this authorClick to view this author's profileClick to add this author to your buddy list
#13. "RE: Buildings, wehicles, weapons magics release"
In response to Reply # 12


          

Thanks man, i will give it a try

  

Alert Printer-friendly copy | Reply | Reply with quote | Top

                    
Starman01Tue Nov-23-10 07:10 PM
Member since Nov 10th 2010
110 posts
Click to send email to this author Click to send private message to this authorClick to view this author's profileClick to add this author to your buddy list
#14. "RE: Buildings, wehicles, weapons magics release"
In response to Reply # 13
Tue Nov-23-10 07:12 PM by Starman01

          

Ok, i must admit, that I simply have no idea what I actually do in Visual Editor and have no experience with C++, I'm simply overwhelmed with that software, that is nothing that I can figure out in trial and error.

I changed resource.h with a complete new entry. I also added that entry into script.rc, though I have no idea if the place is correct, I just placed it near similar entries. The reason and the synthax of both files is more or less clear (not the sorting of script yet)

But I have no idea how to create a new dll out of this. I tried to create "new project", save project, create only project and whatever. I have no really idea where this is created, and if there will even be a dll created. Besides that, I always get an error message in the list below, something about a missing file.

So, I think I will need a crash course in this.

@magic : Could you please maybe create a dll for me so that I can test the model ? I don't care about the id you give it, make it similar to the industrial complex, since it's only a building prop. Name should be "mechhangar". That would be great

  

Alert Printer-friendly copy | Reply | Reply with quote | Top

                        
MagicWed Nov-24-10 06:15 AM
Charter member
647 posts
Click to send email to this author Click to send private message to this authorClick to view this author's profileClick to add this author to your buddy list
#15. "RE: Buildings, wehicles, weapons magics release"
In response to Reply # 14


          

Quote

@magic : Could you please maybe create a dll for me so that I can test the model ? I don't care about the id you give it, make it similar to the industrial complex, since it's only a building prop. Name should be "mechhangar". That would be great


Will do...

  

Alert Printer-friendly copy | Reply | Reply with quote | Top

                        
MagicThu Nov-25-10 06:16 AM
Charter member
647 posts
Click to send email to this author Click to send private message to this authorClick to view this author's profileClick to add this author to your buddy list
#16. "RE: Buildings, wehicles, weapons magics release"
In response to Reply # 14


          

Use MC2res.dll from the 2.5 its already there - 30209.

  

Alert Printer-friendly copy | Reply | Reply with quote | Top

Top MechCommander MechCommander 2 topic #5521 Previous topic | Next topic
Powered by DCForum+ Version 1.27
Copyright 1997-2005 DCScripts.com