Permanent Stat-Boosters
First, some background. Realise that each stat has a current value, and a maximum value. Now to explain how the engine handles the HP and MP stats differently to the others.
During battles, all attacks modify the current value of all stats. There's no way to modify maximums.
After each battle, changes to the current values of all stats other than HP and MP are discarded. You can't make changes to any other stats which persist after the end of battle.
If an item (attack) used outside of battle changes the HP or MP of a hero, then it affects the current value. If it targets a stat other than HP or MP, then it modifies both the current and maximum values (to be exact, it modifies the current, and then sets the maximum to the current), and the attack always acts as if the allow cure to exceed maximum bitset is on.
[edit] Increasing the maximum of a stat other HP or MP (outside battle only)
Doing this with a healing item should now be obvious. Create a new attack with target stat as HP or MP, cure instead of harm turned on, and target "Ally". Attach this attack to an item as its When used outside of battle action.
If you want, you can use a script instead; see the next section. Those scripts apply identically to stats other than HP and MP.
[edit] Increasing maximum HP or MP (outside battle only)
If you want to change the maximum value of HP or MP you must use a script. See the Plotscripting Tutorial for details on writing and compiling scripts. You can attach a script to an item by creating a new textbox, and in the Conditionals submenu, set "run <script> instead" (Always). Then set the textbox as the out-of-battle effect of the item. The textbox won't display.
The last argument of the set hero stat command tells whether to change the current stat or the maximum stat. And you can use the pick hero command to imitate the hero picker you normally see when using a healing item.
You can modify the following script:
plotscript, add ten max HP, begin variable(who) who := pick hero if (who == -1) then (exit script) # player cancelled variable(old stat) old stat := get hero stat(who, stat:HP, maximum stat) set hero stat(who, stat:HP, old stat + 10, maximum stat) end
If you want to reset the current HP to the new maximum, add the following line to the end of the script:
set hero stat(who, stat:HP, old stat + 10, current stat)
If you want to target a specific hero instead of letting the player choose, modify this script instead:
plotscript, add ten max HP, begin variable(who) who := find hero (hero:Bob) variable(old stat) old stat := get hero stat(who, stat:HP, maximum stat) set hero stat(who, stat:HP, old stat + 10, maximum stat) end
[edit] See Also
Keyboard Shortcuts | Getting Started | Making Maptiles | Making Walkabout Graphics | Importing BMP graphics | Moving on to Map Construction (Using Map Layers) | Making a Hero | Battles | How to use NPCs and Tags | Adding, Removing, Swapping, Heroes | Animating Maptiles | Vehicle Use | Stun, Regen, Poison, and Mute | Sound Effects | Everything You Ever Wanted to Know About Text Boxes, But Were Afraid To Ask (Portrait Boxes) | Distributing a Game
Bosses | Making Complex Attacks | Combat Dialogues | Enemies that respond to a certain attack | Ways to refer to a hero in a script | Creating Dungeons | Permanent Stat-Boosters | Conditional Door Links | Creating Cutscenes | Using the Mouse in the Game