Author Topic: How to create a new component?  (Read 1684 times)

Offline Rox666

  • Antweight
  • Posts: 21
  • Rep: 0
    • View Profile
    • Awards
How to create a new component?
« on: February 28, 2011, 07:32:20 AM »
Hi all!

These days I'm trying to create a new component to the game.

As a test, I copied the folder "BATTPACK" and I changed the bmp file in "maps ".
Then I created a. txt file where I wrote the coordinates of the folders, files, and the characteristics of the piece.

When I started the game, my piece was new in the menu. But after inserting it, when I left the "workshop" and tried to come back in again, the game crashed .. why?

Thank you all!

Offline Rox666

  • Antweight
  • Posts: 21
  • Rep: 0
    • View Profile
    • Awards
Re: How to create a new component?
« Reply #1 on: February 28, 2011, 08:01:52 AM »
Ah! Last thing!

Do you think thet I have to edit the .gmf file?

Offline ianh05

  • *
  • Posts: 2778
  • Rep: 4
  • Stock AW Builder and Tourney Host!
    • View Profile
    • Awards
Re: How to create a new component?
« Reply #2 on: February 28, 2011, 08:13:19 AM »
sounds like there's a missing comma or something in the text file, go through and check everything from spaces to commas in the text file. I don't make new components at all so you'll have to wait for someone else to reply for a better response :)
Check out my UI Improvements topic for stuff like longer team/bot import lists:
https://gametechmods.com/forums/index.php?topic=13324.0
How to make awesome splashes with paint:
https://gametechmods.com/forums/index.php?topic=13310.0
My showcase filled with antweights:
https://gametechmods.com/forums/index.php?topic=1595.0
How to AI: For newbies (with pics!):
https://gametechmods.com/forums/index.php?topic=13814.0
Best tournament results:
Tag Team Challenge and CombatAnts 3: runner-up
Around the World: 3rd place.

Offline Rox666

  • Antweight
  • Posts: 21
  • Rep: 0
    • View Profile
    • Awards
Re: How to create a new component?
« Reply #3 on: February 28, 2011, 08:22:40 AM »
Tnx ianh05!

Infact I have create the text file! Because the compontent thet I've copy dosen't have a text file!

I see thet my new component in a new bot, it works! Infact, it can be place and when I test the robot, don't crash! But when i quit from the "workshop" and I enter again, the game crash!
But....

If I used this component in a bot thet already exist, when I exit from the "workshop" the game crash and when I try to enter again to edit my robot, the game recrash!
But in a new bot don't do this thing!
Why?

Offline Rox666

  • Antweight
  • Posts: 21
  • Rep: 0
    • View Profile
    • Awards
Re: How to create a new component?
« Reply #4 on: February 28, 2011, 08:31:55 AM »
ok...

I've a news!

My old robot is to trash, but in a new robot my new component work! I can try it and left from test area from components menu!

I see the i have to change the "sort" in text file! I have write: sort = 100 .
And now it seems go!

However, can someone give me some explanations about what I've to do for create some new compoent?

Offline JoeBlo

Re: How to create a new component?
« Reply #5 on: February 28, 2011, 09:01:06 AM »
The single greatest tutorial ever written...

http://beetlebros.gametechmods.com/modding.htm

Offline Serge

  • *
  • Posts: 1530
  • Rep: 13
    • View Profile
    • http://www.q3k.org/
    • Awards
Re: How to create a new component?
« Reply #6 on: February 28, 2011, 09:05:14 AM »
However, can someone give me some explanations about what I've to do for create some new compoent?

Hey,

A component is made out of two distinct parts:
- The 3D model which is stored in the .gmf and .bmp files
- The component information file, a.k.a. .txt file (and .bmp for the preview), which holds the in-game characteristics of the component. The .txt files are sometimes compressed into .cfz files.

