[XP] [Blizz-ABS] HP and MP Regeneration + More

Started by AJNR95, February 09, 2012, 08:25:35 pm

Previous topic - Next topic

AJNR95

February 09, 2012, 08:25:35 pm Last Edit: March 25, 2012, 08:22:28 pm by AJNR95
Health and Mana Regeneration
+More
Version: 2.0
Type: Combat Features



Introduction

Health Regeneration for Blizzard's Active Battle System or any Live Action Battle system.
THIS ONLY WORKS logically FOR SINGLE ACTOR GAMES


Version 1.1 Stamina/Mana Regeneration added.
Version 1.1 World Time and World Weather added.
Version 1.1 "Ring of Luck" mentioned
Version 1.1 Live Action Potion Heal mentioned
Update! KK20's Energy Consumption on Sprint
Update! Energy Bar (Similar to MGS' Psyche Bar)
Update! Recharge Skills (Blizz-ABS Action Recharge Time by Winkio)
Features

HP Regeneration

  • Regenerates Health after a set time of not taking damage
  • Disables after taking damage
  • Disables after fully recovering, allowing a preemptive stop
  • Version 2! Recover 0.5% of Health instead of a set value
  • (Optional) Regeneration Rate increases when recovering for a prolonged time


SMP Regeneration Not available in Version 2!

  • Regenerates Mana/Stamina after a set time of not using spells/abilities
  • Disables Regeneration when Mana/Stamina is used (Not updated for Mana Drain Skills)

.
"Energy" Bar Version 2!

  • Recharges when you don't take damage, Drains when you have taken damage (Combat Enabled)
  • Influences the Player's Statistics based on it's value (Energetic, Normal, Tired, Stressed)
  • Changes how skills are used entirely
    .
    World Time Discontinued!


    Live Action Potion Heal

    • Potions now heal rapidly over time until they hit their set time instead of heal instantly


    "Ring of Luck" Not available in Version 2!

    • Completely Random Chance to Heal for a Random amount of Health (Not created to be ON with a set armor equipped)

    .
    Skill Recharge Version 2!
Spoiler: ShowHide


by Blizz: Spoilered, because image is 2.6 MB.
by AJNR95: Unspoilered, because fuck you - ¡Viva la Revolución!
by Blizz: Spoilered again, and Banned.

Taiine


ForeverZer0

* Moves to Event Database *

Nice job. :)
On a side note, just to make you aware, the dark blue text is kinda hard to read for people using any of the dark themes of the forum.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

AJNR95

Quote from: Taiine on February 09, 2012, 09:19:44 pm
@.x DEMO PLZ. kthx. :3


Demo? Oh. Oh oh oh oh. Yeah here. Fixed. Bye. :D

Quote from: ForeverZer0 on February 09, 2012, 10:21:52 pm
* Moves to Event Database *

Nice job. :)
On a side note, just to make you aware, the dark blue text is kinda hard to read for people using any of the dark themes of the forum.


Thanks, but I'm unable to fix the color now. I put up the Demo now so it's all in one wrap and people are able to sift through the stuff in there.

Demo also comes with a "Ring of Luck" Event System, and Custom Live Action Health Potion Event System.
Spoiler: ShowHide


by Blizz: Spoilered, because image is 2.6 MB.
by AJNR95: Unspoilered, because fuck you - ¡Viva la Revolución!
by Blizz: Spoilered again, and Banned.

ForeverZer0

Off-Topic: ShowHide
The color is not a big deal, and its not necessary to change it, but you can by using the modify button in the top-right corner of your post.
  :)

I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

ShadowPierce

Good job... I'll be switching to this one, my regen system was way more inferior... I had to make my enemies use skills instead of attacks to make an In-Battle state... :P

Anyway, nice job! :D

Spoiler: ShowHide
Quote from: Blizzard on February 16, 2011, 03:44:48 pmThere you go. It's the proof that SDK is crap. It's incompatible with itself.
3DS Friend Code: ShowHide
1161-0627-9890

AJNR95

Thank you, ShadowPierce :)

Main Topic is updated and summarized
Spoiler: ShowHide


by Blizz: Spoilered, because image is 2.6 MB.
by AJNR95: Unspoilered, because fuck you - ¡Viva la Revolución!
by Blizz: Spoilered again, and Banned.

Taiine

