YesNoOk
avatar

Setting Up Starting Meter with Natural Power Gain (Read 3261 times)

Started by The Alternate, January 29, 2017, 06:59:47 pm
Share this topic:
Setting Up Starting Meter with Natural Power Gain
#1  January 29, 2017, 06:59:47 pm
    • alternatecreed@gmail.com
I'm trying to figure out how to set a character's starting meter, but I feel that I'm missing (or misunderstanding) the code to do so.  I'm going to be specific as possible with this, so don't mind the wordiness too much.

I've been searching the net for info, but all I'm getting is mostly how to get infinite meter.  What I need is for a character to start off with a specific amount of meter and then gain the meter naturally for the rest of the match.  What I do know is that it's a State -2 code with either poweradd or powerset.  However, every time I try a code, it either gives me infinite meter (as stated prior), a set permanent starting meter amount with zero power gain (EX: always having 1000 out of X000 power throughout a match no matter the action), or gives me the starting meter with natural power gain as desired only to have it revert to the inital starting meter on the next round rather than carrying over the amount of meter that they ended a round with.

I know the code should be written in a format similar as this from my net searches:
[state -2, poweradd]
type = poweradd
trigger1 = 1
value = 1000

The question is a matter of "filling in the blanks" of the other pieces of coding and/or where this code needs to be placed so that I can get my desired result since I'm not too programming savvy on the matter.  Any clues, hints or complete answers would be appreciated.
Re: Setting Up Starting Meter with Natural Power Gain
#2  January 29, 2017, 10:20:30 pm
  • ****
  • Still lurks regularly, but posts once a blue moon
    • Canada
Quote
[state -2, poweradd]
type = poweradd
trigger1 = 1
value = 1000
I know you're just using this as an example, just gonna explain a few problems with this piece code in the case of the result you're desiring.
Since it's part of state -2, it's trigger is checked at every frame.
Since it's using trigger = 1, the user is essentially saying power should be added by 1000 on every frame.
This of course means that you'll reach 3000 power in 3/60th of a second, which is the max power for most characters.

To achieve the effects of passive power gain and the initial power start, you will need BOTH sctrls: PowerSet and PowerAdd

For Passive Power gain, you'll need to use PowerAdd for this.  Make sure to place this in the -2 states.
Use a small number for it's value (eg: power = 1).  Fine tune this value until you're satisfied with the amount of power you're gaining per frame.
You can use trigger# = 1 if you want this to be active at all times.  If you want to further decrease the rate of power gain, you can use triggers such as trigger# = Time%2 == 0.  This will make your sctrl activate every 2 frames, instead of every frame.  You can modify the "2" to a greater value if you want to slow it down even more.

Use PowerSet to set your character's starting meter.
You have different options as to where you could place this sctrl. (-2 states, intro states (190s), initialization states (5900).)
I'll just explain how to use PowerSet for the -2 states.
Remember that sctrls in the -2 state are checked on every frame, thus we'd end up having the character's power stuck at whatever you set it as.
Thus, we want to make sure the PowerSet only occurs at the start of a round.  That's where setting the proper triggers come in.
You can use the RoundState trigger so that it only occurs before the round begins.  (See link for documentation and a good example.)
Next, we want to make sure this only activates on the first round by using the trigger RoundNo.
Spoiler, click to toggle visibilty

Note that since we want both triggers for the PowerSet, they will need to be under the same condition number:
trigger1 = YourTriggerHere
trigger1 = YourOtherTriggerHere.
Spoiler, click to toggle visibilty

Dang, that's a lot longer than I expected.  Hope this was clear and understandable.
I can try to answer any further questions you may have or clear up any misunderstandings in my explanation.
Re: Setting Up Starting Meter with Natural Power Gain
#3  January 30, 2017, 12:38:19 am
    • alternatecreed@gmail.com
Much appreciated.  I know I gave a very rudimentary example there, but as long as I was clear enough to understand what I was explaining, it's fine.  At any rate, I'll be looking over this so I can learn how to do set things up properly.  So again, thanks for the explaination.