Author Topic: All About Corpses  (Read 791 times)

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
All About Corpses
« Reply #15 on: November 05, 2012, 05:35:23 pm »


               Frimble, that is a nice way to do this, but it would be in addition to the placeable corpse.

The problem however is how you handle putting the corpse back down. There are systems that do that, but from what I have seen, the scripter has to ensure that the creature is killed again when you put the corpse back down. I don't like the look or sound of the creature being killed once again everytime you drop a corpse.
               
               

               


                     Modifié par henesua, 05 novembre 2012 - 05:39 .
                     
                  


            

Legacy_Frimbleglim

  • Newbie
  • *
  • Posts: 46
  • Karma: +0/-0
All About Corpses
« Reply #16 on: November 05, 2012, 06:03:42 pm »


               I think you missunderstand me henesua.  I'm not suggesting letting the ressurection spell be targeted at actual corpses.

Items placed on the ground can be targeted by spells.  you just get a line of text telling you they are not a valid target.

presumably you could write a script as follows:
1 is the spell ressurection?
if yes is there an item called corpse of Joe Bloggs within 10 feet?  
if yes then delete that item and spawn Joe Bloggs at items location.
Remove all gear from Joe Bloggs
end

Alternitively you could use the corpse placable
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
All About Corpses
« Reply #17 on: November 05, 2012, 06:10:07 pm »


               no, i'm just thinking about how the item looks on the ground. '<img'>
I'm being shallow and focusing on aesthetics. '<img'>

I do use floor models that look like corpses for some corpse items, so in Arnhiem this could work for players. The corpse item is a pointer to the player (who is in limbo in the OOC lounge).

But for NPCs I don't have enough corpse models to cover all the bases. Since that is the case using the creatures actual model looks the best.
               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
All About Corpses
« Reply #18 on: November 05, 2012, 06:13:54 pm »


               You could avoid the corpse all together, and have the creature remain alive but unable to move.  Looting would be done through pick pocket and resurrection would be handled through the OnSpellCastAt event.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
All About Corpses
« Reply #19 on: November 05, 2012, 06:18:34 pm »


               now that is thinking outside the box. '<img'>
               
               

               
            

Legacy_Failed.Bard

  • Hero Member
  • *****
  • Posts: 1409
  • Karma: +0/-0
All About Corpses
« Reply #20 on: November 05, 2012, 06:32:18 pm »


               Alive but unable to move will result in the creature only displaying right to people in the area when it's placed down though, won't it?  The same way "statues" using frozen creature objects are almost never in the proper animation when you leave sight of them and come back.

 Aside from the poor way NWN handles animations likely messing with it in implimentation, I do like the concept of the idea.
               
               

               
            

Legacy_Guest_Scrotok_*

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
All About Corpses
« Reply #21 on: November 24, 2012, 04:28:01 pm »


               Hey all!  Haven't worked on my lootable corpses system in years (eventually I plan to make sure it works with 1.69).  However, it does come with a "Raise Dead/Resurrection Plugin 1.0" that might meet your needs.  

Henesua, when you say "I need these corpses to be skinable, raisable, and animatable", I assume "raisable" means "Raise Dead", but not sure what "skinnable" or "animatable" mean.

Hope this helps!  Looking forward to getting back into the fray!
JP
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
All About Corpses
« Reply #22 on: November 24, 2012, 04:35:50 pm »


               That sounds great, Scrotok. Especially that you'll be involved with the community again. The more the merrier!

For the time being, I have a solution for my needs. I essentially modified the corpse system that comes with NESS to do what I want.

Explanation of what I wanted:
Raisable = can be targeted with raise dead
Skinnable = a character with an equipped knife collects the skin and meat from the body when clicking on the corpse
Animatable = a character casting a modified animate dead spell can raise the corpse as a zombie or skeleton.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
All About Corpses
« Reply #23 on: July 07, 2016, 04:12:40 am »


               

Bumping this thread because I am revisiting these ideas for PC corpses where their spirit becomes separated from their corpse.



               
               

               
            

Legacy_SHOVA

  • Hero Member
  • *****
  • Posts: 893
  • Karma: +0/-0
All About Corpses
« Reply #24 on: July 07, 2016, 05:00:20 am »


               

