Page 1 of 1

Removing Enemy Armor

Posted: Thu Dec 18, 2014 10:54 pm
by Ranakastrasz
I was trying to do some experiments on trying to make Bullets remain effective for the whole game, as well as a few other tweaks to alter combat balance, and I decided that, aside from adding more tiers of bullets, removing enemy armor, and increasing health might have an interesting effect.

However, I was unable to figure out how to alter/add those effects. I managed to alter the health, although it doesn't display the mod's name like it does for other mods.

Code: Select all

   data.raw["unit"]["small-biter"].max_health = 15
   --data.raw["unit"]["small-biter"].["physical"].decrease = 1
    --[[{
      {
        type = "physical",
        decrease = 0, -- 0
      },
      {
        type = "explosion",
        percent = 0 -- 0 
      }
    }]]
   data.raw["unit"]["medium-biter"].max_health = 125 -- 75
   --[[data.raw["unit"]["medium-biter"].resistances = 
    {
      {
        type = "physical",
        decrease = 0, -- 4
      },
      {
        type = "explosion",
        percent = 0 -- 10
      }
    }]]
   data.raw["unit"]["big-biter"].max_health = 500 -- 375
   --[[data.raw["unit"]["big-biter"].resistances = 
    resistances = 
    {
      {
        type = "physical",
        decrease = 0, -- 8
      },
      {
        type = "explosion",
        percent = 0 -- 20
      }
    }]]
   data.raw["unit"]["small-spitter"].max_health = 10 -- 10
   --[[data.raw["unit"]["small-spitter"].resistances = 
    resistances =
    {
    }]]
   data.raw["unit"]["medium-spitter"].max_health = 75 -- 50
   --[[data.raw["unit"]["medium-spitter"].resistances = 
    {
      {
        type = "explosion",
        percent = 0 -- 15
      }
    }]]
   data.raw["unit"]["big-spitter"].max_health = 300 -- 200
   --[[data.raw["unit"]["big-spitter"].resistances = 
    {
      {
        type = "explosion",
        percent = 0 -- 30
      }
    }]]
I've tried several permutations, but none of them appear to be valid, and I lack the LUA experience required to figure out why. I am unsure how to even determine what I need to do.

Re: Removing Enemy Armor

Posted: Thu Dec 18, 2014 11:07 pm
by Rahjital
Try this:

Code: Select all

data.raw["unit"]["medium-biter"].resistances = nil

Re: Removing Enemy Armor

Posted: Fri Dec 19, 2014 6:54 am
by n9103
although it doesn't display the mod's name like it does for other mods.
Pretty sure this is because you're not doing anything to the actual definition of the biters, but changing the working interpretation of their definition.
... If that makes any sense, great, but I feel like it's a bit circuitous.

Re: Removing Enemy Armor

Posted: Fri Dec 19, 2014 2:45 pm
by Ranakastrasz
That does work. However, I am still interested in learning how both how to edit those values, and more importantly, how to myself figure out what the correct string is to access any particular variable.

Re: Removing Enemy Armor

Posted: Fri Dec 19, 2014 4:48 pm
by n9103
There's not really any one string to do that (that I know of).
All actions directed at variables have to be in a specific context.
Additionally, there are read only variables and such in the code that can't be altered.

Not sure if that's what you're talking about, but seems like it.
In either case, I would recommend looking at other mods' control files and/or the wiki (somewhat out of date) to find references to what you're looking for.