Author Topic: Need a Bleed System  (Read 539 times)

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Need a Bleed System
« on: August 11, 2012, 01:23:31 am »


               I'll throw another one out there for you scripting gurus...

So far I've incorporated the following systems into my PW - Screwtape's Simple XP v2.07, The Krits Alternate Horse Scripts, and Axe Murderer's Killer Death System 1 v2.2. Integration was pretty smooth and everything seems to be working nicely together...

Now I need a persistent Bleed / Dying System that will work with the above configuration. I'm currently looking at the Bleed System - http://nwvault.ign.c....Detail&id=2610 - that Tom Banjo designed based on Scott Thorne's script. This is also the system that LoW adapted for Arbor Falls. Before I merge it in, are there any other systems I should know about or look over?
               
               

               


                     Modifié par Pstemarie, 11 août 2012 - 12:30 .
                     
                  


            

Legacy_lordofworms

  • Sr. Member
  • ****
  • Posts: 422
  • Karma: +0/-0
Need a Bleed System
« Reply #1 on: August 11, 2012, 01:55:21 am »


               that one was the easiest to setup, merge and maintain IMO. I checked out a few during my need for bleed scripts..
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Need a Bleed System
« Reply #2 on: August 11, 2012, 03:57:15 am »


               LoW, don't your bleed scripts also have spurting gore as the PC succumbs to their wounds? Is that something you did on your own or is that from a package on the vault?
               
               

               
            

Legacy_lordofworms

  • Sr. Member
  • ****
  • Posts: 422
  • Karma: +0/-0
Need a Bleed System
« Reply #3 on: August 11, 2012, 04:53:55 pm »


               that was something I did on my own, easily enough too since the blood spurt is already part of default bioware, I just added it as a usable effect in my 2da.

if your interested I can post the script here.. its not all that difficult '<img'>
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Need a Bleed System
« Reply #4 on: August 11, 2012, 05:15:32 pm »


               That would be great if you did, and whatever 2da changes needed to be made. Thanks.

That effect is dramatic and I'd love to have that in my mod.
               
               

               


                     Modifié par henesua, 11 août 2012 - 04:16 .
                     
                  


            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Need a Bleed System
« Reply #5 on: August 11, 2012, 06:26:48 pm »


               Ditto to what Henesua said...
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Need a Bleed System
« Reply #6 on: August 11, 2012, 06:39:13 pm »


               Pstemarie - although my bleed scripts are little different than Tom Banjo's, you might want to check them out.

Death Customizable System

I added some hooks that allow you to customize death behavior based on killer or area that you died in.
I also created dynamic pools of blood while the PC is bleeding to death.

The customizabilty is useful for converting PCs to undead when killed by ghouls or wraiths etc....  Otherwise I've used it primarly in single player to launch cut scenes, and last minute rescues etc.. when certain enemies defeat you.
               
               

               


                     Modifié par henesua, 11 août 2012 - 05:40 .
                     
                  


            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Need a Bleed System
