Yes! It works perfectly now, although it's clearly not beginner level. Thank you very much

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menuint xx[5];
int yy[5];
int Timer = 0;
function room_Load()
{
cCat.Walk(250, 120, eNoBlock, eWalkableAreas);
xx[0] = 250; // Start
yy[0] = 120;
xx[1] = 80; // POI 1
yy[1] = 140;
xx[2] = 120; // POI 2
yy[2] = 100;
xx[3] = 190; // POI 3
yy[3] = 30;
xx[4] = 220; // POI 4
yy[4] = 150;
}
function room_RepExec() {
if (Timer) { // if the character is waiting...
Timer--; // decrease our timer
if (!Timer) cCat.Walk(xx[0], yy[0], eNoBlock, eWalkableAreas);
return;
}
if (cCat.Moving) return;
if ((cCat.x == xx[0]) && (cCat.y == yy[0])) { // Start
int chance = Random(99) + 1; // 1-100
if (chance <= 25) cCat.Walk(xx[1], yy[1], eNoBlock, eWalkableAreas); // 25% chance of walking to POI 1-2-3-4
if (chance >= 26 && chance <= 50) cCat.Walk(xx[2], yy[2], eNoBlock, eWalkableAreas);
if (chance >= 51 && chance <= 75) cCat.Walk(xx[3], yy[3], eNoBlock, eWalkableAreas);
if (chance >= 76 && chance <= 100) cCat.Walk(xx[4], yy[4], eNoBlock, eWalkableAreas);
}
else if ((cCat.x == xx[1]) && (cCat.y == yy[1])) { // POI 1
int chance = Random(99) + 1; // 1-100
if (chance <= 33) cCat.Walk(xx[2], yy[2], eNoBlock, eWalkableAreas); // 33% chance of walking to POI 2-3-4
if (chance >= 34 && chance <= 66) cCat.Walk(xx[3], yy[3], eNoBlock, eWalkableAreas);
if (chance >= 67 && chance <= 100) cCat.Walk(xx[4], yy[4], eNoBlock, eWalkableAreas);
}
else if ((cCat.x == xx[2]) && (cCat.y == yy[2])) { // POI 2
int chance = Random(99) + 1; // 1-100
if (chance <= 33) cCat.Walk(xx[1], yy[1], eNoBlock, eWalkableAreas); // 33% chance of walking to POI 1-3-4
if (chance >= 34 && chance <= 66) cCat.Walk(xx[3], yy[3], eNoBlock, eWalkableAreas);
if (chance >= 67 && chance <= 100) cCat.Walk(xx[4], yy[4], eNoBlock, eWalkableAreas);
}
else if ((cCat.x == xx[3]) && (cCat.y == yy[3])) { // POI 3
int chance = Random(99) + 1; // 1-100
if (chance <= 33) cCat.Walk(xx[1], yy[1], eNoBlock, eWalkableAreas); // 33% chance of walking to POI 1-2-4
if (chance >= 34 && chance <= 66) cCat.Walk(xx[2], yy[2], eNoBlock, eWalkableAreas);
if (chance >= 67 && chance <= 100) cCat.Walk(xx[4], yy[4], eNoBlock, eWalkableAreas);
}
else if ((cCat.x == xx[4]) && (cCat.y == yy[4])) { // POI 4
int chance = Random(99) + 1; // 1-100
if (chance <= 33) cCat.Walk(xx[1], yy[1], eNoBlock, eWalkableAreas); // 33% chance of walking to POI 1-2-3
if (chance >= 34 && chance <= 66) cCat.Walk(xx[2], yy[2], eNoBlock, eWalkableAreas);
if (chance >= 67 && chance <= 100) cCat.Walk(xx[3], yy[3], eNoBlock, eWalkableAreas);
}
}
By continuing to use this site you agree to the use of cookies. Please visit this page to see exactly how we use these.
Page created in 0.045 seconds with 13 queries.