Author Topic: How do *you* do henchpersons  (Read 348 times)

Legacy_Tiggers.no.tail

  • Jr. Member
  • **
  • Posts: 82
  • Karma: +0/-0
How do *you* do henchpersons
« on: July 08, 2011, 06:56:41 pm »


                I've been trying to find a way to make my henchpersons 'more intelligent' if you will. The ones I used in Rebirth of the Phoenix, I happened to find from a google search and they are:


[ResRefs]
OnBlocked=x0_ch_hen_block
OnDamaged=x0_ch_hen_damage
OnDeath= (CUSTOM DEATH SCRIPT HERE)
OnConversation=x0_ch_hen_conv
OnDisturbed=x0_ch_hen_distrb
OnCombatRoundEnd=x0_ch_hen_combat
OnHeartbeat=x0_ch_hen_heart
OnPhysicalAttacked=x0_ch_hen_attack
OnPerception=x0_ch_hen_percep
OnRested=x0_ch_hen_rest
OnSpawn=x0_ch_hen_spawn
OnSpellCast=x2_hen_spell
OnUserDefined= (CUSTOM UDE SCRIPT HERE)

To change their 'behavior' i've been using a Conversation dialogue with the following scripts

Follow Distance:
6 feet: nw_ch_dist_6
12 feet: nw_ch_dist_12
18 Feet: nw_ch_dist_18

Healing response time:
75% : nw_ch_heal_75
50%: nw_ch_heal_50
25%: nw_ch_heal_25

Weapons:
go ranged: nw_ch_goranged
go melee: nw_ch_gomelee

Door and Container aggression:
destroy them: nw_ch_lock_on
leave them: nw_ch_lock_off

My question is, is there a better way to do this and am I using the AI designed for XP2? One 'bug' of the way I've done it is that if you try to fire the henchperson via the Radial menu, it doesn't actually remove them (because you have to talk to them through the conversation to do it. Also, when I was playing the Penultima and Penultima Rerolled series, I noticed that if you did an action like 'follow me', the npc would respond by saying something like "you just want me to follow and not attack?". How does this work? Anyways, any help would be greatly appreciated.
               
               

               
            

Legacy_Failed.Bard

  • Hero Member
  • *****
  • Posts: 1409
  • Karma: +0/-0
How do *you* do henchpersons
« Reply #1 on: July 09, 2011, 12:51:49 am »


               nw_ prefixes are base game, x0_ through x2_ designate scripts added during expansions, to answer that part of your post.

As for what scripts I use, I wrote all the combat and henchman AI I'm using in my little server, since the default AI is just really bad.

 If you want intelligent AI behaviour, you'll have to find an AI on the vault or write your own.  The expansions added customizing of behaviours, but it still used the same poor AI at the core of it.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
How do *you* do henchpersons
« Reply #2 on: July 09, 2011, 01:04:59 am »


               

Tiggers.no.tail wrote...

 ...One 'bug' of the way I've done it is that if you try to fire the henchperson via the Radial menu, it doesn't actually remove them (because you have to talk to them through the conversation to do it. Also, when I was playing the Penultima and Penultima Rerolled series, I noticed that if you did an action like 'follow me', the npc would respond by saying something like "you just want me to follow and not attack?". How does this work? Anyways, any help would be greatly appreciated.



The Only thing a lot of the radial menu options do, is send a silent shout.   The shout is heard by the NPC and he then responds.   So if you have modified his OnConversation event to where he does not correctly respond to the shouts, things will quit functioning.  Also if he is not set to listening he will not respond to them. 
               
               

               
            

Legacy_Tiggers.no.tail

  • Jr. Member
  • **
  • Posts: 82
  • Karma: +0/-0
How do *you* do henchpersons
« Reply #3 on: July 09, 2011, 01:43:22 am »


               What do you mean 'set to listening'?
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
How do *you* do henchpersons
« Reply #4 on: July 09, 2011, 02:21:16 am »


               Function - SetListening


The standard system would normally set up the listening patterns useing one or all of the following. acording to what they are doing.  

 Function - SetAssociateListenPatterns
bkSetListeningPatterns // Not In the lexicon
 
SetListeningPatterns // Normally NPC/monster


EDIT: the patterns and the setListening in normally done in the OnSpawn event.   It is however the OnConversation event the defines how they react to each shout they are listening for.
               
               

               


                     Modifié par Lightfoot8, 09 juillet 2011 - 01:23 .
                     
                  


            

Legacy_La Rose Noire

  • Newbie
  • *
  • Posts: 49
  • Karma: +0/-0
How do *you* do henchpersons
« Reply #5 on: July 10, 2011, 09:33:21 pm »


               

Failed.Bard wrote...


As for what scripts I use, I wrote all the combat and henchman AI I'm using in my little server, since the default AI is just really bad.

 If you want intelligent AI behaviour, you'll have to find an AI on the vault or write your own.  The expansions added customizing of behaviours, but it still used the same poor AI at the core of it.


+1
It's a hard but necessary time to script your own AI. If you take a look at the OHB script, you will understand many tricks to make your own.