Knuckle Cracker

Knuckle Cracker => Support => Topic started by: planetfall on December 21, 2016, 10:34:27 PM

Title: [PRPL] CreateUnit Emergent
Post by: planetfall on December 21, 2016, 10:34:27 PM

"Emergent" CurrentCoords CreateUnit ->u


This creates a small white emergent. Trying to set its IsEnemy status doesn't initialize its movement like it does for a stunner. It loses health each frame and eventually explodes.

Of note, the emergent has a triangle trail graphic attached to it, while the normal emergent has a square trail. This may be of some use diagnosing the issue.
Title: Re: [PRPL] CreateUnit Emergent
Post by: knucracker on January 02, 2017, 02:14:37 PM
Yeah, looks like creating an emergent requires some more setup.  I've made it so that CreateUnit won't create an emergent anymore (it will return -1 and log a warning).  I've added a CreateEmergent(X, Y, Enemy) api instead.  It will do all of the necessary internal setup.  X and Y are pixel coordinates and Enemy is true or false.

The created emergent obeys the map emergent settings, but does not obey the limits.  So you can exceed the max count with the api.