Forged Alliance Forever Forged Alliance Forever Forums 2015-07-26T12:04:00+02:00 /feed.php?f=41&t=10370 2015-07-24T21:49:41+02:00 2015-07-24T21:49:41+02:00 /viewtopic.php?t=10370&p=105528#p105528 <![CDATA[Re: Help a newbie modder]]> Statistics: Posted by quark036 — 24 Jul 2015, 21:49


]]>
2015-07-26T12:04:00+02:00 2015-07-24T21:40:39+02:00 /viewtopic.php?t=10370&p=105526#p105526 <![CDATA[Re: Help a newbie modder]]>
EDIT: So i went on to experiment and tried everything i could think of and looked at a lot of mods, but it still doesn't work.
Code:
do
local oldModBlueprints = ModBlueprints

function ModBlueprints(all_bps)
oldModBlueprints(all_bps)

#UEF

#hovertank
if all_bps.Unit.uel0203 then
   table.removeByValue(all_bps.Unit.uel0203.Categories, 'TECH2'),
   table.insert(all_bps.Unit.uel0203.Categories, 'TECH1'),
   table.insert(all_bps.Unit.uel0203.Categories, 'BUILTBYTIER1FACTORY'),
end

#medium tank
if all_bps.Unit.uel0201 then
   table.removeByValue(all_bps.Unit.uel0201.Categories, 'TECH1'),
   table.removeByValue(all_bps.Unit.uel0201.Categories, 'BUILTBYTIER1FACTORY'),
   table.insert(all_bps.Unit.uel0201.Categories, 'TECH2'),
end

#heavy tank
if all_bps.Unit.uel0202 then
   table.removeByValue(all_bps.Unit.uel0202.Categories, 'TECH2'),
   table.removeByValue(all_bps.Unit.uel0202.Categories, 'BUILTBYTIER2FACTORY'),
   table.insert(all_bps.Unit.uel0202.Categories, 'TECH3'),
end

if all_bps.Unit.uel0103 then
   table.insert(all_bps.Unit.uel0103.Categories, 'VEHICLE',),
end
   
end


I am really hoping someone can explain what i am doing wrong, because as far as i can see now, i am gonna have to do a lot of stupid things to get this working.

Statistics: Posted by CrazyDutchReaper — 24 Jul 2015, 21:40


]]>
2015-07-24T16:29:26+02:00 2015-07-24T16:29:26+02:00 /viewtopic.php?t=10370&p=105481#p105481 <![CDATA[Re: Help a newbie modder]]>
The code in Blackops Unleashed Balance Changes works, so you have a working reference and example. You need to have your code structured the same way as theirs and add you changes where it is appropriate.

Also, when you try to run your mod and the game gets all messed up; that is a good thing. That means somewhere very early in your code is a mistake or you have made a simple mistake (like missing a comma, bracket, or an end), which makes finding it very easy.


Edit*
The function table.removeByValue() could have possibly been renamed with all the changes that were done in the recent patch. To be safe, run your mod through the standalone FA (just start FA without going through the FAF online client). I am still trying to get an answer as what needs to be done with mods to get them compatible with this new patch.

Statistics: Posted by The Mak — 24 Jul 2015, 16:29


]]>
2015-07-24T10:50:30+02:00 2015-07-24T10:50:30+02:00 /viewtopic.php?t=10370&p=105446#p105446 <![CDATA[Re: Help a newbie modder]]>
Code:
do
   local oldModBlueprints = ModBlueprints

   function ModBlueprints(all_bps)
      oldModBlueprints(all_bps)
end

# UEF

#hovertank
table.remove(all_bps.Unit.uel0203.Categories, 'TECH2'),
table.insert(all_bps.Unit.uel0203.Categories, 'TECH1'),
table.insert(all_bps.Unit.uel0203.Categories, 'BUILTBYTIER1FACTORY'),

#medium tank
table.remove(all_bps.Unit.uel0201.Categories, 'TECH1'),
table.remove(all_bps.Unit.uel0203.Categories, 'BUILTBYTIER1FACTORY'),
table.insert(all_bps.Unit.uel0201.Categories, 'TECH2'),