Can you add one that makes SP act like an energy bar? I've tried such in my gage but it bugs out to easily. Pretty much when you run (with babs) it should stedily drain sp, and then slowly regen when your not.

AJNR95

Quote from: Taiine on February 11, 2012, 11:23:44 pm
Can you add one that makes SP act like an energy bar? I've tried such in my gage but it bugs out to easily. Pretty much when you run (with babs) it should stedily drain sp, and then slowly regen when your not.


I could do that, but it varies on the situation.

1. Is the Sprint button your using, using the Game's "Gamepad"? Are you using A, B, C, X, Y, Z, L or R?
If not, there should be a Script Evaluator command that checks if the Sprint System/Sprint Button is used
It is much easier to just disable the Sprint itself once you reach 0 SP, but that probably isn't your priority right now, I'll message Blizzard about it

2. Is your BABS Sprint Speed a whole number? or Decimal? The event will make it a whole number.

Or I can use an alternate way of a Sprinting Event System, but it might need the BABS Sprint to be removed,
basically not entering a Keyword for Run. (RUN = "Key[]"). I can make a Sprinting System, but I'll also message Blizzard.
Spoiler: ShowHide


by Blizz: Spoilered, because image is 2.6 MB.
by AJNR95: Unspoilered, because fuck you - ¡Viva la Revolución!
by Blizz: Spoilered again, and Banned.

Taiine

O.o

Woe uh... I just mean like... default stuff. like 'if your are sprinting, drain x mana' 'if not, regen x mana'
what I have semi works, but if you drain the mana to 0, it refuses to regen at all unless you use a potion or something to regen it back abive 1. even stopping the drain at 1 the issue repeats, now it needs to be above 1 to regen. whatever value is set to 'mana at X, disable sprint' is the value that at that point wont allow it to regen.

AJNR95

I'm sorry. To summarize all the garbage I said, "Are you using Blizzard ABS or not?"

If not, then this can be creating easily.

If yes, there are going to be conflicts between the Events and Script.
Spoiler: ShowHide


by Blizz: Spoilered, because image is 2.6 MB.
by AJNR95: Unspoilered, because fuck you - ¡Viva la Revolución!
by Blizz: Spoilered again, and Banned.

Taiine

Well, I already said I was using BABS. and that I do have a system that sort of works.. though it brakes...

a.k.a
if MP is over X > Enable sprinting key
if sprint key held, subtract Y MP a sec
If sprint key not held, add Y MP a sec
if MP is at X, disable sprint key


that's pretty much what I use... but I can't smack the bug that once you get to X MP to disable sprint... the MP stops regening, but if you stop sprinting before it gets to there, it'll regen just fine. Can change what value it disables it at and each time if you drop to that value, you can' regen at all.

I thought your mana points system could be edited to just also drain MP when you're running and regen it when not... not not bug out like mine does >.>

KK20

February 15, 2012, 05:29:08 pm #12 Last Edit: February 17, 2012, 07:24:12 pm by KK20
A copy-paste solution from another post.

1.) Open Part 2 of BlizzABS. Locate 'def update_control' (Line 3592). A few lines below, find 'player.move_speed = player.normal_speed' (Line 3596) and replace it with
player.move_speed = player.normal_speed unless $game_switches[id]
Replace 'id' with whatever switch you want to be on in order to run your parallel process event.
Go down a bit and find 'player.move_speed = Config::RUN_SPEED' (Line 3605) and replace it with
player.move_speed = Config::RUN_SPEED unless $game_switches[id]
Again, replacing 'id' with the switch you want.

2.) Do something like this:
Spoiler: ShowHide


Drains MP as long as the run key is held down. If MP is zero, the character will walk at normal speed even if the run key is held down. If the run key is not being pressed, regen MP. The above example was just bare-bones testing.

EDIT: Forgot a couple of lines in the picture. Fix'd.
EDIT 2: Changed the eventing a bit to allow all actors to use this feature, not just the first actor.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

AJNR95

Thank you KK20. Sorry I've been inactive. I've been busy with school and my laptop has been a diligent friend by freezing every 20 minutes.
I don't think I would've found a detoured solution via Events. I will try to use this too. Thanks again KK20  :)
Spoiler: ShowHide


by Blizz: Spoilered, because image is 2.6 MB.
by AJNR95: Unspoilered, because fuck you - ¡Viva la Revolución!
by Blizz: Spoilered again, and Banned.

