Where are the augments?


Psykarp

Recommended Posts

Right off the bat: I have very little "real" coding experience, but I feel like I kinda know what I'm doing most of the time when working without instructions. I figured I'd start with trying to do an augment, since I don't usually use items in runs anyway. I had an idea for an augment that would knock out/kill (whichever is easier to code) an agent when they were seen by a guard, and was going to go about this by copying Decker's Archive augment (that gives him extra AP when seen) and replacing "giving AP" with "K.O./Death". Just telling you this because I'll probably need more help in the future.

Anyways, before I could do any of that I need to know where I would find augments in the code. I searched around a bit but I seem to be blind. If someone could give me the file location/line number of the augments that would be great. Thanks.

(PS. I'm going on the assumption that augments have a specific spot where they are run from, like in the API example mod, where there's a file named voight_scan. If that isn't the case, please tell me.)

Link to comment
Share on other sites

Right off the bat, I highly suggest you get a decent text-editor that has some IDE-ish functionality. Atom or Sublime 3 (Notepad++ is really meh now that Atom exists) are good choices, though I would suggest Atom because it's lightweight and everything in it is hackable. Atom is also free. Do that, and once you decompress the scripts folders for the base game and the DLC, you can add them as project folders to one window and search everything easily.

I recommend all that because if you don't have a way to search through all of the scripts files easily like that, you're gonna be hopelessly lost. That's because all of this code is really well broken-up into logical bits/classes. For example, all of the associated text with an item isn't just left as strings inside the code that defines an item, it's all held in strings.lua and those strings are referenced. So there's where one piece of the puzzle that is an augment. Other things are elsewhere. The code in itemdefs.lua merely defines the associated text strings, cost, traits, where associated assets are (images/thumbnails), and the abilities that it confers. Those abilities are, you guessed it, defined elsewhere in another file.

So with a proper editor, you should be able to start reading the code and sussing-out where everything is. You could start by searching for, say, "augment", then looking at the neural_scan ability and finding where that stuff is all defined by searching for "neural_scan" (which you would find is in neural_scan.lua ), etc. So I guess you could say the general lay-of-the-land is that the item is defined in itemdefs.lua, if you want to put it on an agent you'll need to fiddle with agentdefs.lua, you'll need to put your text in strings.lua, and the new ability gets it's own file/class in the root directory.

 

In short...sorry, there is no one place where all the code for an item exists. I mean, technically there's nothing stopping you from doing that, but it would be woefully bad practice to do that and not follow the very good coding practices that Klei have used in building this stuff. Besides, bad-habits and all that. The way they've structured everything does a very good job of avoiding any code duplication (which is really, really, really, really bad and you should never do it, not even once...most people in here probably know that but it's worth repeating), and keeps each block of code doing generally one specific task and that's it (with similar bits being grouped together in files). Put your OO-hat on, or something.

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.