Help: Killing or KOing Agents with items.


Recommended Posts

Ok, first of all, thank you so much for all the support that was given to me in the past few weeks. This community has helped me overcome a lot of roadblocks, and shown me a lot of ways for solving future problems.

Unfortunately, with shame, I must admit I'm stuck again.

I entered Invisible modding with a particular mindset;

"This is a game of stats and variables. If an ability, trait or stat is used somewhere, It can be taken from there, and inserted somewhere else. By mixing and editing existing scripts, It is possible to come up with something new."

So, with that mindset, It basically boiled down to finding the thing I needed.

Well...

That was debunked a week or so ago, when in my "Adding extra augment slots with augments.", I was shown that certain scripts may have to be written completely differently to work in other LUA files. So while there was plenty of different scripts I could reference, the chances that they would work in the context that I put them in were minimal. This clipped the wings of a lot of my more ambitious ideas, as I was restricted to only using scripts that were proven to work in the right context. Anything that wasn't used in the context I needed it to, would most likely not work at all.

F.E. Death and KO.

From my previous posts, you might have figured out that I have been working on some augments. The gist of it is that I was trying to make an augment which would be highly rewarding in the long term, but extremely liable in the short term. One that would grant great perks, but in exchange kill (or KO for a long period of time) your Agent upon installation.

This proved rather problematic, as KO and Death were never used in context of items or augments.  They were only used in the context of Enemies (getting shot causes Death), Doors (standing behind a door when it’s being breached results in KO), Shock Traps (Walking through a door with a Shock Trap on it causes KO) and Augment Machines (Adding new augment sockets results in KO).

I looked through commondefs to see if KO and Death were stats that were listed in the default agent template. The only thing listed was unfortunately "wounds" and "woundsMax". Looking into the Med-gel script revealed that it works by reducing wounds, so I assumed that the game checks if the user has "wounds" higher than "woundsMax" and kills the agent if so. I used modTrait (thanx user wodzu_93!) to mod the amount of wounds on the agent when they install the augment, but to no effect. My Agents were standing there all fine and dandy, even though their wounds were above their "woundsMax" capacity.

This made me wonder why the wounds stat was even there in the first place, if it had no effect on the Agents state, and came to the only conclusion I could think of. KO and Death were the same thing, and "wounds" determined if the Agent was knocked out or dead.

This left me with my old problem however; KO'ing your Agent was never used in any of the augments or items, so I was pretty much lost. There was no stat describing if an Agent was KO'ed in the "basic_agent_traits" section of the "commondefs" file, so using "modTrait" would really only work on the number of "wounds". Augment grafters also had the ability to KO the user, but like I found out in my previous thread, these scripts vary greatly in between different LUA files, and copying it from there just wasn't gonna cut it.

The only item that (as far as I know) could knock out friendlies was the Flash Grenade. I tried to apply its effects to the augment, but while the game didn't crash on me, nothing happened. I guess that installing augments doesn't count as using an item, so the effect didn't apply.

Any help?

Link to comment
Share on other sites

I used killing of "agent" in "Lone Start" mod via ability "lonestart" that make "unit:killUnit( sim )" at start of turn - literally kills him (empty "agent" have no common agent's traits and "body" is undetectable, but when he had regular traits, there was a nice blood spot heh), I think if you search through different codes, for grenades or shocktraps etc, you'll find if there something like "unit:KOunit" possible or not. I think there was something and you can mix it with triggers that will be added by augment's trait "addAbilities = "new_ability_name".
There also could be some complications with "down" state, when agent can be saved by med-gel or evacuation and "dead" state when he can't (like Courier or enemy). Or not, for me it was harder to find what makes latter state (I forgot already which one, maybe it was a "canBeCritical = false," trait, maybe something else).
 Software with "Search in files" function can be useful: I use Notepad++ to search for guesses sometimes, without knowledge if something like "killUnit" already exist or not. Developers commentaries often contain direct explanations how things a bit obscured by trait names are works. Searching for all files that refering to something is educational too.

About "wounds" my guess is that it's like a hp check on being hit, but while there's no events happened that can trigger that check nothing happens.

Link to comment
Share on other sites

Actually useAugmentMachine.lua line "userUnit:setKO( sim, 2 )" should work. Is it didn't worked? 
Do you want that paralizing effect just once, on install? Is this augment will be available in Shops or only in Grafters or in both? For grafters it sound easy to add it as another elseif check, but for other options.
I guess question is, "what will be most convenient trigger?".

I didn't like next idea much because it changes default abilities, but why not actually: make new useAugmentMachine.lua and installAugment.lua both with new lines to check, if it's specific augment - KO or kill on install.

Solution via new ability or something that not changes default files could be much cooler of course (in a way of maximum compatibility with any other mods). But ability trigger probably will not count until augment installed, and it will be too late for it when augment already installed.
Hmmm, it's needed to be checked: is there a way to add new ability as default for all agents (using modApi to add it commondefs.lua but not just overwrite all file) or not, if yes, it could be a solution.

Trigger also can be added to some default ability that everyone have and it's not something that expected to be modded by someone else, those like 

local DEFAULT_AGENT_ABILITIES = { "shootOverwatch", "jackin", "overwatch", "peek", "escape", "melee", "disarmtrap", "overwatchMelee" , "meleeOverwatch", "observePath", "moveBody", "lastWords"  }

^^ reminds me how noobishly I overwrite "melee" in Dr.Pedler mod btw, I guess it needed to be redone to work without overwriting it.

 

And I forgot that any theory require experimentations with triggers: what can be used, only TRG prefixed stuff from simdefs.lua or any event like EV_UNIT_INSTALL_AUGMENT =\

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.