Author Topic: Looking for Henchman Scripts  (Read 364 times)

Legacy_Zejan the Wonder Monkey

  • Jr. Member
  • **
  • Posts: 61
  • Karma: +0/-0
Looking for Henchman Scripts
« on: February 24, 2011, 05:00:28 am »


               I am finally seeing the light at the end of the tunnel with my module, but one of the last things I need to do is get some Henchman scripts I can use for a few key NPCs.  I tried modifying Bioware's set-ups (eeeek), but I made a huge mess of things and I'll probably have to delete everything I worked on.  ':crying:'

And does anyone know how Deekin the Kobold Bard in SoH and HotU was handled?  I tried to make a different type of creature (goblin) into a henchman similar to Deekin and it was a real mess too.
               
               

               
            

Legacy_Xovian

  • Full Member
  • ***
  • Posts: 158
  • Karma: +0/-0
Looking for Henchman Scripts
« Reply #1 on: February 24, 2011, 05:56:54 am »


               I think my projects has a link to a conversation file that might work for you.
It's in my siggy.

I'm currently working on another as well, but it might be a little bit before I finish it as it belongs to a much bigger project.
               
               

               


                     Modifié par Xovian, 24 février 2011 - 05:59 .
                     
                  


            

Legacy_Zejan the Wonder Monkey

  • Jr. Member
  • **
  • Posts: 61
  • Karma: +0/-0
Looking for Henchman Scripts
« Reply #2 on: February 26, 2011, 05:31:53 am »


               

Xovian wrote...

I think my projects has a link to a conversation file that might work for you.
It's in my siggy.

I'm currently working on another as well, but it might be a little bit before I finish it as it belongs to a much bigger project.


Thanks very much, I will check this out.  '<img'>
               
               

               
            

Legacy_Zejan the Wonder Monkey

  • Jr. Member
  • **
  • Posts: 61
  • Karma: +0/-0
Looking for Henchman Scripts
« Reply #3 on: February 28, 2011, 04:38:54 am »


               Another thing I was wondering is...is there a best script for making a henchman behave during combat? 

I have a scenario where if the player dies during a battle, they are stripped of all items and gear, dressed in slave clothes and sent to a capture area on respawn. The only problem is, sometimes the henchman keeps on fighting the creatures and mucks up my script because the slave clothes are considered armor [albeit rather uesless armor], and the player cannot equip it during combat.  So the player arrives at the capture area naked - though the clothing in question does wind up in their inventory.

I make the enemy creatures stop fighting via
the SurrenderAllToEnemies() function as soon as the Player dies, and I put a clear
actions on the henchman as well.  Most of the time it works, but occasionally I get that annoying scenario as mentioned above.  I tried killing the henchman when the Player dies, but that separates the two and then the henchman isn't transported to the new area with the Player.  Maybe if I use GetFormerMaster() and then the area the former master is in to send the henchman there...?

Just one of a couple henchman problems that's making me want to pull my hair out...  ':crying:' 
               
               

               
            

Legacy_Xovian

  • Full Member
  • ***
  • Posts: 158
  • Karma: +0/-0
Looking for Henchman Scripts
« Reply #4 on: February 28, 2011, 06:41:51 am »


               For henchman you can stop their progress several ways.

One way is to just use the ClearActions(TRUE); requires the include script  *_*_Henai as ClearActions is a wrapper function of ClearAllActions, but the latter can be buggy sometimes.
By using the TRUE, it will break the henchman combat, where as FALSE ignores the state of combat.

The most effective is to include a section in the OnHeartBeat:

//This is what I use.

// If not runnning normal or better AI then exit for performance reasons
   if(GetAILevel() == AI_LEVEL_VERY_LOW)
   {
    return;
   }
   // If doing any of these actions, do nothing.
   int iAct;
   iAct = GetCurrentAction();
   if(iAct==ACTION_CASTSPELL || iAct==ACTION_HEAL || iAct==ACTION_ITEMCASTSPELL || iAct==ACTION_WAIT
      || iAct==ACTION_REST || (GetAssociateState(NW_ASC_IS_BUSY, OBJECT_SELF)==TRUE) || (GetIsDead(OBJECT_SELF)))
     {
      return;
     }

The main key to have and use is the: (GetAssociateState(NW_ASC_IS_BUSY...
In your script you can SET the associate state to busy after the ClearActions function.
The henchman will stay busy and any other scripts that would normally fire will fail because the busy command stops them, and things like perceived or even damage wont change the state because they are marked as busy.

Just make sure after the script you want to fire has happened you set them not being busy (set to false) or they will not even talk to the player or anything else. Easy to do with a DelayCommand, just have a few seconds set for the script to run and poof they become non-busy and act as normal. Honestly, it probably isnt needed in the onheartbeat event to return, just having it work on the script you want is probably enough, but i use it for completeness sake.

As to why I have the GetIsDead used there, I use Tony K's AI in several mods, inclluding the one I'm building. NPC's will still "taunt" even when dead with out it, unless their corpses fade, which mine dont..
               
               

               


                     Modifié par Xovian, 28 février 2011 - 06:49 .
                     
                  


            

Legacy_Zejan the Wonder Monkey

  • Jr. Member
  • **
  • Posts: 61
  • Karma: +0/-0
Looking for Henchman Scripts
« Reply #5 on: March 02, 2011, 06:25:39 am »


               Thanks again, I have copied, pasted, and am coding, will be testing...

What is this AI you're referring to?  I've seen it mentioned before, but I was never sure of exactly what it was...is it just for henchmen, or for all NPCs?
               
               

               


                     Modifié par Zejan the Wonder Monkey, 02 mars 2011 - 06:27 .
                     
                  


            

Legacy_Xovian

  • Full Member
  • ***
  • Posts: 158
  • Karma: +0/-0
Looking for Henchman Scripts
« Reply #6 on: March 02, 2011, 07:00:28 am »


               Check here

Check the descriptions of each as there are several versions and types.
               
               

               
            

Legacy_Zejan the Wonder Monkey

  • Jr. Member
  • **
  • Posts: 61
  • Karma: +0/-0
Looking for Henchman Scripts
« Reply #7 on: March 11, 2011, 11:52:20 pm »


               

Xovian wrote...

Check here

Check the descriptions of each as there are several versions and types.


Again, I thank you.  Truly.

Nothing is more frustrating than a henchie who won't cooperate.  ':huh:'