I'm interested in creating my own TD/GFW style boss lifebar. Where do I start and what do I do? I've peeked inside the default lifebar but I don't understand any of it. And I want to make a custom one because I don't want my scripts to look too ZUN-like.
You can
take and use/modify mine if you'd like (located in /ds_system/S_System.h and inside the BossLife task, but if you want to make yours from scratch, making a circular lifebar is taking the flat lifebar information, tossing the actual flatbar graphic, and then making a primitive object which draws the points angularly.
I'm sure there may be multiple (and better ways) of doing this, but the way I did it was creating two separate primitive objects, one with the lifebar outline and of the actual life itself. They were made with ascents that added the vertices in a circular ribbon-like fashion (an example of this would be the default magic circle). After this, I multiplied the remaining lifebar (which is returned from danmakufu in a 1-0 value) by 360, and then with each primitive point on the lifebar, I did a
min(point's original location in a 0-360 value, the remaining life multiplied by 360); which gives the lifebar effect. The amount of vertices you use depends up to you, as more vertices gives more health precision and a smoother circle, but also has more lag. Another thing to consider would be removing vertices instead of doing a min() check.
After that, the stars, which represent the amount of steps remaining in the plural, are next, and are probably the easiest. Use a sprite list to display the amount of steps left (INFO_REMAIN_STEP_COUNT), and if you use the same variables from the previous flat lifebar, it should take care of the lifebar regain effect which is done after completing a step. The nubs that represent each attack within a step is also similarly easy. Danmakufu returns an array with all the attacks inside a step (INFO_ACTIVE_STEP_LIFE_RATE_LIST) in a very convenient 1-0 percentage value; by using this array you can do an ascent loop and create each nub on an angle within the lifebar by multiplying the proportion of each step with 360. (Also this information is not necessarily required to be presented the way I described, as this would make it ZUN-like, but this information is needed to display to the player so they won't be left confused)
Also, all of these values are obtained from
ObjEnemyBossScene_GetInfo, and I suggest getting used to the default life bar and how it works or it's going to be quite difficult trying to do the circular one. Plus, knowing how the regular life bar works would make things a lot easier for you when doing the circular one.