Rayvolution
Journeyman
Posts: 135
Likes Given: 0
Likes Received: 2 in 2 posts
Joined: Jul 2012
Reputation: 1
Aetharia
|
Why do NPCs attacking eachother (Seemingly randomly) run away from each other?
I'm working on my "realistic guards" script, and I'm having trouble getting the AI to act correctly, for some reason (and only with certain NPCs) they will attempt to attack each other, and retreat.
I thought it was something as simple as they detected the stats of the target and run, but that doesn't explain why I can code a guard with 1/1/1 stats to attack a Wyrm, and he does so.
I also noted that it seems to have to do with the type of NPC, for example, I can't get 2 skeletons to fight either.
An MMORPG based on the Ultima Online engine.
Completely Custom Map, GUI, AI, Combat, Skills, Crafts, Art, Music and so much more.
http://aetharia.com - Home of Ambition!
|
|
08-01-2012 09:58 AM |
|
|
Rayvolution
Journeyman
Posts: 135
Likes Given: 0
Likes Received: 2 in 2 posts
Joined: Jul 2012
Reputation: 1
Aetharia
|
RE: Why do NPCs attacking eachother (Seemingly randomly) run away from each other?
Hmm, that might explain it.
Although there must be some other flags too, because I noticed for some reason, even brain_guard will "run away" from other human NPCs, even if you flag them red, criminal, and brain_monster
It's very strange :/
I can't use brain_guard for my script though anyway, because when "spawned" via spawngem, they vanish. They'll only stick around if I manually add them via Axis.
Even stranger: Brain_None on the guard won't change his behavior. He still "runs away" from all human characters.
Looking more into it, it seems that basically any NPC with the same Body won't attack each other.
It's so specific, that my male guards will attack female NPCs but not male ones (and vice versa).
I'm perplexed :/
An MMORPG based on the Ultima Online engine.
Completely Custom Map, GUI, AI, Combat, Skills, Crafts, Art, Music and so much more.
http://aetharia.com - Home of Ambition!
(This post was last modified: 08-01-2012 11:51 AM by Rayvolution.)
|
|
08-01-2012 11:04 AM |
|
|
Rayvolution
Journeyman
Posts: 135
Likes Given: 0
Likes Received: 2 in 2 posts
Joined: Jul 2012
Reputation: 1
Aetharia
|
RE: Why do NPCs attacking eachother (Seemingly randomly) run away from each other?
(08-01-2012 09:24 PM)darksun84 Wrote: In @NpcActFight there is this argument
ARGN2
IO
The NPC's motivation level to fight.
Note: NPCs, excluding pets, with a motivation less than zero will flee from their target.
Maybe it can be useful
Nope, didn't work.
It's very strange indeed, I can even spawn a generic bad guy NPC (Example, a male bandit) and the guard will see the bandit, "attack" and just turn around and walk away from the target in combat mode.
*but* if I spawn a female bandit, he attacks correctly. I even went as far as summing male NPCs and doing .set body c_woman, and he will instantly stop walking away in combat mode, and attack.
After further tested, I realized this is with *all* characters in the game. For example, 2 skeletons wont fight each other when told, but a skeleton and a zombie will. Same with Dragons, Balrons, Elementals and every single other character I've tested.
An MMORPG based on the Ultima Online engine.
Completely Custom Map, GUI, AI, Combat, Skills, Crafts, Art, Music and so much more.
http://aetharia.com - Home of Ambition!
(This post was last modified: 08-01-2012 11:08 PM by Rayvolution.)
|
|
08-01-2012 11:05 PM |
|
|
WRWR
Journeyman
Posts: 212
Likes Given: 30
Likes Received: 1 in 1 posts
Joined: Mar 2012
Reputation: 1
|
RE: Why do NPCs attacking eachother (Seemingly randomly) run away from each other?
maybe you have something like this in main npc event:
Code:
ON=@ATTACK
IF <SRC.BASEID>==<BASEID>
RETURN 1
ENDIF
?
|
|
08-01-2012 11:47 PM |
|
|
Rayvolution
Journeyman
Posts: 135
Likes Given: 0
Likes Received: 2 in 2 posts
Joined: Jul 2012
Reputation: 1
Aetharia
|
RE: Why do NPCs attacking eachother (Seemingly randomly) run away from each other?
I can dig through my events but thats strange is the NPCs dont just return 1 and resume normal operation. They stay in combat mode, and just steady wander away from their target.
- Trigger fires to fight target
- Goes into combat mode, triggers the NAME attacking TARGET emote
- (still in combat mode) starting slowly walking directly away from the target.
- When out of view completely (screen or so away) leaves combat mode, and wanders back to his spawn point like nothing happened.
Although if it's a different baseID, he'll see them, go in combat mode and run after/kill the target.
I've tried remving their brains, all their speech flags, triggers, events, everything and manually forced them to attack each other, and they still do it. I can't ven get 2 c_chickens to fight. It's really odd. :/
MonsterFight is set to 1, also.
An MMORPG based on the Ultima Online engine.
Completely Custom Map, GUI, AI, Combat, Skills, Crafts, Art, Music and so much more.
http://aetharia.com - Home of Ambition!
|
|
08-02-2012 02:10 AM |
|
|