![]() |
Why do NPCs attacking eachother (Seemingly randomly) run away from each other? - Printable Version +- SphereCommunity (https://forum.spherecommunity.net) +-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d) +--- Forum: General Help (/Forum-General-Help) +--- Thread: Why do NPCs attacking eachother (Seemingly randomly) run away from each other? (/Thread-Why-do-NPCs-attacking-eachother-Seemingly-randomly-run-away-from-each-other) |
RE: Why do NPCs attacking eachother (Seemingly randomly) run away from each other? - Extreme - 08-02-2012 02:35 AM I have the same problem, thats very strange. RE: Why do NPCs attacking eachother (Seemingly randomly) run away from each other? - darksun84 - 08-02-2012 02:59 AM By commanding npc to kill each other via "chicken kill" mine chickens are still fighting, did you get the problem even in this way? RE: Why do NPCs attacking eachother (Seemingly randomly) run away from each other? - Anarch Cassius - 08-02-2012 03:53 AM Just a hunch... try giving them a different brain. A blank one from beyond the end of the list. It will have no behavoir built in. See if that still has these issues or if only defined brain types do. RE: Why do NPCs attacking eachother (Seemingly randomly) run away from each other? - WRWR - 08-02-2012 04:55 AM Ahh, its hardcoded thing ![]() RE: Why do NPCs attacking eachother (Seemingly randomly) run away from each other? - Rayvolution - 08-02-2012 05:47 AM hmmm, it may be hardcoded then, if so anyone have any tips on a work around? I don't have elves on my server at all, when I get home I'll try making all my guards "Elves" bodies and see if that fixes it. It won't correct the hardcoded issue, but at least it'll allow my guards to attack anything on my server as they should be. Update: Using c_elf_male/female works like a champ, they attack everything now! Since I have no plans on ever having elves on my server, I just simply have to cover their ears with the right hairstyles and no one is the wiser. I'm not keen on hacky workarounds, but hey, it's working! ![]() Now I just need to code the guards correctly. Does anyone know if there's a way to detect if the target is hostile? Not necessarily in combat mode, but just red/aggressive? Right now, this is my basic "attack" script: Code: ON=@NPCLookAtChar I know it's missing a few flags/brains, I just set it up for testing purposes. But is there a more simple way to do it or do I have to specify every condition that makes a target red/aggressive? RE: Why do NPCs attacking eachother (Seemingly randomly) run away from each other? - darksun84 - 08-02-2012 08:09 AM == not = ![]() RE: Why do NPCs attacking eachother (Seemingly randomly) run away from each other? - Rayvolution - 08-02-2012 10:37 AM (08-02-2012 08:09 AM)darksun84 Wrote: == not = hah, whoops. Good catch. I'm writing my own AI script now anyway, so it doesn't even matter anymore. Since I'm rewriting all my Mobs 1 by 1 as I add them to the world, I'm also giving them all special events and what not for AI flags. So now; Code: [EVENTS e_AI_Guard] But, now all my mobs in the entire game will have event flags setup for the AI, allowing certain types to fight each other. For example, e_AI_Carnivore will attack e_AI_Small_Animals, and e_AI_Hostile will always attack any e_AI_Friendly, etc. It's also setup so each base event can have abilities.. so it'll be a very simple and easy to expand AI system, pretty much based on Anarch's ideas it's just my spin on it. I'm just not using any tags at all. I just have NPCs/Mobs attack/defend/react to each other based on what events they have. Any advanced AI can be written into the event itself for each event type. Basic idea os what I have now (Hardly done at all, I'm just setting up) Code: [EVENTS e_AI_Guard] RE: Why do NPCs attacking eachother (Seemingly randomly) run away from each other? - Rayvolution - 08-02-2012 03:31 PM hmmm, it looks like im having another problem now. I didn't notice it before in testing because at the time, the IF statement didnt actually matter to run the script. It looks like the EVENT cant detect when your target has an event applied to him. This IF won't fire: IF (<SRC.TEVENTS> == e_AI_Hostile) I've wrote up every way I could think of to make the IF statement fire. I can get it to work with tags, but it would be much simplier if it could figure out it's target's TEVENTS. Any ideas? :/ RE: Why do NPCs attacking eachother (Seemingly randomly) run away from each other? - Extreme - 08-02-2012 03:37 PM IF STRMATCH(*e_AI_Hostile*,<SRC.EVENTS>) RE: Why do NPCs attacking eachother (Seemingly randomly) run away from each other? - Gil Amarth - 08-02-2012 04:05 PM You can try ISTEVENT. IF (<SRC.TEVENTS.ISTEVENT.e_AI_Hostile>) It works in my system. |