Aller au contenu

Photo

Summoned NPC won't act like follower


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

#1
Zephyrys

Zephyrys
  • Members
  • 19 messages

Hello,

 

I'm trying to create an item that summons an NPC to fight with you, like a summoned monster would, with a dialogue resembling a familiar.  I created the NPC and conversation, assigned the typical henchmen scripts to her, and created the scripted item to summon her.  However, she stays right at the spot she is summoned, won't move, and won't take commands.  Her conversation seems to work correctly, identifying the person who used the summoned item as her master, and I can dismiss the summon as well, but she's just not responsive.  Is there something I'm missing here?



#2
Baaleos

Baaleos
  • Members
  • 1 330 messages

In order to give the summoned creature henchman type interactions through the radial menu, it needs to use a specific script set.

 

I believe these are the scripts I use

 

If you are using nwnx, then you can use nwnx_funcs to set these programatically at runtime.

However if you are not using nwnx, these must be set on the creature in toolset.

 

 

OnBlocked: nw_ch_ace
OnCombatRoundEnd: nw_ch_ac3
OnConversation: nw_ch_ac4
OnDamaged: nw_ch_ac6
OnDeath: nw_ch_ac7
OnDisturbed: nw_ch_ac8
OnHeartbeat: nw_ch_ac1
OnPerception: nw_ch_ac2
OnPhysicalAttacked: nw_ch_ac5
OnRested: Leave Blank
OnSpawn: nw_ch_ac9
OnSpellCastAt: nw_ch_acb
OnUserDefined: nw_ch_acd


#3
Zephyrys

Zephyrys
  • Members
  • 19 messages

Thanks for the reply, but I did say in my above post that I did give the typical Henchmen scripts to her, which match the ones you gave.



#4
Baaleos

Baaleos
  • Members
  • 1 330 messages

Ok, you say that she identifies the user as the master.

That would be via

GetMaster() ? right?

 

It shouldnt matter, but are you sure the creature is not secretly hostile to the owner?

 

Eg: Being master / summon does override hostility, but I've observed in the past that strange behaviour can happen if they are secretly hostile due to faction conflicts when summoned.

Have you tried setting its faction to something neutral or player aligned?



#5
Zephyrys

Zephyrys
  • Members
  • 19 messages

Right, GetMaster().

 

According to the toolset, she is of the Commoner faction.



#6
Squatting Monk

Squatting Monk
  • Members
  • 446 messages

Can you post the script you're using to summon her?



#7
Zephyrys

Zephyrys
  • Members
  • 19 messages

The summoning code is a pretty simplistic affair:

 

void main()
{
object oPC;
 
oPC = GetItemActivator();
 
effect eEffect;
eEffect = EffectSummonCreature("aniser_yp", VFX_FNF_SUMMON_UNDEAD, 1.0);
 
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oPC);
 
}


#8
Proleric

Proleric
  • Members
  • 2 356 messages
After creating the companion, you need to run a hiring script IIRC. Not at my desk right now, but worth checking other summoning scripts.

#9
Zephyrys

Zephyrys
  • Members
  • 19 messages

A hiring script?  What would that entail?  The way the summon is written now, the NPC automatically appears in the party, no hiring required.  Or so I thought.



#10
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages

The henchman commands on the radial issue shouts to the subject.  So in order for them to respond they first and foremost have to be listening.  Second they have to have a suitable script in their OnConversation  event to handle the request. 



#11
Zephyrys

Zephyrys
  • Members
  • 19 messages

Well, what would I have to do in particular that I'm not doing right now?  I mean, for all intents and purposes, she summons in exactly like a Summon Spell or a premade summoning item would.  So what lines of script would I need to put where?



#12
Proleric

Proleric
  • Members
  • 2 356 messages
OK now I'm back at my desk, I see a hiring script is not necessary. Apologies.

However, according to the Lexicon, "The creator of the effect (the caller of the script) will be the master - not who it is targeted on". The caller for OnActivateItem is the module, so, implicitly, you're saying that the module is the master. I'd try
AssignCommand(oPC, ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oPC));


#13
meaglyn

meaglyn
  • Members
  • 811 messages

If that is indeed the issue you will need to do it like this I believe:

AssignCommand(oPC, ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectSummonCreature("aniser_yp", VFX_FNF_SUMMON_UNDEAD, 1.0), oPC));

Or make a function to have the PC make the effect and apply it.  The effect creator is the one who executes the EffectSummonCreature not the ApplyEffectToObject.



#14
Proleric

Proleric
  • Members
  • 2 356 messages
I knew there was a reason why I always use effects inline, without declaring them... thanks for the correction.

#15
Zephyrys

Zephyrys
  • Members
  • 19 messages

This did not fix the issue.  The NPC in question still does not follow, or respond to commands.

 

Script now looks like:

void main()
{
object oPC;
 
oPC = GetItemActivator();
 
AssignCommand(oPC, ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectSummonCreature("aniser_yp", VFX_FNF_SUMMON_UNDEAD, 1.0), oPC));
 
}


#16
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages

post your onspawn and OnConcersation scripts.   Make sure that you get the ones that your creature are using in a spawned in condition.  

 

The simplest way that I can think of to make sure that you get the correct scripts is to make a copy of your spawned in creature.

      (A simple custom widget to copy the creature should do.)

 

Save the game.  

Open the saved Game in the toolset by right-clicking on it,  selecting 'Open With...'  and browsing to the toolset.  

inspect you creature to make sure that is it using the scripts that you think it is.  

 

If you need help with the custom widget, post back for help. 



#17
Zephyrys

Zephyrys
  • Members
  • 19 messages

Update on this:  Apparently I had assigned the default henchmen scripts but at some point, I don't know when, they had reverted back to NPC defaults.  When I put the henchman scripts back in, she behaves as she should.

 

Well, she casts a couple of buffs and then just sits there, but that's because we overloaded her with more spells than she should have for her level, I think.

 

Does anyone know, also, how to make the summon possess-able?