aL BeasTie
Well-known member
I really like that unmasked design
It works good for the most part, however, after a while it plays the "shooting animation" but it doesn't spawn the "laser"entity. I was wondering if there's a limit when it comes to number on entities an enemy can spawn.
// Define constants.
#define ANI_RESET_TRUE 1 // Reset if already playing animation.
#define VALID_TRUE 1 // Animation valid.
#define VALID_FALSE 0 // Animation not valid.
#define ANI_GET openborconstant("ANI_GET") // Get animation ID.
void main()
{
void target = getlocalvar("damagetaker"); // Item collector.
int valid = VALID_FALSE; // Animation is valid?
// Get animation valid flag.
valid = getentityproperty(target, "animvalid", ANI_GET);
// If the animation is valid, play it. Otherwise do nothing. This prevents
// the engine from logging an error and shutting down if the animation doesn't exist.
if (valid == VALID_TRUE)
{
// Set animation with perform attack command.
performattack(target, ANI_GET, ANI_RESET_TRUE);
}
}