Item that recovers HP and MP outside of battle

Make games! Discuss those games here.

Moderators: Bob the Hamster, marionline, SDHawk

Post Reply
User avatar
Willy Elektrix
Liquid Metal Slime
Posts: 910
Joined: Sun Aug 15, 2010 11:30 pm

Item that recovers HP and MP outside of battle

Post by Willy Elektrix »

I want to have a recovery that is usable out of battle and recovers both HP and MP to maximum. Inside of battle, this is easy. I made an HP recovery attack and chain it to an MP recovery attack. How would I script this to work when used from the player's inventory?
User avatar
Voltire
Slime Knight
Posts: 285
Joined: Thu Nov 25, 2010 3:48 am
Location: Santa Barbara, CA

Post by Voltire »

I think you could link it to a text box and set restore hp and mp to always on?
User avatar
FnrrfYgmSchnish
Metal Slime
Posts: 721
Joined: Thu Jun 18, 2009 4:37 am
Location: Middle of Nowhere, VA

Post by FnrrfYgmSchnish »

Yeah, but going to a textbox for the HP/MP-restoring part also brings up a textbox, which doesn't normally happen when you use a regular healing item and might look a little weird. I guess it could work if it was a small box with "HP/MP restored!" or something along those lines, but... oh well.

It's not too hard to do this with a script, though.

Code: Select all

	variable(insertnamehere)
	set variable(insertnamehere,pick hero)
This part brings up a hero-picking box, and uses a variable to keep track of who you picked. You'll probably want to change the global text string for pick-hero boxes before using this; I can't remember off the top of my head what the default is, but I know I've always changed it whenever I used "pick hero."

You'll probably want to use a different name for the variable (most likely something shorter, heh); I just used "insertnamehere" as a placeholder.

Code: Select all

	variable(anothername)
	set variable(anothername,get hero stat(insertnamehere,stat:HP,maximum stat))
	set hero stat(insertnamehere,stat:HP,anothername,current stat)
This part makes the game know what the character's max HP is by recording it in a variable, then sets their current HP to be equal to their max HP. To restore MP too, just copy the "set variable" and "set hero stat" lines and paste them in after the HP-restoring part... then just change every part that says "stat:HP" to "stat:MP" (or whatever MP is called in your game, if it's something else besides MP. Same goes for HP.)

And if you want to have the item play a sound effect or flash the screen or some other effect like that when used, just put that in after the HP/MP-restoring part.
FYS:AHS -- Swapping out some step-on NPCs for zones + each step script
Puckamon -- Not until the reserve party is expanded.[/size]
User avatar
Bob the Hamster
Liquid Metal King Slime
Posts: 7460
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

Eventually I would like to have an option to enable (limited) chaining support outside of battle. Obviously chains that include enemy target would break outside of battle, but there is no good reason why an entirely ally-targeted chain couldn't work outside of battle.
User avatar
Nathan Karr
Liquid Metal Slime
Posts: 1215
Joined: Fri Jan 25, 2008 3:51 am
Contact:

Post by Nathan Karr »

An infinitely recurring ally-targeted chain used out of battle could be terrific or terrifying.
Remeber: God made you special and he loves you very much. Bye!
User avatar
Bob the Hamster
Liquid Metal King Slime
Posts: 7460
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

Nathan Karr wrote:An infinitely recurring ally-targeted chain used out of battle could be terrific or terrifying.
Even inside of battle that could wreck havoc if it had no delay.
Post Reply