How Do I Begin Modding

Everything about mods can be found here.

Moderator: Morax

How Do I Begin Modding

Postby ntf_Shrapnel » 08 Jun 2015, 22:24

I have knowledge in the programming languages Python, and Lua, and I was wondering how does one create a mod in FAF. What do I need to know, and where do I start. Also what programs do I need downloaded.
ntf_Shrapnel
 
Posts: 1
Joined: 08 Jun 2015, 22:20
Has liked: 0 time
Been liked: 0 time
FAF User Name: ntf_Shrapnel

Re: How Do I Begin Modding

Postby Resin_Smoker » 08 Jun 2015, 23:29

For scripting, a simple text editor is all thats needed. Beyond that look at what work has been done before to clue you in as to how the game works. Otherwise direct assistance from those who know would be required.

Resin
Resin_Smoker
Evaluator
 
Posts: 858
Joined: 14 Mar 2012, 17:58
Has liked: 54 times
Been liked: 106 times

Re: How Do I Begin Modding

Postby Ithilis_Quo » 09 Jun 2015, 11:29

Here is begginer moding tutorial https://rogercpress.wordpress.com/2012/ ... -tutorial/

What you need is check your mod file, in documets/my game/supcom/mod crete new folder with name of your mod, check some other mod copypast mod.info file, open it change name, author and ID for some other random.

And then create some new folder for example "units" where you would put your units that you want to change.

place where you found units is C/programdata/fafforever/gamedata -> folder units.nx2 rename on units.rar -> open it and copypast everything inside on some new folder that you have on desktop (then rename units.rar back on .nx2) this units are every units that was changed in FAF, but is dont contain every units, because some was not changed, and also dont containt every .lua file.

For this you need open folder with supcom/programdata/units.nx2 and make the same. take care dont take this 2 units pack on one folder, othervise it would be chaos.

Then open some units.bp with text editor (i use notepad++) and you have blue print of units, where you can change stats and etc.. information about with stat what change you found in tutorial that i send you.

Proper way how to change them is only copypast pasagge that you want to change and take merge function on start.

so it would looks like :

Code: Select all
#T2 AA flack

UnitBlueprint {
Merge = true,
BlueprintId = "ual0205",

   Economy = {
      BuildCostEnergy = 1000,
      BuildCostMass = 200,
      BuildTime = 1000,
   },
   Defense = {
        Health = 900,      #from 1000
        MaxHealth = 900,
    },
}


everything that is not here would be same as is in game -> that cause merge = true,

When you want to change something that is about behaviour of units, then you need check lua file of units, This parth must be on separate folder of your mode with "hook" name (probably) but about lua coding i have no clue, and only guessing how it can work.
"Fixed in Equilibrium" Washy
User avatar
Ithilis_Quo
Supreme Commander
 
Posts: 1390
Joined: 29 Dec 2012, 15:55
Location: Slovakia
Has liked: 395 times
Been liked: 181 times
FAF User Name: Ithilis

Re: How Do I Begin Modding

Postby Resin_Smoker » 09 Jun 2015, 14:29

Keep in mind that what's posted above is a MERGE for the unit blueprints only. This does not alter the unit or engine scripts. However that being said, it's an excellent way to start modding FA as many of the Unit spec's are called for and used throughout the game code. Understanding unit Blueprints will help you later when you need to script a function based off of or used for a unit.

Edit: it's not always required that you copy and paste entire files to make changes. Merge files are just that, it merges your new Blueprint changes directly into the original Blueprint but does not remove content, it Only overwrites what you supply. Hence copying entire files will work, it makes it very difficult to debug later and makes the file size unnecessarily large.

Edit: be aware that with FAF installed you technically have two copies of FA on your hard drive. The original and the FAF override... His is important to know because it will effect the error codes you'll see.

Example: if the original unit.lua is 5k long and you see an error code for line 5311, then your error resides in the FAF unit.lua line 311 not the original code. Sometimes this isn't always clear but seeing the pathing of the error log can definitely help in such situation.

Resin
Resin_Smoker
Evaluator
 
Posts: 858
Joined: 14 Mar 2012, 17:58
Has liked: 54 times
Been liked: 106 times

Re: How Do I Begin Modding

Postby ZeRen » 09 Jun 2015, 15:18

any example of MERGE?
User avatar
ZeRen
Evaluator
 
Posts: 641
Joined: 03 Aug 2014, 08:22
Has liked: 154 times
Been liked: 49 times
FAF User Name: ZeRen

Re: How Do I Begin Modding

Postby Ithilis_Quo » 09 Jun 2015, 16:05

ZeRen one example i take UP. as you see fist is my note with
# what is units name (this is only for me, line after # dont affect code)
then is UnitBlue print with { (this open code)
then merge = true, -> what say merge only what is abou
then code what to change,
and then end of code with }

important is take care for differences as } and ) and also that must be , on end of function, when dont open new one. also is differences betwen , and .
"Fixed in Equilibrium" Washy
User avatar
Ithilis_Quo
Supreme Commander
 
Posts: 1390
Joined: 29 Dec 2012, 15:55
Location: Slovakia
Has liked: 395 times
Been liked: 181 times
FAF User Name: Ithilis

Re: How Do I Begin Modding

Postby ZeRen » 09 Jun 2015, 16:14

Ithilis_Quo wrote:ZeRen one example i take UP. as you see fist is my note with
# what is units name (this is only for me, line after # dont affect code)
then is UnitBlue print with { (this open code)
then merge = true, -> what say merge only what is abou
then code what to change,
and then end of code with }

important is take care for differences as } and ) and also that must be , on end of function, when dont open new one. also is differences betwen , and .


thx ;)
User avatar
ZeRen
Evaluator
 
Posts: 641
Joined: 03 Aug 2014, 08:22
Has liked: 154 times
Been liked: 49 times
FAF User Name: ZeRen


Return to Mods & Tools

Who is online

Users browsing this forum: No registered users and 1 guest