What I am trying to do is to regenerate health based on the characters level. So, every minute, your health regenerates by 1 if you are level 1. Once you are level 2, you regenerate 2 health. How might I go about doing this when there is no conditional branch for it? Im guessing it would involve the script option in the conditional branch?
Okay 20 frames = 1 second.
1200 frames = 1 minute. The example below is for 30 seconds though.
The example also includes healing the entire party.
(http://img25.imageshack.us/img25/7562/regenz.png)
Tell me if this is what you wanted.
What I wanted was to have the amount of health regenerated be more for each level. An example would be:
Level 1 - 100 health generated per minute
Level 2 - 110 health generated per minute
Level 3 - 120 health generated per minute
In the Conditional Branch, there is no way to check for the heros level.
you can check with variables.......
Okay this does what you wanted.
(http://img532.imageshack.us/img532/7007/hpregen.png)
level 1: 100
level 2: 110
It does it for the entire party according to the actor's level.
Change 600 frames to 1200 frames. However you may need to use multiple wait commands for that.
Thank you.
Don't mind me, since I'm not much of a scripter (yet) myself, but it seems like you could stand to improve it by tying it to a simple counting loop instead of sequenced /wait commands, as well.
What I mean is, consider structuring your event like this:
@>Loop
@>Conditional Branch: Variable [XXXX: Time] == 60
@>Script: $game_party.actors.each {|i| i.hp += i.level}
@>Control Variables: [XXXX: Time] = 0
@>Wait: 20 frame(s)
Else
@>Wait: 20 frame(s)
@>Control Variables: [XXXX: Time] += 1
: Branch End
@>
: Repeat Above
@>
Doing this would serve two pretty useful purposes:
- You could very easily change the number for testing/balancing purposes if you decide that a minute is too short/not long enough.
- It sounds like you may be using this in tandem with other scripts you may want to control with a timer (such as if you're using it with an ABS.) Doing so lets you use one variable for multiple purposes.
It would work, but my way is shorter. Making it only 2 or three lines depending on how long you want the regeneration.
You know, one could make a "Time-based slip-damage" script, so that effects like poison act based on time rather than steps taken. Then add the regeneration effect to the gallery. *hint to G_G (would be awesome for Tons of Addons)*
Quote from: Hellfire's G_G on March 27, 2010, 07:38:43 am
It would work, but my way is shorter. Making it only 2 or three lines depending on how long you want the regeneration.
Simpler usually is better, true.
Quote from: Mad Scientist Fantasist on March 27, 2010, 07:46:10 am
You know, one could make a "Time-based slip-damage" script, so that effects like poison act based on time rather than steps taken. Then add the regeneration effect to the gallery. *hint to G_G (would be awesome for Tons of Addons)*
Maybe I will. :D
Only issue is how does the event proc when you reenter a map? If you're only on a map for 45 seconds, you'll miss out on the hp heal. Using the loop would at least make it so you hold on to the seconds you've waited for the heal.
? Just a thought ?
I could be wrong.
Being brand new to ruby, I'm trying to error-proof as many of my scripts/events as I can.
That's why I like using game variables for stuff like this... you can easily quantify them while testing through F9 and it's easy to control or modify them for reasons exactly like the one you bring up. lol
Quote from: (Hexamin) on March 27, 2010, 08:51:05 am
Only issue is how does the event proc when you reenter a map? If you're only on a map for 45 seconds, you'll miss out on the hp heal. Using the loop would at least make it so you hold on to the seconds you've waited for the heal.
? Just a thought ?
I could be wrong.
If its setup in a common event on a parallel process it'll still work.
Will common events continued to process through menus too? Provided they're set up on PP?
No common events wont work unless the menu is updating the interpreter.