Author Topic: All About Corpses  (Read 790 times)

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
All About Corpses
« on: November 04, 2012, 12:28:18 am »


               I have some questions about the default bioware corpses.

Some background, I was curious if the standard Lootable Corpse object was the same object as the creature, and whether the creature's event scripts would run on it, specifically OnDisturbed. Since the OnDistrubed event did not execute on the corpse, I assume that the corpse object is not the same as the creature.
  • What is the corpse object? What kind of resource and what is its resref? I'd like to customize it, although I fear that this is a hardcoded thing.
  • How does the Resurrect Effect work on a corpse object? Is there data on the object that configures the resurrection of the NPC? Can we access this data via script? Is this also a hardcoded thing? Has anyone else replicated this for a different object than the default creature corpse?
  • How does the looting behavior work? Are there events and scripts that we have access to?

               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
All About Corpses
« Reply #1 on: November 04, 2012, 12:49:54 am »


                Due to the questions I have I am looking at the following corpse systems:

               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
All About Corpses
« Reply #2 on: November 04, 2012, 01:46:30 am »


               Dug into NESS and discovered that its corpse system is Keron's. I'll see what I can do with that.
In addition to lootable I need these corpses to be skinable, raisable, and animatable.
               
               

               
            

Legacy_ShadowM

  • Hero Member
  • *****
  • Posts: 1373
  • Karma: +0/-0
All About Corpses
« Reply #3 on: November 04, 2012, 03:17:30 am »


               I cannot remember which one I use, it been so long and I change so much of it with percentage drops and you must know about my next update to HR base I have add skinning for all sorts of stuff and meat. animatable? Hope you find the system that best work for you and/or easiest one to mod.
               
               

               
            

Legacy_Pattycake1

  • Jr. Member
  • **
  • Posts: 98
  • Karma: +0/-0
All About Corpses
« Reply #4 on: November 04, 2012, 09:39:00 am »


               Look at axe murders killer death system http://nwvault.ign.c....Detail&id=2994
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
All About Corpses
« Reply #5 on: November 04, 2012, 09:42:17 am »


               

henesua wrote...

I have some questions about the default bioware corpses.

Some background, I was curious if the standard Lootable Corpse object was the same object as the creature, and whether the creature's event scripts would run on it, specifically OnDisturbed. Since the OnDistrubed event did not execute on the corpse, I assume that the corpse object is not the same as the creature.

  • What is the corpse object? What kind of resource and what is its resref? I'd like to customize it, although I fear that this is a hardcoded thing.
  • How does the Resurrect Effect work on a corpse object? Is there data on the object that configures the resurrection of the NPC? Can we access this data via script? Is this also a hardcoded thing? Has anyone else replicated this for a different object than the default creature corpse?
  • How does the looting behavior work? Are there events and scripts that we have access to?

i think that this is not known at all, there isnt any info about this written anywhere, if someone find answers to your questions, he never published them

I could give you some guesses, but for everyone's sake it would be better if you would do a research on this and tell us results, then we can write them into lexicon or wiki.'<img'>
               
               

               
            

Legacy_Failed.Bard

  • Hero Member
  • *****
  • Posts: 1409
  • Karma: +0/-0
All About Corpses
« Reply #6 on: November 04, 2012, 10:13:41 am »


               Lootable corpses can be animated or raised just like a PC corpse can be, assuming the spell scripts themselves are set up to allow it.

 This was how I handled them in my zombie mod.  Since it was ravenloft based, it made more sense to have the undead have to be created as opposed to summoned, and the ability to have PCs raise/ressurect NPCs can be a useful one.

Unfortunately, there are conditions where even if they have items still in their inventories they can become unclickable making it impossible to target them with the spells to do so.
               
               

               
            

Legacy_henesua

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


               Thanks for the replies everyone. Since I don't have the energy to write my own system from scratch I'm modifying what comes with NESS, Keron's corpse system. Keron's system works because it places a pointer to the creature's corpse on the placeable "lootable corpse".

