Aller au contenu

Photo

NPCs say random things when battled


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

#1
Grani

Grani
  • Members
  • 554 messages
 Well, I ran into a strange problem. When I attacked some NPCs in my module's town they start fighting me but at the same time say random lines of their conversations. These lines are chosen completely randomly, I think, from different branches of conversation and often the ones my current PC couldn't trigger normally.

It's not only the enemy NPCs, my henchmen do that too. What the heck? 0_0

Thanks for help. ;)

#2
Grani

Grani
  • Members
  • 554 messages
No one knows what might cause this problem?
It only occurs in the town and town's buildings, I have no idea why.
With some further tests I can tell that the problem is with townsfolk. If one of them is attacked, he and all other NPCs start talking this random stuff. But as long as no citizen is attacked, everything seems to be alright. I cannot figure out what's wrong with this NPC, though.

Modifié par Grani, 07 juin 2012 - 05:44 .


#3
kalbaern

kalbaern
  • Members
  • 824 messages
Odds are that in your NPCs OnSpawn events, one of the following is enabled

SetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION);

or

SetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION);

Give them a custom version with both of those options removed or commented out. Should fix your issues.

#4
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages

kalbaern wrote...

Odds are that in your NPCs OnSpawn events, one of the following is enabled

SetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION);

or

SetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION);

Give them a custom version with both of those options removed or commented out. Should fix your issues.


Hmm,  What kind of odds are you giving?   

Ahh,  doesn't matter,  Ill put 20 copper on the  OnConversation event.

#5
Grani

Grani
  • Members
  • 554 messages
I checked it, but it looks like something else is the reason.

The scripts of my villager NPC are as follows:
x2_def_onblocked
x2_def_endcombat
x2_def_onconv
x2_def_ondamage
nw_c2_default7
x2_def_ondisturb
x2_def_heartbeat
x2_def_percept
x2_def_attacked
x2_def_rested
x2_def_spawn
x2_def_spellcast
x2_def_userdef

As you can see, I didn't modify any scripts, these are all the default ones - except for death script, because I wanted to adjust PC's alignment by killing townsfolk. But this one was not modified either.

Thanks for help. :)

#6
kalbaern

kalbaern
  • Members
  • 824 messages
"x2_def_spawn" just calls "nw_c2_default9". The X2 scripts were added so you could customize stuff, then still fire the default scripts after (or not) depending on your changes in the X2 scripts. The X2 scripts also enable the horse scripts for NPCs.

So first check your "nw_c2_default9". That's what is actually called in your current OnSpawn Event. Normally, unless it's been customized, your OnConversation Event will not fire the convos if it was not first enabled in the OnSpawn Event.

#7
Grani

Grani
  • Members
  • 554 messages
I see, I never really checked those scripts myself.
But there's nothing suspicious about nw_c2_default9, both "SetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION);"
and
"SetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION);"
are commented in.

Modifié par Grani, 07 juin 2012 - 10:27 .


#8
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
In the onConversation script. NW_C2_DEFAULT4 that is being ran by x2_def_convo.

Make sure that you still have the filter for when the listening pattern is -1. in the original script it looks like this.

int nMatch = GetListenPatternNumber();
object oShouter = GetLastSpeaker();

if (nMatch == -1)

Without that filter in the script every time someone shouts, because they where attacked, or utters a word for any reason  the NpC is treating the Chat/Shout  the same way they would handle the PC clicking on them.

Modifié par Lightfoot8, 07 juin 2012 - 10:27 .


#9
Grani

Grani
  • Members
  • 554 messages
Oh? Nw_c2_default4 script looks totally different for me, somehow. Hmm, maybe I accidentally replaced it with something else sometime ago. I will check it in like twenty minutes and write the outcome.

But that will probably be it, so thanks. :) Will edit.

Edit: I took the script of the same name from OC but it didn't seem to work. I will check the rest of the villager's scripts, maybe more are messed up, but will do it tomorrow, since it's really late for me now.
If you have any other ideas, I will be grateful to hear them! Thanks for help given already!

Modifié par Grani, 07 juin 2012 - 10:57 .


#10
Grani

Grani
  • Members
  • 554 messages
Ehh... When I try to replace the content of the scripts with the original ones, taken from fresh module, I get compilation errors. o_o

#11
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
It sounds like someone changed the includes that it uses.

But you do not have to recompile the script to revert it back to the standard boiware script, All you have to do is delete the custom script. It is basicly overriding the script that is in the .bif's. once it is deleted the original script will take back over.

You may want to make a back of the module/script before you do that though. Just incase there is something else that they did that you decide that you want later.

#12
Grani

Grani
  • Members
  • 554 messages
Ahh, looks like everything is back to normal now. :) Thanks a lot! Thank goodness there is still such a good community for such an old game.