Thread Rating:
- 0 Votes - 0 Average
- 1
- 2
- 3
- 4
- 5
Npcs attacking each other
|
Author |
Message |
Gil Amarth
Journeyman
Posts: 189
Likes Given: 2
Likes Received: 1 in 1 posts
Joined: May 2012
Reputation: 0
|
Npcs attacking each other
I´m thinking about a faction system that allow npcs player attack other npcs, even if there is no player near around.
I had used till now the @NpcSeeNewTrigger to see if there is any enemy nearby, but this is a bit expensive if every npc has to trigger that script every 5 seconds.
What trigger or system would you use to attack npcs with one specified Tag:
For example, how to attack every npc who has TAG.Faction not equal the npc TAG.Faction,
and in a cheap way of course.
Thanks in advance.
|
|
09-24-2014 02:09 AM |
|
|
Skul
Master
Posts: 413
Likes Given: 0
Likes Received: 19 in 15 posts
Joined: Jun 2012
Reputation: 9
|
RE: Npcs attacking each other
best option i can provide is a timerf function that loops every minute or two, example:
Code:
[function f_faction_npcattack]
local.uid=<uid>
forchars <serv.distancetalk>
if (<npc>)
if (<tag0.faction>)
uid.<local.uid>.attack=<uid>
break
endif
endif
endfor
timerf 60, f_faction_npcattack
You can chance the interval of timerf to a higher amount to use less resources.
"I ask a question to the answer I already know."
Marchadium :: http://www.marchadium.ca/ :: Join us!
(This post was last modified: 09-24-2014 03:47 AM by Skul.)
|
|
09-24-2014 03:46 AM |
|
|
User(s) browsing this thread: 1 Guest(s)