#heavy tank
table.remove(all_bps.Unit.uel0203.Categories, 'TECH2'),
table.remove(all_bps.Unit.uel0203.Categories, 'BUILTBYTIER2FACTORY'),
table.insert(all_bps.Unit.uel0203.Categories, 'TECH3'),


i tried the table.removeByValue , but it doesn't seem to do anything either and apparantly its not an excisting command?
I don't want to look like i am having you do all the work for me or anything, but i simply have no idea why this is happening. . .

Statistics: Posted by CrazyDutchReaper — 24 Jul 2015, 10:50


]]>
2015-07-22T21:30:07+02:00 2015-07-22T21:30:07+02:00 /viewtopic.php?t=10370&p=105245#p105245 <![CDATA[Re: Help a newbie modder]]> Statistics: Posted by quark036 — 22 Jul 2015, 21:30


]]>
2015-07-22T20:35:35+02:00 2015-07-22T20:35:35+02:00 /viewtopic.php?t=10370&p=105225#p105225 <![CDATA[Re: Help a newbie modder]]>
Let us take your questions one at a time.

Q1
datim wrote:
But i have another question, a few attempts earlier i had done it like this, but i also had a lua file into the main folder, that didn't work however. So if you have a lua folder in your hook folder, you cannot have another lua folder in the main folder?


For changes to existing game files (such as armordefinition.lua), you should place them in a hook folder and then in the same directory structure you see in the game files.

If you create your own files that fall under a lua folder, then you create a lua folder under your mod directory. Again, and I cannot stress this enough, see examples done in other mods.


Q2
datim wrote:
Also, with the mod_units_UEF.bp , i tried to change the tech level of a unit, however i noticed that i need to use destructive hooking to fix this. Does this mean that i need to have the modunits folder in the hook folder as well? Or, in this case, can i have 2 modunits folders with one of them in the hook (and different name ofcourse) and one of them in the main folder?


This is correct. In a blueprint file, such as in Categories, there are all these text entries inside the array. Example:
Code:
    Categories = {
        'PRODUCTSC1',
        'SELECTABLE',
        'BUILTBYTIER1FACTORY',
        'BUILTBYTIER2FACTORY',
        'BUILTBYTIER3FACTORY',
        'CYBRAN',
        'MOBILE',
        'NAVAL',
        'TECH1',
        'DIRECTFIRE',
        'ANTIAIR',
        'ANTIMISSILE',
        'SUBMERSIBLE',
        'VISIBLETORECON',
        'RECLAIMABLE',
        'T1SUBMARINE',
        'OVERLAYSONAR',
        'OVERLAYANTINAVY',
        'OVERLAYDIRECTFIRE',
    },


So how do we go about removing 'TECH1' and then adding 'TECH2'? The adding in of 'TECH2' can be simply done with Merge blueprint. The removing of 'TECH1', well...

Option 1, Destructive hooking or "How not to play nice with other mods and have your changes be very hard to find"

Inside your hook folder, create a units folder.
Inside the units folder, you create a folder labeled with the unit id.
Inside the new folder labeled with the unit id, you copy over the original 'unit id'_unit.bp
Open up that 'unit id'_unit.bp file and make any changes you want.

If you have any other mods running and they change the same unit, then it will come down to the UID of the mod as to which will actually run. Sad time for me who usually plays with 70 or so mods at once. :cry:


Option 2, ModBlueprints or Non-Destructive Hooking or "How not to play nice with other mods and have your changes be very easy to find"

Inside your hook folder, create a lua folder.
Inside the lua folder, create a system folder.
Inside the system folder, create a file called Blueprints.lua

Now comes the part where you need to look at examples, *cough* BlackOps Unleashed Balance Changes *cough*

You begin in the Blueprints.lua file with this:

Code:
do
   local oldModBlueprints = ModBlueprints

   function ModBlueprints(all_bps)
      oldModBlueprints(all_bps)