One bug which I caught was that if the creature's blueprint is set as lootable, then (1) its corpse doesn't drop any loot to the placeable corpse and (2) when destroyed it lingers indefinitely  (leaves a little unidentified glow on the ground when you hold down tab).

The solution is to add a line of code to the functions SetupSpawned  and SetupCampSpawned which ensures that the creature does not leave a lootable corpse: SetLootable(oSpawned, FALSE)

To enable the corpse to be raisable you change the line:
AssignCommand(oSpawned, SetIsDestroyable(FALSE, FALSE, FALSE));
to
AssignCommand(oSpawned, SetIsDestroyable(FALSE, TRUE, FALSE));

ShadowM wrote...
animatable?


I am modifying animate dead and similar spells to require the caster to target a corpse or an item with the write flags.

Pattycake1 wrote...
Look at axe murders killer death system http://nwvault.ign.c....Detail&id=2994


That is for a player's death. AFAIK, that set of scripts by Axe doesn't cover NPC corpses and the like.

ShaDoOoW wrote...
I could give you some guesses, but for everyone's sake it would be better if you would do a research on this and tell us results, then we can write them into lexicon or wiki.


I have neither the ability nor the inclination to go after this right now. If I discover anything I'll post it.

Failed.Bard wrote...
Lootable corpses can be animated or raised just like a PC corpse can be, assuming the spell scripts themselves are set up to allow it.
This was how I handled them in my zombie mod. Since it was ravenloft based, it made more sense to have the undead have to be created as opposed to summoned, and the ability to have PCs raise/ressurect NPCs can be a useful one.
Unfortunately, there are conditions where even if they have items still in their inventories they can become unclickable making it impossible to target them with the spells to do so.


Bard, by "lootable" corpse are you referring to the standard Bioware corpse system, or to the custom corpse scripts I linked above? And what was your workaround for the issues you noted above about being unable to target a corpse?
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
All About Corpses
« Reply #8 on: November 04, 2012, 06:03:04 pm »


               Just a few quick answers off the top of my head...

henesua wrote...

I have some questions about the default bioware corpses.

Some background, I was curious if the standard Lootable Corpse object was the same object as the creature, and whether the creature's event scripts would run on it, specifically OnDisturbed. Since the OnDistrubed event did not execute on the corpse, I assume that the corpse object is not the same as the creature.

  • What is the corpse object? What kind of resource and what is its resref? I'd like to customize it, although I fear that this is a hardcoded thing.
  • How does the Resurrect Effect work on a corpse object? Is there data on the object that configures the resurrection of the NPC? Can we access this data via script? Is this also a hardcoded thing? Has anyone else replicated this for a different object than the default creature corpse?
  • How does the looting behavior work? Are there events and scripts that we have access to?



Just a few quick answers off the top of my head with little or no research so feel free to shoot holes into any of the answers.  
  • What is the corpse object?


    The corpse object is the same object as the creature that died.  Being dead it has all event scripts disabled.  This stops the corpse from doing things that it should not do, Things like waklking waypoints, shouting for help, Trying to react from a thief stealing from there backpack, ect...

  • How does the Resurrect Effect work on a corpse object?


    The 'dead flag' is reset.

    i.e. GetIsDead(oNpc)

  • How does the looting behavior work? Are there events and scripts that we have access to?


    Since the Events and event que is disabled on dead creatures there are no event that work.
 
The answers above all apply to creatures that leave a lootable corpse and creatures that have been set to be raisable via the SetIsDestroyable flag. It is inportant to note that the two systems do not play nice together.  If you have a creature that you set to leave a lootable corpse and also set him to be raisable,  The two systems will conflict.  The Lootable Corpse system is set to destroy the creature once he has no loot left.   When using the raisable creature system, the creature will not get destroyed due to the destroyable flag getting unset.  There is however an error where the looting system still makes the creature unslectable once the creature has been looted.  Making it impossiable for a PC to target the NPC to raise it.  


