okay, something simple; of course i can't handle it.
i have an area, and i want to pick a random waypoint in that area. and, silly me, instead of having to manually count the waypoints i used, i want the script to do it for me! wow, like to be scalable :X
so i have five waypoints all tagged "wp_nugchase" i have a global variable named MaxRand.
i'm trying to count the waypoints on a creature spawn event. somehow, it keeps ending up just zero.
FIRST, i tried a for loop. keep in mind i have NO IDEA if i'm formatting this right, this is how lsl does it:
object test;
for(MaxRand = 0; MaxRand<22; MaxRand++)
{
test = GetObjectByTag("wp_nugchase", MaxRand);
if(test == OBJECT_INVALID) break;
}
SECOND, i tried the very scary do-while. i really don't use these, so not sure THIS is formatted properly, either
object test; MaxRand = 0;
do
{
test = GetObjectByTag("wp_nugchase", MaxRand);
MaxRand++;
}
while(test != OBJECT_INVALID);
anyway, according to the nugs, the number of WPs counted is still 0 :/
what am i doing wrong? :/
doofus check: global variable delcarations go like right under the include lines, and before the custom functions, right? :X
Modifié par BloodsongVengeance, 28 septembre 2010 - 04:42 .





Retour en haut







