Jump to content
The Dark Mod Forums

Using trigger_hurt on knocked out AI


Goldwell

Recommended Posts

After reading the wiki it states that trigger_hurt will inflict damage to both players and AI however if I knock out a guard and throw them down into a pit it does not kill them.

 

Previously i've bound a func_activator to the AI however sometimes the activator seperates from the entity so I don't believe that's the best solution.

 

Does anyone know of a solution that isn't taxing (like a constant entity check) that can hurt/kill/fail an objective if an AI is thrown down a hole?

  • Like 1
Link to comment
Share on other sites

One way of doing it would be to setup a custom stim on an entity in the pit, the bounds of the stim defined to be a box that fills the pit, and put responses on the AIs to kill _SELF. If you have a lot of AIs you can speed up the application process by setting up one AI, then copy-pasting the spawnargs when you have all AIs selected.

 

The stim on the pit entity could fire every 2s to keep the load low. And to see how to define a box-shaped stim, take a look at the damage stim on the cellar furnace in Inn Business.

 

 

Edit: it can just be a simple radius if the pit bottom is separate from other parts of the map, no need then to carefully define a box.

Edited by Dragofer
  • Like 1
Link to comment
Share on other sites

I don't think you need a trigger_hurt (//or stim) to kill an AI by throwing them down a pit.

Simply place some [no-draw] water at the bottom of the pit and they will drown, even if the pit is too shallow to kill them as a "normal" long drop would.

//the only downside might be a "splash" noise [replace with "thud"?] when the bodies hit the floor, or - if the pile of bodies is big enough - they won't drown, because they won't be underwater...

Edited by teh_saccade
  • Like 2
Link to comment
Share on other sites

Simply place some [no-draw] water at the bottom of the pit and they will drown

 

The downside to that is that it takes a while before they die, so the player might walk away from the pit after having done the deed thinking it was fine, then 20s later the mission fails. But I do agree with the concept, that the most efficient solution would be some kind of kill surface.

 

 

Could it be that the original problem is, that the AI gets exchanged with a ragdoll and the ragdoll ist not susceptible to damage? I am not sure, just guessing. Maybe you could test it by trying to kill a KOed guard by hitting it with the sword.

 

Unconscious ragdolls are still alive and can be killed by normal means (had to test this recently), so this shouldn't be a problem; they also continue using the name of the AI. Though I don't know for sure whether they keep the stim/response settings of the AI.

  • Like 1
Link to comment
Share on other sites

Probably more straightforward would be to copy the damage stim setup from Inn Business' furnace, with 'magnitude' turned up to a very high level.

  • Like 1
Link to comment
Share on other sites

Thanks for the responses everyone, I tried to implement the damage stim setup form the Inn Business furniture and while it is happy to inflict damage to the player it does nothing to the unconscious AI.

 

I'm assuming that something happens with the ragdoll that still enables the player to kill it however environmental damage seems to be absent in this case. Trying the nodraw water idea doesn't seem to do anything either.

 

edit: for anyone that may look back on this in the future, I solved the problem by making the hole really deep and the AI naturally dies from fall damage.

Edited by Goldwell
  • Like 2
Link to comment
Share on other sites

Looks so far like the custom stim setup is the way to go then. All it does is that the pit entity checks every 2 seconds whether any of the AI are within a certain radius of it, if there is one then the response on the AI will be to kill _self (or if that doesn't work, just directly fail the mission by triggering a set_objective_state entity).

 

Pit entity:

- Custom stims tab: create new custom stim

- Stims tab: apply the custom stim to the pit entity. Radius i.e. 200 units, time interval 2000ms.

 

AI entities:

- Response tab: apply the custom stim, right-click add response effect 'kill' '_SELF'.

- Copy-paste the s/r spawnargs from this AI to all the others.

Edited by Dragofer
Link to comment
Share on other sites

I took another look into some def files and could actually not find the def for an unconcious ragdoll. Maybe this would give some indication why weapon damage works, but environmental damage does not. Maybe you have to specify the damage type of the environmental damage to some sort of weapon damage?

  • Like 1
Link to comment
Share on other sites

 

edit: for anyone that may look back on this in the future, I solved the problem by making the hole really deep and the AI naturally dies from fall damage.

You mean to say that you didn't already try that?!

 

Making the pit deep enough to kill?

 

:P

 

Sorry, but I'd've thought that was the 1st thing to think of...

 

Made me lol.

 

"even if the pit is too shallow to kill them as a "normal" long drop would." hehe :)

Edited by teh_saccade
  • Like 1
Link to comment
Share on other sites

Could've been that Goldwell didn't plan his mission well enough and realised that the pit would be straight above the dining hall. Can't have the pit open out onto that, this isn't Dwarf Fortress after all, which puts a damper on how deep the pit can be. Always need to anticipate all kinds of scenarios when people ask questions on the forums.

Link to comment
Share on other sites

