Author Topic: ActionEquip on henchman issue  (Read 293 times)

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
ActionEquip on henchman issue
« on: July 21, 2012, 03:29:56 pm »


               I noticed in my recent HotU gameplay that my henchmans do not swap weapons in combat. Looked into AI and the command to do that is in there and is executed, however it fails.

Lexicon doesn't know about this issue, but it seems hardcoded like henchmans cannot swap their weapons at all - they can unequip, but all calls to equip doesnt work.

So far the only solution Ive found was to RemoveHenchman and after 0.1sec AddHenchman back but thats really stupid solution.
               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
ActionEquip on henchman issue
« Reply #1 on: July 21, 2012, 05:25:08 pm »


               

ShaDoOoW wrote...

I noticed in my recent HotU gameplay that my henchmans do not swap weapons in combat. Looked into AI and the command to do that is in there and is executed, however it fails.

Lexicon doesn't know about this issue, but it seems hardcoded like henchmans cannot swap their weapons at all - they can unequip, but all calls to equip doesnt work.

So far the only solution Ive found was to RemoveHenchman and after 0.1sec AddHenchman back but thats really stupid solution.


Is this problem with all three commands: ActionEquipMostDamagingMelee/Ranged()  and  ActionEquipItem() ?  Does the AI clear the equip action before it can be performed?

If you haven't already test this script in the OnDamaged event of an associate without any other scripts used for its events.

void main()
{
ClearAllActions(TRUE);
ActionEquipMostDamagingMelee();
ActionDoCommand(SetCommandable(TRUE));
SetCommandable(FALSE);
}
               
               

               


                     Modifié par WhiZard, 21 juillet 2012 - 04:25 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
ActionEquip on henchman issue
« Reply #2 on: July 21, 2012, 06:51:54 pm »


               at first i tried the setcommandable trick and even removing the actionattack later, then I realized this is probably external issue so I moved my tests to the OnChat event, there I added the test message that tries to equip items, all of this is done outside of combat of course, nothing I even tried to remove all scripts

though, I didnt checked equipmostdamagingRanged - and that works, interesting - my testing NPC is slightly modified "Sharwyn lvl 14", I leveld her to 16bard 4fighter and give her Nameless light bastard sword and +3small shield. Equipping the shield or bastard fails if she is my henchman, if i release it works.

but I tried the same with default sharwyn, she is wilding bow by default but in her backpack there is double sword and the equipping most damaging melee works there. *confused*

Tried to search in Omnibus, one guy had same issue but the suggested advice is useless
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
ActionEquip on henchman issue
« Reply #3 on: July 21, 2012, 07:02:22 pm »


               found it! While NPCs can use unidentified items normally, henchmans (after they are hired) cannot. Any item added manually in toolset or by script must be set to identified first. This is a bit issue creating henchman blueprint - in this case GFF editor should avoid need of the custom identified weapon or script identifying items OnSpawn.

Anyway - the AI - function bkEquipMelee doesn't check the identify flag which may lead into such issues. Something I should fix.