What are you after Henesua? Every creature in game including the PC to be able to be raised/resurrected, skinned, looted, and have a corpse item that can be picked up and taken to an NPC priest that can raise/resurrect? If so now that is a system I would want to.


I'm using the PC corpse system that is in the HCR-3.1, and NESS, with most of the corpse part disabled in favor of the HCR- it took some doing as with both systems everything wanted to drop 2 corpse objects.



               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
All About Corpses
« Reply #25 on: July 07, 2016, 06:03:12 pm »


               

I'm writing a corpse system for PCs that integrates with the NPC corpse system in NESS. This is for oldfog.


 


The purpose is to reinvent a wheel that has been done many times, because for some reason I have not found anything that actually works. Fugue system. Carryable body. Raise dead spell targeting etc... I know this is out there, but haven't found it.


 


Just about done. Would have taken longer to find and then rewrite to work with my scripts anyway.


 


 


One very minor problem that really irritates me and I could not solve however is as follows:


 


how do you determine if a PC dies on their back or on their face?



               
               

               
            

Legacy_SHOVA

  • Hero Member
  • *****
  • Posts: 893
  • Karma: +0/-0
All About Corpses
« Reply #26 on: July 07, 2016, 07:38:26 pm »


               

in the HCR, the on dying script  causes the PC to play animation dead looping back- I assume the on dying script fires before the on death script.



               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
All About Corpses
« Reply #27 on: July 18, 2016, 08:29:40 pm »


               

I got all of this working. Unfortunately the solution is very tied in with both the module's persistency setup as well as its spawn system (NESS) so its difficult to share.


 


I never figured out how to determine which way a creature is flipped after they are dead. Getting this information would be nice, but in the end Its not too much of a problem since it makes more sense to look at a corpse or place a corpse face up. So I just ensure that the corpse I create falls face up. The PC's corpse has a 50% chance of flipping over (if its not already face up) when the PC "respawns" as a ghost in "the fugue".


 


So anyway, here's how I handled corpses:


 


PCs leave their normal corpse (a dead character) until they respawn. NPCs leave their normal corpse, until their corpse is picked up and then put down again. After those events, I create a doppelganger that looks like the dead creature, dress it (if it had anything equipped) and then kill it whenever I need to see a corpse on the ground. These corpses are not destructable, not raisable, and not lootable.


 


Instead I link an invisible placeable with inventory to the visible body. The invisible placeable is the node with which all corpse related things happen. Looting, animating, skinning, raising...


 


For persistency I link the inventory to a creature somewhere else which is linked to the dead character's corpse. This inventory is maintained as a copy, and starts a save process once a minute whenever the linked inventory changes (ondisturbed event).


 


For persistency of all the data saved on the corpse I link the data to an item in an inventory elsewhere. If the corpse is ever destroyed in game or raised this data item is also destroyed. Having the persistent data makes corpses persistent across server resets, including their location. Storing the "corpses" in an inventory makes a nice place to have a list of all active corpses if I ever need to check rather than making database queries. I just load this inventory once at onmodule load and then check it or update it as things change. I periodically save it (once a minute).


 


Corpses are also carryable as items. The item needs to be put down on the ground to interact with where it becomes a placeable and has all the normal functionality. BUT a raise or animate spell can target an item corpse just as well as the placeable.


 


What functionality is open to any particular corpse is identified in a series of bit flags buried in one integer: corpse type. These are animating, raising, skinning, and persistence.


 


Anyway, thats the quick and dirty. I may upload this sometime if I have time to rewrite it for public consumption.



               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
All About Corpses
« Reply #28 on: July 25, 2016, 11:35:46 pm »


               

I extracted the code for maintaining the inventory persistence of carryable corpses which I wrote from the above project. There was a lot of interconnected functionality involved with my implementation of corpses, so if I am going to ever share it I need to extract all the parts and make them work outside of a specific server. This example project showing inventory persistence is a small part of that.


 


I don't know if I will have the time to do all this work. But I figured this was an easy share, so I put in the effort to extract this very small part of the whole thing. The Demo module is what you'll want to look at to see the possibilities of the core functions.


 


Persistent Inventory Examples


 


I apologize for not writing a manual for how to use the code. Ask me questions in the NW Vault thread and I might be able to help you. If I ever write instructions they'll be there.