Taiine

That is actually the event system I tried using and is the one that gave me this bug. It works fine unless you let it fully drain, only then will the sp be 'locked' at that value unless you use a potion or something to up it.

ah well... guess sp will remain dull boring sp rather than 'energy' and players can run indef where ever they want! ;D

KK20

Quote from: Taiine on February 16, 2012, 08:40:45 pm
That is actually the event system I tried using and is the one that gave me this bug. It works fine unless you let it fully drain, only then will the sp be 'locked' at that value unless you use a potion or something to up it.

ah well... guess sp will remain dull boring sp rather than 'energy' and players can run indef where ever they want! ;D

Did you at least give mine a try? Because from what I can tell, you said yours checked if the MP > 0 first. Mine checks if the run key is being held down first.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

AJNR95

The system has a bug.

NoMethodError occurred while running script.

undefined method '[]' for nil:NilClass

I don't know what I did wrong.
Spoiler: ShowHide


by Blizz: Spoilered, because image is 2.6 MB.
by AJNR95: Unspoilered, because fuck you - ¡Viva la Revolución!
by Blizz: Spoilered again, and Banned.

Taiine

Quote from: KK20 on February 16, 2012, 09:33:55 pm
Quote from: Taiine on February 16, 2012, 08:40:45 pm
That is actually the event system I tried using and is the one that gave me this bug. It works fine unless you let it fully drain, only then will the sp be 'locked' at that value unless you use a potion or something to up it.

ah well... guess sp will remain dull boring sp rather than 'energy' and players can run indef where ever they want! ;D

Did you at least give mine a try? Because from what I can tell, you said yours checked if the MP > 0 first. Mine checks if the run key is being held down first.


@.x I said in the last post that IS the event system I tried. :P

KK20

Quote from: KK20 on February 16, 2012, 09:33:55 pm
Did you at least give mine a try? Because from what I can tell, you said yours checked if the MP > 0 first. Mine checks if the run key is being held down first.


Quote
if MP is over X > Enable sprinting key
if sprint key held, subtract Y MP a sec
If sprint key not held, add Y MP a sec
if MP is at X, disable sprint key

Note that you check first if your MP is greater than X. If it is, enable the run key. Also note that your regen only works IF your MP is greater than X as well. Thus, you are saying:
if actor.mp > X
  if Input.press?(Input::Run)
    actor.mp -= amount
  else
    actor.mp += amount
  end
else
  # Prevent player from running
end
Obviously, your bug makes sense because it's faulty logic order. Your event is NOT the same as mine.

I've tested MY version different ways, using spells while running, and it all works clean. I suggest you to do EXACTLY what I say. Also note that I did not download AJNR95's demo to borrow any of his ideas.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

AJNR95

Quote from: KK20 on February 17, 2012, 06:18:12 pm
I've tested MY version different ways, using spells while running, and it all works clean. I suggest you to do EXACTLY what I say. Also note that I did not download AJNR95's demo to borrow any of his ideas.


:???: I had transcribed your Script Running system thing to another small game of mine. But when I start it up, it comes up with that error. I followed your steps. For the Demo, it shouldn't contain any "Running" Events.
Spoiler: ShowHide


by Blizz: Spoilered, because image is 2.6 MB.
by AJNR95: Unspoilered, because fuck you - ¡Viva la Revolución!
by Blizz: Spoilered again, and Banned.

KK20

What error? The "do not regen" error? I could even post a video of my method. It all works for me.

What do you mean by "it shouldn't contrain any running events"?

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

AJNR95

Quote from: KK20 on February 17, 2012, 06:46:55 pm
What do you mean by "it shouldn't contrain any running events"?


I said that the link of neither Demo within the topic post does not contain anything related to the Running system we are discussing.

Quote from: KK20 on February 17, 2012, 06:46:55 pm
What error? The "do not regen" error? I could even post a video of my method. It all works for me.


It's most likely my setup of the project. I've replaced my Blizz Part 2 with a default if I made any changes to any other lines.
There is no regen error.

Quote from: AJNR95 on February 17, 2012, 07:40:17 am
NoMethodError occurred while running script.
undefined method '[]' for nil:NilClass


I've tried to copy the event you posted in the link. When I shut it off, the game runs. But when I enable it, it pops up after "New Game" or "Continue" is selected on the Main Menu.
Spoiler: ShowHide


