Author Topic: Henchmans starting melee combat (only melee)  (Read 558 times)

Legacy_WhiteTiger

  • Hero Member
  • *****
  • Posts: 889
  • Karma: +0/-0
Henchmans starting melee combat (only melee)
« on: January 24, 2015, 05:39:08 am »


               

How to make henchmans stop with spells and ranged attacks and start hit melee?


 


I tried use the nw_ch_gomelee in my henchman but have no effect (henchman is using fireball and other spells...)


 


ps: I have the default set of henchman scripts properly installed in my creature henchman



               
               

               
            

Legacy_Proleric

  • Hero Member
  • *****
  • Posts: 1750
  • Karma: +0/-0
Henchmans starting melee combat (only melee)
« Reply #1 on: January 24, 2015, 09:36:09 am »


               Go melee works in conversation prior to combat. The only bug I know is that higher-level Rangers fail to melee.
               
               

               
            

Legacy_WhiteTiger

  • Hero Member
  • *****
  • Posts: 889
  • Karma: +0/-0
Henchmans starting melee combat (only melee)
« Reply #2 on: January 24, 2015, 01:10:59 pm »


               


Go melee works in conversation prior to combat. The only bug I know is that higher-level Rangers fail to melee.




 


I have my own henchman with custom conversation. I am not getting sucess in making henchmans stopping with ranged hits.


 


My script that create my henchmans:



            object oEscudeiro = CreateObject(OBJECT_TYPE_CREATURE, "escudeiro1", GetLocation(oPC), FALSE, "hen_"+ObjectToString(oPC));
            if (GetIsObjectValid(GetHenchman(GetPCSpeaker())) == TRUE)
            {
                SetFormerMaster(GetPCSpeaker(), GetHenchman(GetPCSpeaker()));
                object oHench = GetHenchman(GetPCSpeaker());
                RemoveHenchman(GetPCSpeaker(), GetHenchman(GetPCSpeaker()));
                AssignCommand(oHench, ClearAllActions());
                DestroyObject(oHench);
            }
            SetWorkingForPlayer(GetPCSpeaker());
            SetBeenHired(TRUE, oEscudeiro);
            SetFormerMaster(GetPCSpeaker(), oEscudeiro);
            SetAssociateListenPatterns(oEscudeiro);
            SetLocalInt(oEscudeiro,"NW_COM_MODE_COMBAT",ASSOCIATE_COMMAND_ATTACKNEAREST);
            SetLocalInt(oEscudeiro,"NW_COM_MODE_MOVEMENT",ASSOCIATE_COMMAND_FOLLOWMASTER);
            AddHenchman(oPC, oEscudeiro);

And the AI list of scripts attached to my creature henchman:


 


[ResRefs]

OnBlocked=nw_ch_ace

OnDamaged=nw_ch_ac6

OnDeath=nw_ch_ac7

OnConversation=nw_ch_ac4

OnDisturbed=nw_ch_ac8

OnCombatRoundEnd=nw_ch_ac3

OnHeartbeat=nw_ch_ac1

OnPhysicalAttacked=nw_ch_ac5

OnPerception=nw_ch_ac2

OnRested=nw_ch_aca

OnSpawn=nw_ch_ac9

OnSpellCast=nw_ch_acb

OnUserDefined=nw_ch_acd

 

I have a custom conversation that runs nw_ch_gomelee, the script default that makes henchmans stopping with ranged attacks:

 

[OWNER] Yes, Lord. What do you wish from me?

[PC] I would you stop with ranged attacks and start only melee. 

 

And so run nw_ch_gomelee script:

 



#include "nw_i0_generic"
void main()
{
    SetAssociateState(NW_ASC_USE_RANGED_WEAPON, FALSE);
    ClearAllActions();
    EquipAppropriateWeapons(GetMaster());
}

My henchman is continuing using area spells, spells, and I would like to make it stop doing that and just work on melee function.


Do you know anything I can do?



               
               

               
            

Legacy_WhiteTiger

  • Hero Member
  • *****
  • Posts: 889
  • Karma: +0/-0
Henchmans starting melee combat (only melee)
« Reply #3 on: January 24, 2015, 07:42:34 pm »


               

There is no one default conversation action of henchman working like 'making henchman start to walk sealth', 'change heal tatics', 'Start search while walking', 'Stop with melee weapons'...


 


