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?
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.
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.
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]
It's not too hard to do this with a script, though.
Code:
variable(insertnamehere)
set variable(insertnamehere,pick hero)
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:
variable(anothername)
set variable(anothername,get hero stat(insertnamehere,stat:HP,maximum stat))
set hero stat(insertnamehere,stat:HP,anothername,current stat)
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]