by Blizz: Spoilered, because image is 2.6 MB.
by AJNR95: Unspoilered, because fuck you - ¡Viva la Revolución!
by Blizz: Spoilered again, and Banned.

KK20

February 17, 2012, 07:10:36 pm #22 Last Edit: February 17, 2012, 07:25:06 pm by KK20
You went and editted your Blizz ABS Part 2 to exactly the way I wrote it, yes? And did you make sure you wrote $game_variables not $game_variable? I do that from time to time.

Also, changed the eventing a bit:
Spoiler: ShowHide

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Taiine

February 17, 2012, 09:02:35 pm #23 Last Edit: February 17, 2012, 09:09:02 pm by Taiine
Yes that is the event system I used, what I spoke of there is not 'the exact event set up' but just the idea for it laid out better. I could have started it 'if not sprinting regen' for all sakes, it was just to give the idea of what I was getting at, NOT 'this is the exact set up I did for the event'.

So to put it BETTER
Check player SP
Is run key being pressed?
If yes drain SP, speed player up
If no regen SP, player walks
If SP is at zero, stop player from running, regen sp


But whatever. as said I gave up on this idea as I could not find any fix or work around for why SP would just flat out stop regening once it reached whatever value you set to 'stop player running'. I hoped one of these regens could maybe be edited for it.

Just accept that players may likly just always run to get to places faster :P

KK20

But I have the fix. Why can't you just try it? Here, I even have a download link: http://dl.dropbox.com/u/58874459/BLIZZ%20ABS.rar

...I am persistent when it comes to proving a point.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Taiine

February 17, 2012, 10:18:59 pm #25 Last Edit: February 17, 2012, 10:35:27 pm by Taiine
Issues with yours:
Can remove the speed controls for player, BABS already handles that

SP will drain even if player is standing still, there is no check to make sure the player is MOVING while the run key is pressed.
Player can still run when SP reaches zero.
SP does regen even after it hits zero, but it don't matter as there isn't any check to disable run when it hits zero.
SO regens very fast, even if running was disabled, you could tap the key or hold it down to a jiddery but still faster speed.

Heres what I have pretty much.

Spoiler: ShowHide


Yellow part is the issue. It's what tells it if SP is at or below whatever value, disable run, so you can not run at all, else, turn running back on.

The rest of it checks if the direction key and if you are running are on. is so drain sp, if not slowly regen. This way SP wont just drain even if you're standing still have have the run key held.

the issue is with the disable check, the part marked in yellow. WITH IT if you run and stop WITH OUT fully draining sp, it will regen just fine. IF you drain it fully, to what ever value you have it set, SP will not regen at all.

Yet with out it, so can drain to zero, and fully regen, but the play can run all the time, because there is nothing to tell them not to.

I made a topic about this way back in 10. x.x

edit: yep heres the OLLDDDDD topic. http://forum.chaos-project.com/index.php/topic,7766.0.html
I gave up on it, as nothing was really helping and people were not grasping what my issue was and trying to offer fix's for things I wasn't having issues with.

if you wish to resume, do it there I guess, so we arn't taking over this fellas topic :P  didn't mean to.

AJNR95

Sorry for the extreme gap of time. But about 2 weeks ago, KK20's run script runs perfectly.

After this post, I'm uploading a compressed un-encrypted file of the progress in my little game.
New features: "Energy" Bar (similar to Metal Gear Solid's Psyche), Recharge View-able Skills, and
losing Energy when running.

Notable features: The "Energy" Bar replaces the SP of the game. It recharges when out of battle
or not taking any damage, it decreases when you are in battle or take damage, much like your
HP but recharges much faster. The Strength, Dexterity, Agility and Intelligence are NOT displayed
in the game, Health and Energy values are NOT displayed in the game.

Notes on File: All 3 Compressed Folders are large only because of the mp3s within it, I'm sorry
for that inconvenience. New features will be elaborated on the topic post.
Spoiler: ShowHide


by Blizz: Spoilered, because image is 2.6 MB.
by AJNR95: Unspoilered, because fuck you - ¡Viva la Revolución!
by Blizz: Spoilered again, and Banned.

edmondedi

All links are broken :(
Can somebody send me the script or the demo? :/

KK20

Don't think anyone here has a copy. Is there some feature from this that you wanted?

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!