SphereCommunity
Make NPC's attack eachother. - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: Make NPC's attack eachother. (/Thread-Make-NPC-s-attack-eachother)



Make NPC's attack eachother. - Jonaleth - 04-24-2012 08:16 PM

I've problems in scripting monsters to attack eachother. I want npc's to act aggressive towards eachother. For example; I want earth elementals to be friendly to all creatures but orcs and ogres.

I've tried to use on=@NPCSEECHAR trigger, but I think it only triggers with PC and not NPC. I know of the method of using beserk brain, and make him not attack all others but orcs and ogres, but I thought that it might excist an easier way?

Thank you for your help!


RE: Make NPC's attack eachother. - Nachtmusique - 04-24-2012 10:43 PM

Npcseechar does work with other npcs. It's been a while, but I think it was as simple as:

On=@npcseechar
If (your checks here)
Attack
Endif

I think one problem I did have
was that a lot of npcs were too smart to fight. They would see the enemy and flee instead of attacking.


RE: Make NPC's attack eachother. - WRWR - 04-25-2012 12:50 AM

also check Monsterfight in sphere.ini


RE: Make NPC's attack eachother. - Jonaleth - 04-25-2012 06:30 PM

Hello again.

This is what I've done, that didn't work;

ON=@NpcSeeChar
If <src.tag0.orc> == 1
ATTACK
ELSE
RETURN 0
ENDIF

I've added tag0.orc=1 to all orcs and Monsterfight in sphere.ini is at 1. So I do not understand why this doesn't work, IF on=@NpcSeeChar works on other NPC's. I've to even use;

ON=@NpcSeeChar
Say Hello!

Still doesn't work. What can then be wrong?


RE: Make NPC's attack eachother. - admin phoenix - 04-25-2012 07:32 PM

you have to turn on the trigger in your sphere.ini


RE: Make NPC's attack eachother. - Jonaleth - 04-25-2012 08:35 PM

@Admin Phoenix

You mean this option or is there any other option;

// Monsters may fight each other
MonsterFight=1

Still no change.


RE: Make NPC's attack eachother. - admin phoenix - 04-25-2012 09:48 PM

sphere.ini check out EF_New_Triggers


RE: Make NPC's attack eachother. - Khaos - 04-29-2012 12:54 PM

Did this resolve the issue?


RE: Make NPC's attack eachother. - Jonaleth - 04-29-2012 10:57 PM

Yes thank you! It solved the problem. :-)