First thing you can try to do is copy a .txt file, rename it and change some values around. You don't have to copy the .gmf file if you don't change its reference in the .txt file. However you will have the same model of the component and the same maps (because they're referenced in the .gmf file) and the same preview bitmap (unless you copy it).

Now, if you want to change the geometry or maps, you'll have to copy the folder containing the .gmf and .bmp files. Rename it, and change it's reference (called "directory") in the .txt file. You can't unfortunately just edit the bmp then, because weird things will occur then (as there will be two components with the same map name they will both have the map of the first one that is loaded ingame). So you have to rename the .bmp file and change its reference in the gmf file. How do you do the latter? Grab a compiler/decompiler, either mine (from my sig) or dummee's, available in the downloads section of the portal. Then use the decompiler to decompile the .gmf file into a decompiled form (remember to save it to a different file, otherwise my compiler will crash, IIRC). Then open the decompiled file in a text editor and find the .bmp file name you just changed, change it, save the file and recompile it. Done.

Now, when it comes to editing geometry, just mess around in the decompiled gmf file, you should understand it quite easily if you've ever finished a High School math class. In the usual component there are two meshes, a collision and a display mesh. The first is used by the game to calculate collisions and is quite simple, the latter is used as the display model. There are other objects in the file, there is a page in the Wiki that (I think) describes them all.

If you wish to create your own components from scratch with 3dsmax, please tell me, I will walk you through it.


If you need help, please don't hesitate to ask.
home | twitter | yt | gmf de/compiler | component freedom | xmpp: q3k@q3k.org | email: q3k@q3k.org

Offline Rox666

  • Antweight
  • Posts: 21
  • Rep: 0
    • View Profile
    • Awards
Re: How to create a new component?
« Reply #7 on: February 28, 2011, 09:33:20 AM »
Yeah..is a good tutorial!

But I've follow his istructions, and when I change the name of .bmp file in maps foldier, the texture don't work!
I've edit the Bitmap string in gmf file with new name of bmp file! But don't go or better, in game the texture don't exist and when sometime the game crashes anyway!

Offline Serge

  • *
  • Posts: 1530
  • Rep: 13
    • View Profile
    • http://www.q3k.org/
    • Awards
Re: How to create a new component?
« Reply #8 on: February 28, 2011, 09:38:20 AM »
Yeah..is a good tutorial!

But I've follow his istructions, and when I change the name of .bmp file in maps foldier, the texture don't work!
I've edit the Bitmap string in gmf file with new name of bmp file! But don't go or better, in game the texture don't exist and when sometime the game crashes anyway!

Send me your components file, I'll take a look.
home | twitter | yt | gmf de/compiler | component freedom | xmpp: q3k@q3k.org | email: q3k@q3k.org

Offline Rox666

  • Antweight
  • Posts: 21
  • Rep: 0
    • View Profile
    • Awards
Re: How to create a new component?
« Reply #9 on: February 28, 2011, 09:50:48 AM »
Tnx a lots!!

I post here the component because in PM i don't know how to do!!

Offline Serge

  • *
  • Posts: 1530
  • Rep: 13
    • View Profile
    • http://www.q3k.org/
    • Awards
Re: How to create a new component?
« Reply #10 on: February 28, 2011, 09:52:44 AM »
Code: [Select]
*BITMAP gold_battery_battery.bmp
Well there's your problem. Also, you shouldn't keep decompiled GMF files in the Components folder if you do.

Also, yay for Italians.
home | twitter | yt | gmf de/compiler | component freedom | xmpp: q3k@q3k.org | email: q3k@q3k.org

Offline Rox666

  • Antweight
  • Posts: 21
  • Rep: 0
    • View Profile
    • Awards
Re: How to create a new component?
« Reply #11 on: February 28, 2011, 09:57:06 AM »
Ah ya! I've alrady see this error!
And I've change it but the problem remain! XD

And ther's another little mistake in "battpack1.gmf" but I've correct it and doesn't work anyway!


I don't understand why when I change the name of maps file, the gmf file doesn't work!
While if I leave the original name the texture it appears!!
« Last Edit: February 28, 2011, 10:48:31 AM by Rox666 »

Offline 123savethewhales

  • *
  • Posts: 2923
  • Rep: 30
  • Friendship is Magic
  • Awards BOTM Winner
    • View Profile
    • Awards
Re: How to create a new component?
« Reply #12 on: March 01, 2011, 04:25:55 PM »
Because the GMF is actually a file you need to decompile, modify, and recompile.