lateral problem solved in literal sense)) xaxa

 

 

 

 

 

teh_saccade I played levels u sent me. Preskrasny elegant i modnik uroven. horosho rabota.

 

There is a issue in one area with revolving room for split paths after secret objective fail you ask force.

 

Wall does not line correct. Door you can see inside the wall.

 

I email u report.

 

Some men have answer and last word everything.

 

Save your breath.

  • Like 1
Link to comment
Share on other sites

I took another look into some def files and could actually not find the def for an unconcious ragdoll. Maybe this would give some indication why weapon damage works, but environmental damage does not. Maybe you have to specify the damage type of the environmental damage to some sort of weapon damage?

This is the thing.

KO'd ragdolls die underwater (drown), but you can pile them up over "a fire" that hurts the player and it does nothing.

 

Perhaps I am mistaken, but I think you are right Destined - only certain types of environmental damage affects the "KO'd" AI and ... killing them - Throwing them onto a spear trap doesn't kill them... however crushing them does.

 

Problem is - then it lags the game as a dozen ragdolls are "trash compacted" and defy physics in the paths they choose to break free from the binds (or glitch through them and fall out of bounds...). Severe FPS drop when I "trash compacted" a bunch of bodies just now.

 

"Spear" pit-fall trap that injures/kills player/ "live AI" doesn't work on KO'd bodies. Idk why. Can't figure it and it's not relevant to me, so...

 

Anyway... He solved his problem.

Moot point... :)

Link to comment
Share on other sites

lateral problem solved in literal sense)) xaxa

 

 

 

 

 

 

teh_saccade I played levels u sent me. Preskrasny elegant i modnik uroven. horosho rabota.

 

There is a issue in one area with revolving room for split paths after secret objective fail you ask force.

 

Wall does not line correct. Door you can see inside the wall.

 

I email u report.

 

Some men have answer and last word everything.

 

Save your breath.

 

Funny:)

TY - but pls - discuss only outside forum.

 

I was just writing to you to say, "I found a problem with the door alignment" in the choice/consequence-rooms - attached new text to dmap.

 

Sorry to hijack thread.

Edited by teh_saccade
  • Like 1
Link to comment
Share on other sites

Lol you guys....

There is something special about this pit requiring it to be swallow. I'm avoiding details for spoiler reasons but the problem I was having, was it needed to be a short hole AND still kill the AI. That was the specific issue this thread was trying to solve as the title reads "using TRIGGER_HURT on knocked out AI"

I know that making the hole deep would have killed the AI (which is why I added the edit to avoid any confusion for those looking up this thread in the future) but that's not what I was looking for originally however it's what I settled on as my original problem remains unsolved.

Regardless I've gone another route and changed this aspect of my mission around to suit a long hole, it wasn't what I originally wanted but it works so such is life :)

Thanks for your help everyone!

Edited by Goldwell
  • Like 2
Link to comment
Share on other sites

(I think "KO'd AI" aren't "AI" - they're a different "thing" in that "state" and that's why it didn't work, eg, I gotta delete the "KO'd" "person and "spawn" "new AI" - open a "secret door" and let him "walk out" with a new routine - if I want to "wake up" a "KO'd" "AI" after an "event")

Adapt and overcome - like it.

Maybe if I finish the "running the gauntlet" section in time, get all the traps working again... I'll send you the .map code for the pitfall trap, cos that can kill player and AI instantly (esp if the spikes are close together / trap is scaled 1/4 and placed 4x so no chance to "fall between gaps") if I can get it working on "KO'd" - not on my list of things to do, but it was a barrel of laughs last night making the trash compactor and watching the ragdolls fly around the place, so cheers for that :)

"airquote".
Edited by teh_saccade
Link to comment
Share on other sites

(I think "KO'd AI" aren't "AI" - they're a different "thing" in that "state"

 

I remember getting really odd results when trying to feed ragdolled AI to my crafting script: it's meant to detect the classes of entities that enter the trigger volume, and in this case the entity was detected as multiple instances of classes from (if I recall correctly) darkmod/AI/Internal/.

 

So much for my Punch and Judy show. :mellow:

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Link to comment
Share on other sites

Sounds like you've found a solution, Goldwell. I've actually had a similar problem to this. I'm sure there is a way to "kill" a ragdoll with a objective location that triggers a script that does damage to the ragdoll or simply kills it.

 

Did you try using the different damage defs on the trigger hurt? I've had some problems with those triggers being fickle about the damage type...

 

I know that fall damage is something that's pretty hard to manipulate in the engine. I think it's hard coded in. It might be possible to use a trigger push on the pit to increase the velocity of the ragdoll, but that might be pretty hacky :)

Edited by kingsal
  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 6 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
    • nbohr1more

      Looks like the "Reverse April Fools" releases were too well hidden. Darkfate still hasn't acknowledge all the new releases. Did you play any of the new April Fools missions?
      · 5 replies
×
×
  • Create New...