Page 1 of 1
My guards do not
Posted: Sun Feb 05, 2006 2:57 pm
by redmedal
my guards do not defend ?
what i do
]
Posted: Sun Feb 05, 2006 8:49 pm
by Yukiko
Always need to include the version of POL you are running and if you are running POL Distro or not.
In the POL 95 Distro script named "townguard.src" located in \pol\scripts\ai this segment from the function "lookiehere" is what determines how the guard reacts in the presence of criminals.
Code: Select all
function lookiehere()
foreach npc in ListMobilesNearLocation(me.x, me.y, me.z, 15)
foreach listing in keys
var range := SplitWords(cfgfile[listing].range);
if((npc.x >= CInt(range[1])) && (npc.x <= CInt(range[3])) && (npc.y >= CInt(range[2])) && (npc.y <= CInt(range[4])))
var timer := Cint(GetObjProperty(npc, "guardstimer"));
if((npc.criminal) and (!npc.dead))
if(timer < ReadGameClock())
SetObjProperty(npc, "#guardstimer", ReadGameClock() + 15);
Fight(npc);
endif
The "if ((npc.criminal..." is where that check is done. If one of the mobiles nearby is a criminal then the Fight function is called.
Your scripts should have something similar else your guards will just stand there.
Posted: Mon Feb 06, 2006 12:02 pm
by redmedal
it is doesnt work. call this is not a guarded area (i am at britain)
Posted: Tue Mar 07, 2006 4:36 am
by Fistandantilus
in pol/regions there is a cfg file that determines areas subject to guard protection. look what you screwed, there or in any other part referring to that file.