« Reply #7 on: August 11, 2012, 08:55:58 pm »


               Thanks, I'll be sure to look them over. I've already got Tom's set up, but it wouldn't be too hard to swap it out if I like yours (or LoW's) system better.
               
               

               
            

Legacy_ffbj

  • Hero Member
  • *****
  • Posts: 1097
  • Karma: +0/-0
Need a Bleed System
« Reply #8 on: August 11, 2012, 09:20:53 pm »


               That's cool as far as the conversion to undead goes.  I have seen that in a few places.  I have bleed down of course too, and fatigue.  One thing I do is if a PC is killed in certain areas, and you try to respawn you wind up in jail, or held for ransom.  You can be bailed out or ransomed by another PC or the DM if needs be. So you learn to be cautious when attacking bosses or certain civilized/controlled areas.  Good luck with your PW. I think you are going at it in a systematic and thoughful way.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Need a Bleed System
« Reply #9 on: August 11, 2012, 10:48:47 pm »


               ffbj - the system I have uploaded only has the framework for custom behavior specific to a killer or area. I did not include the custom scripts for undeath conversion etc..., just the framework so that builders can do whatever they like.
               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Need a Bleed System
« Reply #10 on: August 12, 2012, 03:37:56 am »


               Okay I've taken Tom Banjo's script and modified to use EffectHitPointChangeWhenDying() and removed the bleed damage from the recursive timer in the original script. Anyone care to look it over and see what you think?

http://pastebin.com/8LZigJHX
               
               

               


                     Modifié par Pstemarie, 12 août 2012 - 02:38 .
                     
                  


            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Need a Bleed System
« Reply #11 on: August 12, 2012, 12:18:39 pm »


               I've culled the script down to its bare essentials and switched back to dealing damage through the bleed timer (since it had to be there anywhere to track the 10% chance of self-stabilization). Now to look at the AI and see what I can do with the other functionality Tom provided (starting with Henesua's package)...
               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Need a Bleed System
« Reply #12 on: August 12, 2012, 01:27:12 pm »


               OK - I'm stuck again...

I want to modify the default AI so that enemies will ignore a dying creature if another enemy is in perception range, but I'm not sure which creature event I need to modify. Do I change OnCombatRoundEnd or OnPerception?

Then I also want to modify it further so that if no living enemies are in perception range, the PC might get looted. Tom Banjo already provided the function; I just want to move it into the AI and use a variable - or maybe a racial check - that will flag certain creatures as "Looters". Again, I'm not sure which event I'd need to modify...
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Need a Bleed System
« Reply #13 on: August 12, 2012, 03:54:55 pm »


               Pstemarie, I'm not completely clear on what you mean by ignoring a dying creature.

Do you want a creature that beat the dying creature to a pulp to then move on? this is likely DetermineCombatRound in Generic.

or do you mean that if a creature came across a dying enemy that it would ignore them? This is likely the perception event.

I modified the Perception Event. It makes more sense as a framework. I recommend you try something like it. You could add a check prior to Aggressive Response for whether the seen enemy is dead or dying. And decide at that point to loot them instead of attacking them.
               
               

               


                     Modifié par henesua, 12 août 2012 - 03:03 .
                     
                  


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Need a Bleed System
« Reply #14 on: August 12, 2012, 04:07:55 pm »


               I would handle it in a  Special AI script.   You can set a special AI script on the creature using:
 
//------------------------------------------------------------------------------
// * Define a replacement script for DetermineCombatRound
// * See x2_ai_demo for details
//------------------------------------------------------------------------------
void SetCreatureOverrideAIScript(object oCreature, string sScriptName)

You will need have  x2_inc_switches included for the function.

...
Then your AI script would look something like this. 


#include "x2_inc_switches"
#include "NW_i0_generic"
void main()
{
   object oTarget = GetCreatureOverrideAIScriptTarget();

   if (  GetCurrentHitPoints(oTarget)< 0)
   {
      // Attacking a dying target. check for one still moving.

      //I hope this will not return a dying target
      oTarget =  GetNearestCreature(CREATURE_TYPE_REPUTATION,
                         REPUTATION_TYPE_ENEMY,
                         OBJECT_SELF,
                         1,
                         CREATURE_TYPE_PERCEPTION,
                         PERCEPTION_SEEN,
                         CREATURE_TYPE_IS_ALIVE,
                         TRUE);
      // Check oTarget to see if we have a new valid target
      if (GetIsObjectValid(oTarget))
      {
         // There is a new valid target. run the AI with the new target.
         DetermineCombatRound(oTarget);

         // Since we have just ran DetermineCombatRound from within
         // DetermineCombatRound We need to stop the original run of the function.
         // Without this the first itteration would continue to run. in effect
         // reseting the target back to the original.
         SetCreatureOverrideAIScriptFinished();
      }
   }
}