Aller au contenu

Photo

NPC Summoned Creature Attacks Own Master - AoE Affecting?


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

#1
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages
Hi All,

This is quite a difficult problem to track down, and while I have been able to "fix" the problem, I have had to do so in a way that is not as good as I had hoped. If someone can help me get to the nitty-gritty of where this is going wrong, then please let me know. (Edit: This may be the simplest way of fixing it - by editing the spells that go awry, but if a better solution is suggested, then maybe I can use that.)

Here is the scenario ....

1) Goblin summons creature (wolf) from heartbeat when HenchTalentAdvancedBuff(40.0) fires.
2) PC then closes for combat with goblin and summoned wolf.
3) Goblin then casts Entangle spell, which captures PC and summoned wolf.
4) Wolf will now (occassionally) turn on the caster - it's summoner goblin - even though still hostile to PC.

I have tried a number of things, including trying to place in checks to keep the faction of the wolf and goblin the same. However, the only thing I can do at the moment that keeps the wolf attacking the PC (and this may be a clue as to how to fix it more properly) is to comment out the SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_ENTANGLE)); in both the initial entangle spell and its heartbeat script.

I intend to add a variable that changes the "harmful" nature of the spell in the above line of code to FALSE if the target is a summoned creature, which will narrow down the check somewhat. Here is the spell fix script that I am currently using:-

// FIX SUMMONED CREATURES REACTIONS
    int REACTION = TRUE; if (GetAssociateType(oTarget) == ASSOCIATE_TYPE_SUMMONED){REACTION = FALSE;}   
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_ENTANGLE, REACTION));

However, does anybody know why this summoned wolf is actually attacking the goblin when I thought the default creature spell on cast at scripts were designed to ensure the reputation between summoner and summoned remained intact, and thereby prevent the summoned creature attacking its "master"? EDIT: Is the wolf's heartbeat causing a problem by counteracting the on cast at script? And by the way, NPC AoE damaging allies is set to FALSE.

Lance.

Modifié par Lance Botelle, 01 avril 2011 - 06:41 .


#2
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
A really sloppy workaround would be just to not give the summoning goblin the entangle spell, if that's the only problem spell.

How is the goblin summoning the wolf? It it through the summon creature I spell or through cusom scripting?

Have you considered changing the "on spell cast at" script of the wolf to make sure the faction doesn't change? How much of the AI have you tinkered with? I wonder if you may have changed something that is leading to this behavior? I only ask because I have never seen a summoned creature turn on its summoner.

I'll mull this over and see what else I think of.

#3
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

M. Rieder wrote...

A really sloppy workaround would be just to not give the summoning goblin the entangle spell, if that's the only problem spell.

How is the goblin summoning the wolf? It it through the summon creature I spell or through cusom scripting?

Have you considered changing the "on spell cast at" script of the wolf to make sure the faction doesn't change? How much of the AI have you tinkered with? I wonder if you may have changed something that is leading to this behavior? I only ask because I have never seen a summoned creature turn on its summoner.

I'll mull this over and see what else I think of.



Hi Matt,

I have given the goblin the Summon Creature I special ability, which is summoned using the "buff" in its heartbeat. So, there is no real alteration of AI script involved there ... just using the default available.

I tried altering the default scripts on the wolf to some of my own, but it still turned and attacked on occassion.

I could remove the entangle spell, but that would feel like I was cheating the goblin - and the workaround I have above does work ... it's just if I have to apply it to other spells as well now. Noteabley, AoE spells, I am guessing.

Lance.

#4
painofdungeoneternal

painofdungeoneternal
  • Members
  • 1 799 messages
I just made npc's summon more npc's and skipped the entire summon bit. I have flags that unsummon things when the master is destroyed and the like, but summons don't last long enough to matter ). Swapping scripts, changing factions, those caused a pause on summon i was trying to prevent. This is an issue that started with TonyK's AI with 1.23.

I imagine if they go hostile on hitting the AOE, its just like if you fireball your buddy in your party and he goes hostile on you. Sounds like you have this set module wide, and it's affecting npc's as well. I don't have full pvp on, but i have personal reputations, i would guess this is part of the problem in that you have it full pvp and have personal reputations.

i think the actual AI needs to be fixed on this, i'll try to take a look at where this might be happening, perhaps do some checks to prevent a creature from attacking his master if he's a summon and the master is a NPC. Might even add this to the creatures ondamaged event. Regardless i think we need to try to fix this where the problem is coming from as you can't just mod every AOE to fix this.

#5
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

painofdungeoneternal wrote...

I just made npc's summon more npc's and skipped the entire summon bit. I have flags that unsummon things when the master is destroyed and the like, but summons don't last long enough to matter ). Swapping scripts, changing factions, those caused a pause on summon i was trying to prevent. This is an issue that started with TonyK's AI with 1.23.

I imagine if they go hostile on hitting the AOE, its just like if you fireball your buddy in your party and he goes hostile on you. Sounds like you have this set module wide, and it's affecting npc's as well. I don't have full pvp on, but i have personal reputations, i would guess this is part of the problem in that you have it full pvp and have personal reputations.

i think the actual AI needs to be fixed on this, i'll try to take a look at where this might be happening, perhaps do some checks to prevent a creature from attacking his master if he's a summon and the master is a NPC. Might even add this to the creatures ondamaged event. Regardless i think we need to try to fix this where the problem is coming from as you can't just mod every AOE to fix this.


Hi Pain,

As far as I am aware I have all NPC ally affecting variables set to FALSE and UsesPersonalReputations (Campaign editor) is set to FALSE. Players *can* affect allies and neutrals, but these settings should not be affecting the NPCs should they?

As you say, I had hoped there might be an easier way than mod every AoE spell, but as I am having to mod most spells anyway (for other campaign reasons), then doing this along the way would not be as bad for me as possibly others. Besides, I just like to know where/why it is happening. Posted Image

My current theory (which you can probably take with a pich of salt) is that the creature is somehow redefining its current target (enemy) as a result of a heartbeat firing and something being run from there. For while the On Spell Cast checks for friendly fire, I am not sure the functions fired in the heartbeat (that call other functions buried deep away somewhere) do.

EDIT: Change faction function does appear a bit cumbersome, as I have noticed slight pauses when it is used. Unfortunately, I have used it in a few places where I cannot avoid it.

EDIT: Also forgot to add that I allow summons to last for hours now.

Thanks for all this AI help Pain ... Posted Image

Lance.

Modifié par Lance Botelle, 01 avril 2011 - 11:07 .