T1 Point Defence (Shielded)

Everything about mods can be found here.

Moderator: Morax

T1 Point Defence (Shielded)

Postby legolash2o » 30 Jul 2018, 20:07

Hi,

I was wondering how I would go about adding a modified version of an original building?

For example, I want to create a T1 point defence and anti-air with a shield (not a dome shield) with the ability to turn it off and on.

Thank you. :)
legolash2o
 
Posts: 2
Joined: 30 Jul 2018, 20:05
Has liked: 0 time
Been liked: 0 time
FAF User Name: Legolash2o

Re: T1 Point Defence (Shielded)

Postby Franck83 » 30 Jul 2018, 23:19

Hi Legolash2o,

You need to edit 2 files (your unit blueprint .bp and your unit script .lua)

You got 2 shields type :

Creating a bubble shield on turret is easy. You can set a small bubble size.

Image


If you don't love bubbles, about personal shield (with shader effect), you can take a look at UEF ACU blueprint (UEL001 unit bp), there are the 2 shield types :

Image

The first one (shield) is personal (the type you want to do) and the second (shieldgeneratorfield) the bubble one.
Logically, the difference is that for the personal shield you need to give the mesh path for the shaders fx (in UEF ACU for example)
Code: Select all
OwnerShieldMesh = '/units/uel0001/UEL0001_PhaseShield_mesh'

Logically again, You have no size and no impact shield hit to give.

Modding the bp is different if your shield is and enhancement (same as UEF) or set at unit creation (you just need to add the shield bp, take a look at mobile shield bp from uef, aeon or sera)


Then, You need to add code script (lua) on your unit :

If the shield is an enhancement, you can add this code to your unit script in the enhancement part (or you need to write the enhancement part):
It's about the toggle icon, the energy consumption and the remove shield script.

Image



If the shield is on unit creation you can add it in the following function in your unit script with your shield bp.

Code: Select all
   OnStopBeingBuilt = function(self, builder, layer)
   -- your shield script
    end,


Ask if you need help, idk your modding skills :)
Alliance of Heroes Mod is out ! Try it ! It's in the Mod Vault !
User avatar
Franck83
Evaluator
 
Posts: 538
Joined: 30 Dec 2016, 11:59
Location: France
Has liked: 114 times
Been liked: 122 times
FAF User Name: Franck83

Re: T1 Point Defence (Shielded)

Postby Uveso » 31 Jul 2018, 01:45

As example, there are 2 units (not ACU or SACU) with personal shields in the game:

uel0303 ( UEF Heavy Assault Bot )
ual0202 ( AEON Heavy Tank )
User avatar
Uveso
Supreme Commander
 
Posts: 1788
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 70 times
Been liked: 291 times
FAF User Name: Uveso

Re: T1 Point Defence (Shielded)

Postby legolash2o » 31 Jul 2018, 11:59

Thanks for the info! I appreciate the effort!

I've never modded before so I have no idea where to even begin if I'm honest. What tool do I use? notepad? and where are the blueprint .bp and script .lua please?

EDIT: Just found this guide and will give it a go. http://supcom.wikia.com/wiki/Unit_Creation
legolash2o
 
Posts: 2
Joined: 30 Jul 2018, 20:05
Has liked: 0 time
Been liked: 0 time
FAF User Name: Legolash2o

Re: T1 Point Defence (Shielded)

Postby Franck83 » 31 Jul 2018, 12:58

So welcome in modding section !

Your link is a good link to start.

Modding guide https://wiki.faforever.com/index.php?title=Modding
For blueprints: http://supcom.wikia.com/wiki/Blueprint
For weapons: http://supcom.wikia.com/wiki/Blueprint/Weapon
For easy access to .bp files using unit names: http://direct.faforever.com/faf/unitsDB/

I use notepad ++ with visual studio skin that color lua key words

The mod rep is here by defaut :
Code: Select all
C:\Users\yourname\Documents\My Games\Gas Powered Games\Supreme Commander Forged Alliance\Mods

Process step by step. First you need to know how to hook. Download very simple mods close to your needs (that mod 1 unit) to study them (mod name, hook rep...)

Units from faf are in the units.nx2 package from gamedata FAF. Just rename it as zip then unzip it. You will have access to units bp and lua.

If you didn't succeed with reasonable efforts, tell it, i plan a tutorial series on start modding since a long time, maybe it's time to start it.
Alliance of Heroes Mod is out ! Try it ! It's in the Mod Vault !
User avatar
Franck83
Evaluator
 
Posts: 538
Joined: 30 Dec 2016, 11:59
Location: France
Has liked: 114 times
Been liked: 122 times
FAF User Name: Franck83


Return to Mods & Tools

Who is online

Users browsing this forum: No registered users and 1 guest