Some of my testing in the past also showed that there my be some errors when a creature is killed a second time, Though I do not remember what they where.
               
               

               
            

Legacy_Failed.Bard

  • Hero Member
  • *****
  • Posts: 1409
  • Karma: +0/-0
All About Corpses
« Reply #9 on: November 04, 2012, 07:28:05 pm »


               What I ended up doing was giving all the creatures undroppable (cursed) corpse items that were set to drop, so they always had an item left to be looted.  Unfortunately, that didn't work all the time either, but since NPCs ignore encumbrance anyways it didn't hurt them to have it.
               
               

               
            

Legacy_Pattycake1

  • Jr. Member
  • **
  • Posts: 98
  • Karma: +0/-0
All About Corpses
« Reply #10 on: November 05, 2012, 12:54:27 am »


               I suggested axe's system because on my old server we modified it a bit to work on our henchmen and on special npc's. But it was just a suggestion.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
All About Corpses
« Reply #11 on: November 05, 2012, 02:03:54 am »


               Thats interesting, Pattycake. How did that work? I wasn't dissing you, by the way, just pointing out my understanding of Axe's system.

Thanks for sharing your understanding, Lightfoot. That helps clarify things.

Interesting solution, Bard. I'm assuming from your comments that you are referring to a way you've worked with the standard lootable corpse system

Also... I got all I wanted working. Skinning, Raising, and Animate Dead will work while the corpse is around. I still need to work out a way to allow a corpse to be stored to a location should someone try to dig up the bones later for animating or raising. But I haven't worked that out yet. I've also created different rules for how Unique NPCs versus all other NPCs are handled. The bodies of Unique NPCs do not fade. During an event, the PCs may want to raise that Unique NPC or do something else.

Another thing I'd like to do is give players the ability to move the corpse to a grave, but I don't like the look of how Leto II handled moving corpses. They essentially get spawned and then killed again. I haven't figured out a clean way to hide the killing part. Perhaps a temporary but well timed silence and cutscene invis? Seems fiddly to me, but am open to what other's ideas are.
               
               

               


                     Modifié par henesua, 05 novembre 2012 - 02:06 .
                     
                  


            

Legacy_Pattycake1

  • Jr. Member
  • **
  • Posts: 98
  • Karma: +0/-0
All About Corpses
« Reply #12 on: November 05, 2012, 04:46:38 pm »


                LoL I didnt think you was dissing me.

Yes Axe's system is designed for players. I wasnt the one that did it but one of my dever's did. They used how Axe's system makes a copy of the player and place it on the ground as a dead body.that can be picked up or rezed. We implemented that into our henchman system and I was moving it over to our important NPC's before I shut down the server. So basicly the henchman body never fades and could be moved to a safer area for a rez. It just made it a bit more interesting.

As far as storing a location, this topic a short while back was interesting. Padding a string - best practices?
               
               

               


                     Modifié par Pattycake1, 05 novembre 2012 - 04:47 .
                     
                  


            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
All About Corpses
« Reply #13 on: November 05, 2012, 04:56:43 pm »


               Yeah... I started that thread. '<img'>
I am using that for storing buried things in the database - when someone uses a shovel it accesses a DB location.

I think for a dead body, I'd just break down the location into its components, and store those. The area has to be stored as a tag instead of as an object, but otherwise it works.

Interesting use of Axe's system. That sounds like something I'd want to implement down the road. Only downside is the animation of a dying creature every time you place a corpse on the ground. That would have to be solved as it is an immersion breaker for me.
               
               

               
            

Legacy_Frimbleglim

  • Newbie
  • *
  • Posts: 46
  • Karma: +0/-0
All About Corpses
« Reply #14 on: November 05, 2012, 05:29:30 pm »


               Stop me if I'm on the wrong track henesua, but why not create an item for npcs to carry and drop when killed that has the property of spawning the npc when resserection is cast on it or a skeleton when raise dead is cast on it?  Just call it 'joe blogg's corpse' or whatever. It won't look like a corpse when placed on the ground but otherwise it should do the trick.