From here you can specify a single unit:
Code:
      if all_bps.Unit.xsl0309 then


Multiple units, the smart way (hint, try to avoid repeating if all_bps.Unit.blaa blaa)
Code:
      local units_SCU = {
         'ual0301',
         'uel0301',
         'url0301',
         'xsl0301',
      }
      for scuid, buildcat in units_SCU do
         if all_bps.Unit[scuid] then


Multiple units, the smart way, with faction differences
Code:
      local units_SCU = {
         ual0301 = 'BUILTBYTIER4COMMANDER AEON',
         uel0301 = 'BUILTBYTIER4COMMANDER UEF',
         url0301 = 'BUILTBYTIER4COMMANDER CYBRAN',
         xsl0301 = 'BUILTBYTIER4COMMANDER SERAPHIM',
      }
      for scuid, buildcat in units_SCU do
         if all_bps.Unit[scuid] then


or units that have things in common:

Code:
for unitid, unitbp in all_bps.Unit do
         for k, cat in unitbp.Categories do
            if cat == 'HOVER' then



Now for your case, Categories is a table of values. So we have to first remove an entry:
Single unit
Code:
table.removeByValue(all_bps.Unit.uel0106.Categories, 'TECH1')

Multiple units, smart way
Code:
table.removeByValue(all_bps.Unit[unitid].Categories, 'TECH1')

Units that have things in common
Code:
table.removeByValue(all_bps.unitbp.Categories, 'TECH1')


Now we add an entry:
Single unit
Code:
table.insert(all_bps.Unit.uel0106.Categories, 'TECH2')

Multiple units, smart way
Code:
table.insert(all_bps.Unit[unitid].Categories, 'TECH2')

Units that have things in common
Code:
table.insert(all_bps.unitbp.Categories, 'TECH2')



Make sure to add all the end's you need to close each function, including the first do function at the top of Blueprints.lua


datim wrote:
Thanks again and i will definietly look into 'BlackOps Unleashed Balance Changes'.


For scripting help, which is another order above with modding SupCom, I recommend going through the mod '4DC FAF Release (v0.5)', the units folder (new custom units, not under the hook folder) and look at each units' _Script.lua file

Statistics: Posted by The Mak — 22 Jul 2015, 20:35


]]>
2015-07-22T13:39:39+02:00 2015-07-22T13:39:39+02:00 /viewtopic.php?t=10370&p=105175#p105175 <![CDATA[Re: Help a newbie modder]]>
But i have another question, a few attempts earlier i had done it like this, but i also had a lua file into the main folder, that didn't work however. So if you have a lua folder in your hook folder, you cannot have another lua folder in the main folder?

Also, with the mod_units_UEF.bp , i tried to change the tech level of a unit, however i noticed that i need to use destructive hooking to fix this. Does this mean that i need to have the modunits folder in the hook folder as well? Or, in this case, can i have 2 modunits folders with one of them in the hook (and different name ofcourse) and one of them in the main folder?

Thanks again and i will definietly look into 'BlackOps Unleashed Balance Changes'.

Statistics: Posted by CrazyDutchReaper — 22 Jul 2015, 13:39


]]>
2015-07-22T00:44:36+02:00 2015-07-22T00:44:36+02:00 /viewtopic.php?t=10370&p=105124#p105124 <![CDATA[Re: Help a newbie modder]]>
Place your lua folder into a folder labeled hook.

When doing merge blueprints with weapons, keep in mind that each weapon of a unit is an array, and they are stored in a master array called Weapon. So if a unit has three weapons, there are three sub-arrays (one for each weapon) all under the Weapon master array. So when you modify a weapon, you need to specify which weapon array you want to edit. Now for your unit it is quite simple, 1 weapon, which means 1 sub-array to the Weapon master array. Let us say we have a unit with four weapons, and we want to only change the second weapon to have your DamageType.

It would look like this:
Code:
Weapon = {
      {},
      {
         DamageType = 'D_UEF_Machinegun',
      },
      {},
      {},
},


