Aller au contenu

Photo

Start a conversation when I interact with a corpse?


  • Veuillez vous connecter pour répondre
9 réponses à ce sujet

#1
Psionic-Entity

Psionic-Entity
  • Members
  • 195 messages

Pretty much says it in the title. I'm trying to find a way to make an NPC die, leaving a persistent corpse that starts a conversation when you interact with it. So far I've found that no matter what faction I seat the dead NPC to, the only interaction I can get via clicking on the body is to loot via the lootable corpse method, and doing that opens up an object named "Remains" with tag "BodyBag" that has no connection to the dead NPC.

 

My current method involves spawning an interactable placeable where the dead body is, but the corpse models ingame aren't the greatest and I'd prefer to hook it right on to the dead body to make the system a little more modular. Any ideas?



#2
Loki_999

Loki_999
  • Members
  • 430 messages

Spawn an invisible object where the corpse is that you actually click on to spawn the convo. Call the object "Corpse" or whatever.  Have the corpse not decay and not be lootable.  Something like that anyway.



#3
Psionic-Entity

Psionic-Entity
  • Members
  • 195 messages

I did that originally but I wasn't a fan of being unable to highlight the body by pressing Z. I was hoping to find a way to hook on to the "loot" action and pull up a conversation instead of a container.



#4
Shallina

Shallina
  • Members
  • 1 011 messages

many way of doing it.

 

An object with 0 hp cannot speak or interact, which mean, the corps itself can"t do it.

you have to trick.

 

With an ipoint speaker for exemple, have the Ipoint speaker beeing the object you converse with. Now you need to launch the conversation with the ipoint speaker.

 

you can set a collision box around the corps and have it launch the conversation when it s left clicked.

you can use the on disturb inventory fonction of the corps to launch the conversation.

or perhpas the on left click on the corps.

 

There are many way of doing it, depending on what would be most apropriate for your need.



#5
Dann-J

Dann-J
  • Members
  • 3 161 messages

You could always fake his death. Set his hit points to 1, set SetOrientOnDialog() to FALSE, make him unbumpable, and apply a permanent knockdown effect. Then you can start a conversation with him without causing him to stand up again. You might want to change his name to something like 'Corpse' to complete the deception.

 

If you want to loot the corpse after talking to him, you can kill him via script on the last node of the conversation.



#6
Psionic-Entity

Psionic-Entity
  • Members
  • 195 messages

On inventory disturb doesn't work. When the creature dies a new object is created called "Remains" and somehow the game overrides interaction with the body to open this invisible object. The transfer of items doesn't trigger inventory disturb on the NPC, either.

 

Fake death seems promising, but so far I haven't been able to find the right sequence of effects to add to the "on death" event to make it work.



#7
Dann-J

Dann-J
  • Members
  • 3 161 messages

It won't work OnDeath, since you can't apply effects to dead creatures. Not unless you immediately raise them again and slightly delay the subsequent functions (which could be cludgy).

 

You'd be better off making the NPC immortal, and having an OnDamage script that detects when they fall to 1 HP. Then you'd be able to set up the fake death scenario. See the OnDamage script that trolls use as an example.

 

You'd probably also want to give the NPC the ethereal effect to stop anything trying to attack the 'corpse'. If the NPC is hostile to the player then you'll also want to change the NPCs faction so you can initiate conversation. A ClearAllActions(TRUE) loop on the party might also be necessary to break combat (although clearing all actions on GetLastDamager() might be sufficient).



#8
Loki_999

Loki_999
  • Members
  • 430 messages

Or add a new faction that every other faction is friendly with, that solves hostiles attacking the corpse.



#9
Dann-J

Dann-J
  • Members
  • 3 161 messages

Or add a new faction that every other faction is friendly with, that solves hostiles attacking the corpse.

 

Indeed. I often use such a faction for non-combatants, to prevent villagers, slaves or farm animals from trying to attack hostiles (and vice versa). Especially if you've just picked a fight with someone in a town or city, and you don't want every NPC within range to form an angry mob and make the fight too easy for the player. Although that's how I used to kill Noober without consequences in the original Baldur's Gate - turn off party AI and lead him to some town guards. They'd kill him for you.

 

A custom faction would require the use of a 'faction pig' to use it in a script, which is another layer of complexity. I often find the ethereal effect is easier, if I don't already have a custom faction and faction pig handy for other purposes. The one onion in the ointment is that creatures with True Seeing go crazy around ethereal creatures in an enemy faction - they can see them but they can't initiate an attack, so they run back and forth like headless chickens in frustration.



#10
Psionic-Entity

Psionic-Entity
  • Members
  • 195 messages

I had some trouble trying to set the "true neutral" faction via a faction pig (it didn't work despite verifying that the pig existed) so I went with the Ethereal approach. Especially helpful since true seeing isn't part of my setting. I had to drop immortality briefly to get the paralysis down but that was the only trouble. Right now it works exactly as I'd hoped.

 

Thanks for the ideas.