Do you know whats happening? There is missing something?



               
               

               
            

Legacy_WhiteTiger

  • Hero Member
  • *****
  • Posts: 889
  • Karma: +0/-0
Henchmans starting melee combat (only melee)
« Reply #4 on: January 24, 2015, 07:48:41 pm »


               

Why SetAssociateState(NW_ASC_USE_RANGED_WEAPON, FALSE); is not working?



               
               

               
            

Legacy_WhiteTiger

  • Hero Member
  • *****
  • Posts: 889
  • Karma: +0/-0
Henchmans starting melee combat (only melee)
« Reply #5 on: January 24, 2015, 08:08:38 pm »


               


Go melee works in conversation prior to combat. The only bug I know is that higher-level Rangers fail to melee.




 


Which conversation OnConversation event or henchmans conversation .dlg?



               
               

               
            

Legacy_Proleric

  • Hero Member
  • *****
  • Posts: 1750
  • Karma: +0/-0
Henchmans starting melee combat (only melee)
« Reply #6 on: January 28, 2015, 08:15:46 am »


               

Sorry for the delay. I had another look at this. I'm using nw_ch_gomelee (unmodified) in a henchman conversation action taken. The weapon line in the hiring script is the same as yours.

 

The most obvious sign that it's working is that the henchman immediately unequips ranged weapons and equips melee weapons.

 

Does the henchman melee when they're out of spells?

 

I suspect that preventing spell-casting is more difficult. My understanding is that the AI will first decide whether to cast spells, then, if not, choose ranged or melee weapons.


A first look at the Bioware AI scripts suggests that


 


SetLocalInt(OBJECT_SELF, "X2_L_STOPCASTING", 10);


 


might stop spell-casting, but I'm not sure whether it works - you'd have to try it.



               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Henchmans starting melee combat (only melee)
« Reply #7 on: January 28, 2015, 11:45:21 am »


               

The int variable X2_L_BEH_MAGIC if set to "0" will make the creature never use magic in combat. The variable uses a range from "0" (never) to "100" (always). I have used this with monsters to change the amount of spellcasting they use in combat, but I'm not sure if it works on henchmen.


 


Good find on that variable Proleric. I suspect that would work as well. Bioware has a lot of variables they used in the X1 and X2 expansions that aren't well documented. I've documented quite a few myself - maybe I should cleanup and post that document for download. 



               
               

               
            

Legacy_boodah83

  • Full Member
  • ***
  • Posts: 247
  • Karma: +0/-0
Henchmans starting melee combat (only melee)
« Reply #8 on: January 28, 2015, 03:01:58 pm »


               

That would be pretty useful for many builders, I think. I'm still using the Aurora Builder's Guide you released with your haks a while ago as a cheat sheet for variables.


               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Henchmans starting melee combat (only melee)
« Reply #9 on: January 28, 2015, 03:23:19 pm »


               

I've got to really revamp that and focus more on the stuff already built into the game and some of the new things I've discovered playing around with OnUserDefined events.



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Henchmans starting melee combat (only melee)
« Reply #10 on: January 28, 2015, 06:08:15 pm »


               

As I explained OP in personal message (why the hell are you sending PM to me and posting thread on forum at the same time WhiteTiger?), to order henchmans not to use spells is a built in feature via henchman radial menu, "Toggle Spell-Casting". I don't understand why he wants to make it vis conversation then.



               
               

               
            

Legacy_WhiteTiger

  • Hero Member
  • *****
  • Posts: 889
  • Karma: +0/-0
Henchmans starting melee combat (only melee)
« Reply #11 on: January 28, 2015, 10:06:08 pm »


               


As I explained OP in personal message (why the hell are you sending PM to me and posting thread on forum at the same time WhiteTiger?), to order henchmans not to use spells is a built in feature via henchman radial menu, "Toggle Spell-Casting". I don't understand why he wants to make it vis conversation then.




 


Sorry the delay, was traveling to Rio de Janeiro.


 


Yes, I was in need to resolve this issue as quickly as possible since the players were in trouble with the henchmans which hitherto has become very important in my server.


 


After talking with my friend Shadooow he explained that the features in the henchmans radial menu is in OnConversation event. So it was easy to copy the actions from OnConv. script and paste to the scripts of my custom conversation and worked successfuly (toggle spell casting, use stealth, search...).


 


Thanks Shadooow, Pstemarie, Proleric and boodah83