Terminator Lockon Crosshair Error

Discuss all aspects related to modding Zandronum here.
Post Reply
User avatar
TheMightyHeracross
Forum Regular
Posts: 176
Joined: Mon Aug 26, 2013 3:50 pm
Location: Philadelphia, PA

Terminator Lockon Crosshair Error

#1

Post by TheMightyHeracross » Sun Apr 27, 2014 3:18 pm

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);
}
THE MIGHTY HERACROSS

User avatar
Ivan
Addicted to Zandronum
Posts: 2229
Joined: Mon Jun 04, 2012 5:38 pm
Location: Omnipresent

RE: Terminator Lockon Crosshair Error

#2

Post by Ivan » Sun Apr 27, 2014 3:52 pm

Check if the script actually runs. Check if sprite's properly given correct offsets. Check if the sprite spawns at correct coordinates.
=== RAGNAROK DM ON ... uh... dead forever? ===
=== ALWAYS BET ON ... uh... dead forever? ===
=== Who wanta sum wang? ===
=== Death and Decay - A new Monster/Weapon replacer ===

User avatar
TheMightyHeracross
Forum Regular
Posts: 176
Joined: Mon Aug 26, 2013 3:50 pm
Location: Philadelphia, PA

RE: Terminator Lockon Crosshair Error

#3

Post by TheMightyHeracross » Sun Apr 27, 2014 4:24 pm

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.
Last edited by TheMightyHeracross on Sun Apr 27, 2014 4:26 pm, edited 1 time in total.
THE MIGHTY HERACROSS

User avatar
Ivan
Addicted to Zandronum
Posts: 2229
Joined: Mon Jun 04, 2012 5:38 pm
Location: Omnipresent

RE: Terminator Lockon Crosshair Error

#4

Post by Ivan » Sun Apr 27, 2014 4:32 pm

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)
Last edited by Ivan on Sun Apr 27, 2014 4:32 pm, edited 1 time in total.
=== RAGNAROK DM ON ... uh... dead forever? ===
=== ALWAYS BET ON ... uh... dead forever? ===
=== Who wanta sum wang? ===
=== Death and Decay - A new Monster/Weapon replacer ===

User avatar
TheMightyHeracross
Forum Regular
Posts: 176
Joined: Mon Aug 26, 2013 3:50 pm
Location: Philadelphia, PA

RE: Terminator Lockon Crosshair Error

#5

Post by TheMightyHeracross » Sun Apr 27, 2014 4:39 pm

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).
Last edited by TheMightyHeracross on Mon Apr 28, 2014 2:00 am, edited 1 time in total.
THE MIGHTY HERACROSS

Post Reply