Aller au contenu

Photo

Henchmans starting melee combat (only melee)


  • Veuillez vous connecter pour répondre
11 réponses à ce sujet

#1
WhiteTiger

WhiteTiger
  • Members
  • 479 messages

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



#2
Proleric

Proleric
  • Members
  • 2 359 messages
Go melee works in conversation prior to combat. The only bug I know is that higher-level Rangers fail to melee.
  • WhiteTiger aime ceci

#3
WhiteTiger

WhiteTiger
  • Members
  • 479 messages

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?



#4
WhiteTiger

WhiteTiger
  • Members
  • 479 messages

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?



#5
WhiteTiger

WhiteTiger
  • Members
  • 479 messages

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



#6
WhiteTiger

WhiteTiger
  • Members
  • 479 messages

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?



#7
Proleric

Proleric
  • Members
  • 2 359 messages

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.


  • WhiteTiger aime ceci

#8
Pstemarie

Pstemarie
  • Members
  • 2 745 messages

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. 


  • boodah83 et WhiteTiger aiment ceci

#9
boodah83

boodah83
  • Members
  • 219 messages

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.


  • Pstemarie et WhiteTiger aiment ceci

#10
Pstemarie

Pstemarie
  • Members
  • 2 745 messages

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.


  • boodah83 et WhiteTiger aiment ceci

#11
Shadooow

Shadooow
  • Members
  • 4 471 messages

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.


  • WhiteTiger aime ceci

#12
WhiteTiger

WhiteTiger
  • Members
  • 479 messages

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