Help: Defining Augments?


Sogaple

Recommended Posts

I have been getting into modding Invisible lately and ran into a bit of confusion when trying to figure out how Augments work. The modding notes in the "API Example" mod didn't actually say anything about augments, only items, so I had to dig a little myself. I found a bunch of augment descriptions in itemdefs.lua and ended up really baffled. Here's why.

Most Augments are looking perfectly normal, like Piercing Scanner for example:

    augment_piercing_scanner = util.extend( commondefs.augment_template )
    {
        name = STRINGS.ITEMS.AUGMENTS.PIERCING_SCANNER,
        desc = STRINGS.ITEMS.AUGMENTS.PIERCING_SCANNER_TIP, 
        flavor = STRINGS.ITEMS.AUGMENTS.PIERCING_SCANNER_FLAVOR,
        traits = util.extend( commondefs.DEFAULT_AUGMENT_TRAITS ){
            addArmorPiercingRanged = 1,
            stackable = true,
            grafterWeight = 10,
        },
        profile_icon = "gui/icons/item_icons/items_icon_small/icon-item_generic_head_small.png",
        profile_icon_100 = "gui/icons/item_icons/icon-item_generic_head.png",            
    },

(Agent gains extra armor piercing. Nothing out of the ordinary.)

However, other augments had NO TRAITS LISTED WHATSOEVER, besides the grafterWeight. Take, lets say, Microslam Apparatus.

    augment_microslam_apparatus = util.extend( commondefs.augment_template )
    {
        name = STRINGS.ITEMS.AUGMENTS.MICROSLAM_APPARATUS,
        desc = STRINGS.ITEMS.AUGMENTS.MICROSLAM_APPARATUS_TIP, 
        flavor = STRINGS.ITEMS.AUGMENTS.MICROSLAM_APPARATUS_FLAVOR,
        traits =  util.extend( commondefs.DEFAULT_AUGMENT_TRAITS ){
            grafterWeight = 4,
        },        
        profile_icon = "gui/icons/item_icons/items_icon_small/icon-item_generic_head_small.png",
        profile_icon_100 = "gui/icons/item_icons/icon-item_generic_head.png",            
    },

(Only grafterWeight is listed? What the hell?)

And this isn't the only one. A lot of other augments lack traits too. F.E. Prodactive Brawling and Chameleon Movement.

    augment_predictive_brawling = util.extend( commondefs.augment_template )
    {
        name = STRINGS.ITEMS.AUGMENTS.PREDICTIVE_BRAWLING,
        desc = STRINGS.ITEMS.AUGMENTS.PREDICTIVE_BRAWLING_TIP, 
        flavor = STRINGS.ITEMS.AUGMENTS.PREDICTIVE_BRAWLING_FLAVOR,
        keyword = "MELEE", 
        traits =  util.extend( commondefs.DEFAULT_AUGMENT_TRAITS ){
            grafterWeight = 10,
        },        
        value = 300, 
        profile_icon = "gui/icons/item_icons/items_icon_small/icon-item_generic_leg_small.png",
        profile_icon_100 = "gui/icons/item_icons/icon-item_generic_leg.png",            
    },    

    augment_chameleon_movement = util.extend( commondefs.augment_template )
    {
        name = STRINGS.ITEMS.AUGMENTS.CHAMELEON_MOVEMENT,
        desc = STRINGS.ITEMS.AUGMENTS.CHAMELEON_MOVEMENT_TIP,
        flavor = STRINGS.ITEMS.AUGMENTS.CHAMELEON_MOVEMENT_FLAVOR, 
        keyword = "CLOAK", 
        traits =  util.extend( commondefs.DEFAULT_AUGMENT_TRAITS ){
            grafterWeight = 10,
        },        
        value = 300, 
        profile_icon = "gui/icons/item_icons/items_icon_small/icon-item_generic_leg_small.png",
        profile_icon_100 = "gui/icons/item_icons/icon-item_generic_leg.png",            
    },    

(Where is the extra AP? Why isn't it listed?)

Then it hit me:

These Augments don't NEED a definition. They are simply checked for, whenever a specific action is performed. Prodactive Brawling (the item) is listed in itemedefs.lua with its title, flavor text, description and keyword. However, the effects of the item are listed in the script for melee attacks themselves. Whenever an agent attacks with a melee weapon, all augments with "MELEE" as a keyword are checked for (like Prodactive Brawling). If the augment is found, (Agent has Prodactive Brawling) the effect is applied (+ 6AP). Same with the Microslam Apparatus. The game ALLWAYS calculates the amount of money that comes from the % of map explored. Then it checks if an agent has the Microslam Apparatus and if yes, grants the money to the agency. I haven't really checked if this is true, since I don't know where the scripts for melee, cloaking, etc. are but its the best theory I have. After all, these Augments cant do nothing, right?

However... There are augments that just make no sense (even after applying the "checking theory"). One such augment is Nika's Adrenal Regulators:

       augment_nika = util.extend( commondefs.augment_template )
    {
        name = STRINGS.ITEMS.AUGMENTS.NIKAS,
        desc = STRINGS.ITEMS.AUGMENTS.NIKAS_TIP, 
        flavor = STRINGS.ITEMS.AUGMENTS.NIKAS_FLAVOR,
        traits = util.extend( commondefs.DEFAULT_AUGMENT_TRAITS ){
            extraAP = 1,    
            extraAPMax = 1,
            installed = true,
            addTrait = {{"actionAP",true}},            
        },        
        profile_icon = "gui/icons/skills_icons/skills_icon_small/icon-item_augment_nika_small.png",
        profile_icon_100 = "gui/icons/skills_icons/icon-item_augment_nika.png",        
    },    

(Why is extraAPMax listed? Why is extraAP listed? As far as I remember, Nika's augment didnt give extra max AP. It just gave +3 AP on any attack. Speaking of which, why isn't that listed? Or the second attack? Is it the added trait? Does "actionAP" mean "second attack"? Maybe they are checked when attacking but then I still don't understand why is extraAP and extraAPMax there.)

Well, instead of theorizing on what these might mean, I thought it would be better if I just asked the modding community.

Where is an Augment defined? In itemdefs.lua? Or is its existence simply checked from an outside source? Neither? Both?

Link to comment
Share on other sites

I understand your confusion. In the game code, AP actually stands for ACTION POINTS aka attacks per turn. The AP you're thinking of is defined as MP, movement points.

Whether you should define the function of your item in itemdefs or where it should be used depends on what you want to do. Those that are defined in itemdefs are stat moderating augments. Mp, ap and armorpiercingranged are all stats bound to the agent, not the item. Augments with on trigger effects and/or functions have to be defined in code to get the desired effect, which is why the "add ap on attack" effect is not visible.

Link to comment
Share on other sites

So, to create an item with a passive effect that increases armor piercing, speed, amount of attacks etc. I define it in itemdefs, while if I wan't the effect to only trigger at specific times, I define it... Where? I mean, it all depends on what I wan't to do, but is there any general guidelines?

Link to comment
Share on other sites

On 25.01.2016 at 10:37 PM, Sogaple said:

while if I wan't the effect to only trigger at specific times, I define it... Where? I mean, it all depends on what I wan't to do, but is there any general guidelines?

What about abilities, for augment itself or as ability given to host? I think those are very convenient, can have code to check for triggers like start/end of turn, being hit or shoot etc. Check scripts\sim\abilities\, mods and dlc for different ways how it used.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.