Author Topic: Dragon age-like regeneration when in non-combat  (Read 678 times)

Legacy_rafhot

  • Jr. Member
  • **
  • Posts: 58
  • Karma: +0/-0
Dragon age-like regeneration when in non-combat
« Reply #15 on: October 22, 2010, 07:55:35 am »


               the gethenchman only work if the henchmans are in the party (and when they dead they leave the party)

i dont have experience on use setlocalobjects yet, but i remeber the defualt oc henchmans come with a item token to stay in player inventory (it is something related?)

i know how to use setlocalint and strings but i cant figure how i can use it to this problem yet too.

can you make some changes in my code that may open my mind ?
heres the link of the most recent changes 
http://paste.bradley...?paste_id=58005

thnx
               
               

               


                     Modifié par rafhot, 22 octobre 2010 - 07:02 .
                     
                  


            

Legacy__Knightmare_

  • Full Member
  • ***
  • Posts: 191
  • Karma: +0/-0
Dragon age-like regeneration when in non-combat
« Reply #16 on: October 22, 2010, 11:26:55 am »


               Not sure if this is of any help, but if you can get a hold of the NWN2 version of the OC death scripts, they work exactly as you are wanting. A "dead" party member (of any sort) will go down when out of hit points. When the fight is over, all "dead" members will get back up with 1 hp. Might give you some insight at to how to go about it.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Dragon age-like regeneration when in non-combat
« Reply #17 on: October 22, 2010, 01:39:24 pm »


               If I remember right, Shadowlords, Dreamcatcher, and Demon campaigns also use the same system.
               
               

               
            

Legacy_Mudeye

  • Full Member
  • ***
  • Posts: 238
  • Karma: +0/-0
Dragon age-like regeneration when in non-combat
« Reply #18 on: October 22, 2010, 05:09:52 pm »


               I think SoU henchmen do something like that too.  They go to 1 hit point and become unconscious. You have a certain amount of time to heal them.  That might be a fit for what you want.
               
               

               
            

Legacy_rafhot

  • Jr. Member
  • **
  • Posts: 58
  • Karma: +0/-0
Dragon age-like regeneration when in non-combat
« Reply #19 on: October 22, 2010, 06:47:40 pm »


               i will take a look on SoU oc, im also redownloading the adam miller modules to check

and i dont have nwn2 to check those scripts. can you _Knightmare_ paste the code here?



Thanks
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
Dragon age-like regeneration when in non-combat
« Reply #20 on: October 22, 2010, 09:04:58 pm »


               Use this in the henchman heartbeat - you may have to edit it in, but that shouldn't be too hard. I haven't compiled this, but it should work, barring a typo somewhere:


void main() {
    object oMaster;
    if (GetIsDead(OBJECT_SELF)) {

        oMaster = GetLocalObject(OBJECT_SELF, "Master");
        if (GetIsObjectValid(oMaster) && !GetIsInCombat(oMaster)  && !GetIsDead(oMaster)) {
            effect eRes = EffectResurrection();
            ApplyEffectToObject(DURATION_TYPE_INSTANT, eRes, OBJECT_SELF);
        }

    } else {

        oMaster = GetLocalObject(OBJECT_SELF, "Master");
        if (!GetIsObjectValid(oMaster)) {
            oMaster = GetMaster(OBJECT_SELF);
            if (GetIsObjectValid(oMaster))
                SetLocalObject(OBJECT_SELF, "Master", oMaster);
        }

        //add any other stuff you want to happen to henchman while alive here
    }
}

Basically, it checks while the npc is alive for their master, and stores them as a local for later reference. Please note that this is not a robust script - it doesn't provide, for example, with a way for the npc to switch masters. It just does the bare minimum of what you asked. Myself, I would normally only set the "Master" local once, in another event, but it's still fairly low overhead, and I'm trying to keep it simple so that you can see how local objects are used.

Funky
               
               

               
            

Legacy_ffbj

  • Hero Member
  • *****
  • Posts: 1097
  • Karma: +0/-0
Dragon age-like regeneration when in non-combat
« Reply #21 on: October 22, 2010, 10:45:37 pm »


               I did something similar, but it does not do henchmen. Just a simple PC transversal on hb that does 2 hits/rd as long as the PC is not in combat and up to 50% of the PC hits. That is it will ony heal the PC up to 50% of their total hits. For me and many other players they get the first 3 or 4 rounds of free healing and then rest or take a potion or use bandages anyway. I like it though since it represents the recovery of the body when not exerting itself in combat, or being wounded, and it is a nice clue that you are out pacing the foes you are fleeing as you start getting healed on the run, no  longer flagged as being in combat, which has saved my characters life a few times. I also use the hb for the recovery of fatigue at the same rate and to the same level: 50% of total fatigue just not being in combat.
               
               

               


                     Modifié par ffbj, 22 octobre 2010 - 09:55 .
                     
                  


            

Legacy_rafhot

  • Jr. Member
  • **
  • Posts: 58
  • Karma: +0/-0
Dragon age-like regeneration when in non-combat
« Reply #22 on: October 23, 2010, 06:00:33 am »


               I have tried the funky code in henchman hearbeat but i discover that the heartbeat event of a dead henchman dont fire.
Im also have looked at Adam miller dreamcacher scripts and he uses the henchmans ondeath event to ressurect their henchmans.

i will try to make a fine tune based on his code now, heres the code for the ondeath henchman event:
http://paste.bradley...?paste_id=58199

in the dreamcatcher system the henchman wake up when the delaycomand reach 0, even if the battle isnt over

but i think using the loop to detect if are any hostile creature around a radius will solve this problem and the henchman only will wake up when theres no one creature around this radius, my fear now its about TMI and loops


Thanks
               
               

               


                     Modifié par rafhot, 23 octobre 2010 - 06:54 .