01-10-2009, 12:46 AM
Xlithan Wrote:Currently, the GameAI sub is triggered using a timer on the server which is set to run every 4 seconds. As some of you know I am creating a text-based mud game. The problem here is that if there are 3 monsters in the same room, all 3 monsters will attack you at the same time every 4 seconds.
What I want to do is add a timer to the individual room NPC (Known as MapNPC() on normal MS engines), which works using GetTickCount. This means that when the NPC dies, the timer is reset for that room NPC until they respawn.
Hopefully, this will stop NPCs from attacking all at the same time, and also allow me to set different attack intervals for different monsters
I'm not familiar with how GetTickCount timers work, but I'm sure I can use it to my advantage if it was to be explained.
They shouldn't all be attacking at the same time >_>; Each MapNpc has it's own attack timer.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?