Sample code:
Code: Select all
//GLDEFS
pointlight GreenLight {
color 0.25 1.0 0.25
size 128
}
//ZSCRIPT
version "4.10.0"
class GreenLight : inventory
{
Default
{
Radius 20;
Height 14;
ProjectilePassHeight -16;
}
States
{
Spawn:
Held:
CAND A -1 Bright Light("GreenLight");
CEYE ABCB 6 Bright Light("GreenLight");
Loop;
}
override void tick()
{
Super.tick();
//Keep item in owner eyesight
if (owner && owner.player)
{
vector3 newPos = owner.pos + (0,0,owner.player.viewheight);
if (pos != newPos) SetOrigin(newPos,true);
}
}
}
Also, comment the CAND line so that the CEYE animation plays. Now it works as expected. Seems this is only an issue for infinite state sprites.
workaround: resetting the state seems to fix it.
Code: Select all
override void travelled()
{
setstate(ResolveState("Spawn"));
}