Notice how we have empty arrays in the merge blueprint. This means I do not want to touch any aspect of those particular weapons.

If you want your DamageType to apply to all weapons of a unit, it would look like this.
Code:
Weapon = {
      {
         DamageType = 'D_UEF_Machinegun',
      },
      {
         DamageType = 'D_UEF_Machinegun',
      },
      {
         DamageType = 'D_UEF_Machinegun',
      },
      {
         DamageType = 'D_UEF_Machinegun',
      },
},



I highly recommend you download the mod 'BlackOps Unleashed Balance Changes' and look through the files that start with mod_units. This is where I have learned most of my material when it comes to blueprint merging.

Here is your mod with the necessary changes.

Statistics: Posted by The Mak — 22 Jul 2015, 00:44


]]>
2015-07-21T23:23:53+02:00 2015-07-21T23:23:53+02:00 /viewtopic.php?t=10370&p=105113#p105113 <![CDATA[Re: Help a newbie modder]]> http://www.filedropper.com/microcommander

You'll also see my bad attempt at trying to change the tech level of a unit, after more research i found out that instead of merging i am going to have to use destructive hooking to make it work, so i will change that later. (i am a real newbie at supcom modding :? )

Statistics: Posted by CrazyDutchReaper — 21 Jul 2015, 23:23


]]>
2015-07-21T23:16:40+02:00 2015-07-21T23:16:40+02:00 /viewtopic.php?t=10370&p=105112#p105112 <![CDATA[Re: Help a newbie modder]]> Statistics: Posted by The Mak — 21 Jul 2015, 23:16


]]>
2015-07-21T19:20:18+02:00 2015-07-21T19:20:18+02:00 /viewtopic.php?t=10370&p=105086#p105086 <![CDATA[Help a newbie modder]]>
I have recently started modding supcom fa and have come accross a bit of a road block and require help.
I am currently trying to implement different armor and damage types into the game to increase the depth of the game. For example: a tank-like unit would be better suited to take out another tank-like unit.
Unfortunately, the armor system doesn't work at the moment.

All that i have made so far is inspired by this tutorial http://supcom.wikia.com/wiki/Mod_Help because i haven't been able to find anything that resembles this type of modification.
armordefinition.lua code (slimmed down):
Code:
armordefinition = {
#UEF Land
{   # Damage Type Name UEF Machinegun
      'D_UEF_Machinegun',
      
      # Armor Definition
      'Normal 1.0',
},
{   # New Armor Type Name UEF MediumTank
      'A_UEF_MediumTank',
      
      # Armor Definition
      'D_UEF_Machinegun 0.01',
},
}

Following the tutorial, this should mean that any unit with D_UEF_Machinegun as a damage type would do 0.01 times the damage against a unit with A_UEF_MediumTank armor type.
I am trying to implement it through merging
mod_units.bp code:
Code:
#uef,
   UnitBlueprint {
   Merge = true,
   BlueprintId='uel0106', # mech marine attack change
   Weapon =
      {
      DamageType = 'D_UEF_Machinegun',
      },
   }
   
#uef,
   UnitBlueprint {
   Merge = true,
   BlueprintId='uel0201', # ma12 striker armor change
   Defense =
      {
      ArmorType = 'A_UEF_MediumTank',
      Health = 900,
                MaxHealth = 900,
      },
   }

Using this to merge it with the existing mech marine and ma12 striker nothing happened, so i added heatlh to it to test whether it actually works at all and the ma12 striker actually had 300 -> 900 hp which means that the merging itself works.
Unfortunately, the armor/damage system still does nothing and although i have a hunch its to do with the armordefinition.lua file, i still have no idea why it doesn't work nor how to fix it.

So i am hoping that the more experienced modders/programmers could help me out on this one. Is it a problem with the code? Or does the nature of the game itself make it impossible to do?

Thanks in advance!

Statistics: Posted by CrazyDutchReaper — 21 Jul 2015, 19:20


]]>