Simple Mod Tutorial - Part Two

Simple Mod Tutorial - Part Two

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
User avatar
Alchemist
Posts: 81
Joined: 21 Oct 2005, 23:46

Simple Mod Tutorial - Part Two

Post by Alchemist »

There's three (3) essential parts to create a new unit.

1) Modeling/Texturing: this includes getting a simple object and giving it features. Once you have your object and you want to texture it look at this tutorial. Once you're finished with that part move along to this tutorial. They're both very good tutorials and not outdated so there's no excuse there. *Your finished myunit.s3o should go into your "Objects3d" folder of your mod*

*Do NOT go on to step 2 if you have not completed step 1*

2) FBI & Tags: this part is where you define your unit and tell it what it CAN do. I won't go over all of the tags because there is a beautiful document with those already here for us (http://spring.clan-sy.com/wiki/Units:FBI). All of these tags are very thoroughly explained. *If your model is a .s3o file your objectName tag should look like this: objectName=myunit.s3o* If you're a complete noob and you did not understand what an FBI is then read along, otherwise you may move on to step 3. An FBI is just a simple text (.txt) with an .fbi ending instead of .txt. A simple application like notepad will suffice. So, when you finish your myunit.fbi file you should put it in the "Units" folder of your mod.

3) Coding: this is where players see whether your mod is worth their time. This defines HOW your unit does what it does. You will need Scriptor. There's one thing you MUST check before compiling any script. When you open Scriptor select the menu "Script," and click "Settings." Once there, make sure your Linear constant is set to 65536.000000 and your Angular constant is set to 182.000000. Since most of what the newbie "modders" are doing nowadays is making a blob that shoots a laser or a projectile I took the liberty to go ahead and comment the Arm Stumpy script from BA 6.31 here. Once you are done with your script you may go ahead and compile it. Make sure it's saved to the "Scripts" folder of your mod.

*The model, fbi, and script names MUST all be the same!!!*


Now that I have my unit, how can I use it in game? This is the easiest part.

1) First, you must define it in the Armor file. Just open the Armor text file and add your unit where it first best. Eg: A level 2 plane fighter should go under the [L2FIGHTERS] group. All you need to do is type the model's name and an armor value (always 99?). So we can go ahead and type in myunit = 99; *Do NOT forget to put a semilcolon (;)!*

2) Unless your new unit is the Commander, you want a factory or another unit to be able to build this unit. For this, we go into the SIDEDATE.TDF file inside the "gamedate" folder of your mod. You can open and edit this file with Notepad or a similar application. So lets say I just made a unit for the Core faction and I want my Commander to be able to build it. I will go under the group [CORECOM] and add my unit in there. The easiest thing to do is to add it to the end of the line, that was we don't have to retype numbers. So now (using BA 6.31) your [CORECOM] group should have a new canbuild26=myunit; Once you are done with this you may save it and close all that.


Your new unit is now complete and ready to be tested. If you want to share this exciting new addition with your buddies you should compile the mod. How to do this? I've found that the most compatible format for testing is .sdz, which is just a simple Zip file. So, open your Mod folder and put everything in it into a new Zip file. Once you have all the folders in the Zip file you should rename it so it reads "MyMod.sdz" instead of "MyMod.zip."

You are now ready to share this with your friends and play with your new laser-shooting blob.

I hope this helps all of you beginners. If you have any more questions you may post them here.
Last edited by Alchemist on 01 Mar 2009, 16:36, edited 3 times in total.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Getting a Unit Ingame (Edited)

Post by Forboding Angel »

.sdd ftw.
User avatar
Alchemist
Posts: 81
Joined: 21 Oct 2005, 23:46

Re: Getting a Unit Ingame (Edited)

Post by Alchemist »

Yes, I'm a personal fan of .sdd format but it's no good for distributing D:
User avatar
Alchemist
Posts: 81
Joined: 21 Oct 2005, 23:46

Re: Simple Mod Tutorial - Part Two

Post by Alchemist »

sticky?
User avatar
SinbadEV
Posts: 6475
Joined: 02 May 2005, 03:56

Re: Simple Mod Tutorial - Part Two

Post by SinbadEV »

don't have time to look it over all the way right now, will consider stickying it out adding a link to it in one of the existing stickied posts.
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

Re: Simple Mod Tutorial - Part Two

Post by bobthedinosaur »

needs more examples for people to take a look at.
User avatar
Alchemist
Posts: 81
Joined: 21 Oct 2005, 23:46

Re: Simple Mod Tutorial - Part Two

Post by Alchemist »

You're quite right, I think I'll add a step by step walk-through of a custom script sometime soon. Any other suggestions?
User avatar
SpliFF
Posts: 1224
Joined: 28 Jul 2008, 06:51

Re: Simple Mod Tutorial - Part Two

Post by SpliFF »

Good tutorial but missing a lot of detail. It's also using dated concepts since most new mods and the engine itself are moving towards using Lua rather than TDF for unit files and gamedata/armordefs.lua rather than armor.txt etc. These are relics from TA and in the long run Spring will be better off without them.
Alchemist wrote: *The model, fbi, and script names MUST all be the same!!!*
Well... Maybe for convenience but it isn't a MUST. The model filename can be defined with the 'objectName' FBI tag and the script filename with the 'script' tag.

objectName=mymodel_v2.s3o;
script=myscript_v3.cob;
Alchemist wrote: All you need to do is type the model's name and an armor value (always 99?).
It doesn't have to be 99 because the value isn't actually used (only the key name matters). Some early mod or engine dev chose 99 at random and most mods just copy that.

To be absolutely clear, that 99 is NOT an armor value! Only the armor type has any effect. The actual effect of the armor type is actually set by the weapon defs.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: Simple Mod Tutorial - Part Two

Post by Tobi »

SpliFF wrote:
Alchemist wrote: *The model, fbi, and script names MUST all be the same!!!*
Well... Maybe for convenience but it isn't a MUST. The model filename can be defined with the 'objectName' FBI tag and the script filename with the 'script' tag.

objectName=mymodel_v2.s3o;
script=myscript_v3.cob;
That note is also a relic from the past; those tags are relatively new and before they were made the names had to be the same.
Post Reply

Return to “Game Development”