Page 1 of 1

Terminator Lockon Crosshair Error

Posted: Sun Apr 27, 2014 3:18 pm
by TheMightyHeracross
Hello, I'm trying to make an effect in my GvH addon pack where a crosshair actor follows a ghoul player (except creeper) around, and the crosshair is only visible to the Terminator class. However, while the crosshair is capable of spawning (I've used summon to spawn it), it doesn't spawn in the script. Anyone know what's going on? Thanks.

Code: Select all

ACTOR T800Crosshair
{
        +CLIENTSIDEONLY
        VisibleToPlayerClass Terminator
        States
        {
                Spawn:
                TRMX A 1 Bright
                loop
        }
}

Code: Select all

script 133 ENTER
{
	if(PlayerTeam() == 0 || CheckInventory("CreeperWeapon") == 1)
	{
	terminate;
	}
	int x = GetActorX(0)+10;
	int y = GetActorY(0)+10;
	int Z = GetActorZ(0)+30;
	int p = PlayerNumber();
	int tid = 1000+p;
	SpawnForced("T800Crosshair", x, y, z, tid, 0);
    while (PlayerInGame(p))
    {
		x = GetActorX(0)+10;
		y = GetActorY(0)+10;
		Z = GetActorZ(0)+30;
        SetActorPosition(tid, x, y, z, 0);
        delay(1);
    }
	Thing_Remove(tid);
}
script 134 RESPAWN
{
	if(PlayerTeam() == 0 || CheckInventory("CreeperWeapon") == 1)
	{
	terminate;
	}
	int x = GetActorX(0)+10;
	int y = GetActorY(0)+10;
	int Z = GetActorZ(0)+30;
	int p = PlayerNumber();
	int tid = 1000+p;
	SpawnForced("T800Crosshair", x, y, z, tid, 0);
    while (PlayerInGame(p))
    {
		x = GetActorX(0)+10;
		y = GetActorY(0)+10;
		Z = GetActorZ(0)+30;
        SetActorPosition(tid, x, y, z, 0);
        delay(1);
    }
	Thing_Remove(tid);
}

RE: Terminator Lockon Crosshair Error

Posted: Sun Apr 27, 2014 3:52 pm
by Ivan
Check if the script actually runs. Check if sprite's properly given correct offsets. Check if the sprite spawns at correct coordinates.

RE: Terminator Lockon Crosshair Error

Posted: Sun Apr 27, 2014 4:24 pm
by TheMightyHeracross
Hmm, I added a PrintBold function to check, and it wasn't running. Could it have to do with the initial if statement? I know that Humans are team 0 and only Creepers have CreeperWeapon...

EDIT: Well, it was running in non-team modes, so the script runs, but not past the if statement.
EDIT2: If I remove the if statement, it still doesn't follow anyone.

RE: Terminator Lockon Crosshair Error

Posted: Sun Apr 27, 2014 4:32 pm
by Ivan
Ugh, tid of 1000+p is for players. I don't understand what you are really trying to do here. (Unless it's for old GvH)

RE: Terminator Lockon Crosshair Error

Posted: Sun Apr 27, 2014 4:39 pm
by TheMightyHeracross
EDIT: I've got a new method for the mod now, but if anyone were to find the problem with this, that would be awesome (this method is more balanced).