I was trying to mimic the 'walking' monster behavior with acs for any intended actor. I mean, it should 'pretend' the TAG actor was moving toward to the player who activated the script. I thought it'd be just check if actor's position coordinates were bigger or smaller the respective player's coordinates and just increase or decrease them according, repeatedly.
But it works... erradicly. Some actors does only move when player changes its Z coordinate, some actors moves outside the map, some does just move in one or two of the three coordinates, and some actors do not move at all. I have no clue of what I'm doing wrong. If someone could give some light here, it'd be appreciated.

The script follows:
Code: Select all
int QualX;
int QualY;
int QUalZ;
Script 6 (int Qual)
{
// Defines X:
If (GetActorX (Qual) < GetActorX (0))
{
QualX = (GetActorX (Qual) + 1.0);
}
Else If (GetActorX (Qual) < GetActorX (0))
{
QualX = (GetActorX (Qual) - 1.0);
}
// Defines Y:
If (GetActorY (Qual) < GetActorY (0))
{
QualY = (GetActorY (Qual) + 1.0);
}
Else If (GetActorY (Qual) > GetActorY (0))
{
QualY = (GetActorY (Qual) - 1.0);
}
// Defines Z:
If (GetActorZ (Qual) < GetActorZ (0))
{
QualZ = (GetActorZ (Qual) + 1.0);
}
Else If (GetActorZ (Qual) > GetActorZ (0))
{
QualZ = (GetActorZ (Qual) - 1.0);
}
//Sets new coords to QUAL actor:
SetActorPosition (Qual, QualX, QualY, QualZ, 0);
Delay (1);
Restart;
}
