From Darkness he awakes, in times of great need... It's told he's a legendary lurker, or some crazy guy, in fact he's just a modder, a very irresponsible and procrastinating modder... Here it is... It's-a me, Anarch16sync. Hi guys, just passing by...
OK, let me make myself abundantly clear:
Someone needs to explain to me precisely what code I need to inject into my class to make a charge-bar work at all (including a comprehensive list of every single file that affects or is affected by the original vanilla charge mechanics), or charge-bars for this class WILL NOT HAPPEN.
...
I'm not exactly fresh on the specific file needed for a working charge bar, since I been away from modding almost a year now, so just bear with me if I sound a bit unspecific...
Let's start with the basic, what a charge-bar is:
A charge-bar is the visual representation on the UI of the players "charge", like you said charge is a secondary resourse, is like mana.
Now let's go with what Charge is, "Charge" is a stat, a number, that if I recall correcty can go from 0 to 100. Nothing more, noting less. You also have other stat that I think is named "ChargeS" that are used in the enginner bar, so when you have one or more "ChargeS" you consume one to increase the effect of a skill.
Now the effects of a charge-bar, in the vanilla classes, are triggetable effects aplied to the character on creation. Triggetables are conditional effects, something like: If charge=100, give 3000 per second to the player for 5 seconds (That I think is what the Embermage chargebar does).
Now, the vanilla charge is somewhat hardcoded if recall correctly to increase with normal attacks, and with skills that have the "produce charge" flag to true.
So there you have the basics working of a charge-bar, an UI piece that tracks the "charge" stat, and a triggetable effect attached to the class that uses the value of charge as a condition to do something, the embermage charge bar and the Outlander are the simplest ones to analise, one does something when is full, the other does something when is empty and give bonus based on the value of the charge stat.
Now what
this is talking about is of a method that instead of aplaying a triggetable effect to the character, gives him a passive skill that does the work, and what that let's you do is balance your charge-bar effects without the need of strange measures to fix old characters, because a triggetable effect aplied directly to a characters is applied on character creation, and if you change that effect the only characters affected by the change are new created characters. If you use the passive method you can buff, nerf, overhaul or whatever to your charge-bar passive effects and every character will get the changes. If I recall correctly a good passive to base your charge passive is the "share the wealth" skill of the outlander that basicly gives a bonus effect based on the charge value (it has a layout attached to give the effect to other party members so you have to remove that part, and make it only affect the player)
Now like the charge is just like any other stat, and the charge-bonus are like any other bonus, you can do a lot of stuff with the "mechanics" of a charge-bar, some cool concepts but with a bit of tricks to them are for example the chargebars for the Destroyer (two charge-bars that charge independantly with different conditions, and give different bonus) or the Alchemist Charge-bar (only increase charge with skill usage, gives bonus based on value but triggers a negative effect when full) both in the TL1CP.
Hope this helps, if you need clarification on any thing... I'll try to give it, but maybe the other torchmodders can take it from here, since I'm really rusty on specific files and code lines.