So I've been mucking about with a new project. No, I'm not going to drop Legacy, it's very much alive and well. Just something I've been tinkering about with to prevent me from burning out with Legacy. Like I did with Legacy, I'll use this as a catch-all for everything related to this project and any questions about scripting I have.
My current question is, how do I set a hero's stat at a certain level?
I know how to set a hero's stats at his current level (SET HERO STAT) but what I can't seem to figure out is how to set that same stat at max level so that the stats will progress naturally.
CONTEXT:
I have a script that's supposed to (based on a bunch of other variables and stuff) figure out what the player's starting stat and max stat are. I've gotten figuring out what the stat should be down and working flawlessly.
What I can't get working is how to set the starting and max stats. Starting is easy, but I can't seem to find a command that lets me set the maximum stat (I thought it would be SET HERO STAT(me, stat:Health, maximum stat) but that's used for something else) so that the player can level and progress normally.
I'm sure (again) that the solution is simple and staring me right in the face, but I can't seem to figure it out.
Thanks!
Being from the third world, I reserve the right to speak in the third person.
Using Editor version wip 20170527 gfx_sdl+fb music_sdl
I assume by "max stat", you're talking about how in the engine you can set stats for L0 and L99, and this determines the growth curve on each level up?
As far as I know, there isn't any way to check or set that data at the moment. At least not the last time I looked into it.
There are some ways around it, however. For instance, you could define your own level-up formula, and set the stats per each level on that basis. For instance, say HP increases by (5+current_level) at each level up, you'd just use the commands you already know about on each level-up:
setherostat(me,stat:HP,(getherostat(me,stat:HP,maximumstat)+(5+getherolevel(me))),maximumstat)
Alternately, to get a closer approximation of what you want, maybe you could store your own L0 and L99 stat values in global variables, and then use the above method except with the OHR's default stat growth formula:
stat = floor( (.8 + level / 50) * level * ((a99 - a0) / 275.222) + a0 + .1 )
Just plug in the current level where it says "level", your L99 global variable where it says "a99", and your L0 global variable where it says "a0".
SPELLSHARD: THE BLACK CROWN OF HORGOTH now COMPLETE! Grab it today!
As far as I know, there isn't any way to check or set that data at the moment. At least not the last time I looked into it.
There are some ways around it, however. For instance, you could define your own level-up formula, and set the stats per each level on that basis. For instance, say HP increases by (5+current_level) at each level up, you'd just use the commands you already know about on each level-up:
setherostat(me,stat:HP,(getherostat(me,stat:HP,maximumstat)+(5+getherolevel(me))),maximumstat)
Alternately, to get a closer approximation of what you want, maybe you could store your own L0 and L99 stat values in global variables, and then use the above method except with the OHR's default stat growth formula:
stat = floor( (.8 + level / 50) * level * ((a99 - a0) / 275.222) + a0 + .1 )
Just plug in the current level where it says "level", your L99 global variable where it says "a99", and your L0 global variable where it says "a0".
SPELLSHARD: THE BLACK CROWN OF HORGOTH now COMPLETE! Grab it today!
KF Harlock wrote:
I assume by "max stat", you're talking about how in the engine you can set stats for L0 and L99, and this determines the growth curve on each level up?
Yup that's exactly what I'm talking about.
KF Harlock wrote:
For instance, you could define your own level-up formula, and set the stats per each level on that basis.
Hmm, I see. I was afraid I'd have to do it manually like that, but it should be doable I guess.
Thanks for the info!
Being from the third world, I reserve the right to speak in the third person.
Using Editor version wip 20170527 gfx_sdl+fb music_sdl
Enemy walkabout sprites:
Giant Ant:
Bugbear:
Cutpurse:
Drake:
Ettin:
Flesh Golem:
Goblin:
Hobgoblin:
Imp:
Jackal:
Kobold:
Lilitu:
Mandragora:
Naga:
Orc:
Pixie:
Qiqirn:
Giant Rat:
Skeleton:
Tengu:
Unicorn:
Viper:
Wendigo:
Xorn:
Yeth Hound:
Zombie:
Ankheg:
Basilisk:
Corrupter:
Dragon:
Edimmu:
Fiend:
Gnoll:
Hydra:
Ifrit:
Jormungandr:
Karkinos:
Lich:
Minotaur:
Nephilim:
Ogre:
Phoenix:
Quasit:
Roc:
Scylla:
Talos:
Umber Hulk:
Vampire:
Werewolf:
Xelhua:
Yeti:
Zmiy:
Being from the third world, I reserve the right to speak in the third person.
Using Editor version wip 20170527 gfx_sdl+fb music_sdl
Giant Ant:
Bugbear:
Cutpurse:
Drake:
Ettin:
Flesh Golem:
Goblin:
Hobgoblin:
Imp:
Jackal:
Kobold:
Lilitu:
Mandragora:
Naga:
Orc:
Pixie:
Qiqirn:
Giant Rat:
Skeleton:
Tengu:
Unicorn:
Viper:
Wendigo:
Xorn:
Yeth Hound:
Zombie:
Ankheg:
Basilisk:
Corrupter:
Dragon:
Edimmu:
Fiend:
Gnoll:
Hydra:
Ifrit:
Jormungandr:
Karkinos:
Lich:
Minotaur:
Nephilim:
Ogre:
Phoenix:
Quasit:
Roc:
Scylla:
Talos:
Umber Hulk:
Vampire:
Werewolf:
Xelhua:
Yeti:
Zmiy:
Being from the third world, I reserve the right to speak in the third person.
Using Editor version wip 20170527 gfx_sdl+fb music_sdl
I love the letter-walkabouts. Those are great!
There is no nice easy way to get what a hero's stats should be at level 99. There is one hacky way, but it might not be worth the trouble.
Add a new copy of the hero to the party, set the hero's level to 99, then read the stats. The hard part is removing the new copy of the hero, because many hero-related commands only operate on the first copy of the hero, so if you simply try to delete the level 99 copy, you will accidentally delete your real hero instead :(
There is no nice easy way to get what a hero's stats should be at level 99. There is one hacky way, but it might not be worth the trouble.
Add a new copy of the hero to the party, set the hero's level to 99, then read the stats. The hard part is removing the new copy of the hero, because many hero-related commands only operate on the first copy of the hero, so if you simply try to delete the level 99 copy, you will accidentally delete your real hero instead :(
You can also set the hero's level to 99, then read his stats.
Mega Tact v1.1
Super Penguin Chef
Wizard Blocks
Mega Tact v1.1
Super Penguin Chef
Wizard Blocks
Sure, but you can do it at the beginning of the game, store the values, and never need to do it again*.
*Also, never change your hero's max stats
Mega Tact v1.1
Super Penguin Chef
Wizard Blocks
*Also, never change your hero's max stats
Mega Tact v1.1
Super Penguin Chef
Wizard Blocks
Why wouldn't you just know the level 99 stats? Can't you just find the character's ID number and then pass that through a switch script to find the stats?
The question I'd like to ask, because this kind of effects my games too, is when you alter a hero's current stats, if the character then reaches level 99, would it still have the level 99 stats inputted into the editor? Instead of say, the lvl 99 stats plus the increases the stats have received.
The question I'd like to ask, because this kind of effects my games too, is when you alter a hero's current stats, if the character then reaches level 99, would it still have the level 99 stats inputted into the editor? Instead of say, the lvl 99 stats plus the increases the stats have received.
D) Stat caps don't interfere with the result
If you modify a hero's max stats then the change is remembered permanently. For example, if their Attack at level 0 is 10, at level 99 it is 100, and suppose that when they are level 10 their HP is 20 but you change it via a script or item to 25. Then at level 99 it would become 105.
The exception, again, is if there is a stat cap. Stats are recapped after any change, including equipping items, and the original value is forgotten.
Bug 743: Unequipping items with stat bonuses that exceed stat limits is broken
Related:
Bug 14: Equipment with negative stat bonuses should not be able to reduce hero's stats below zero
If you modify a hero's max stats then the change is remembered permanently. For example, if their Attack at level 0 is 10, at level 99 it is 100, and suppose that when they are level 10 their HP is 20 but you change it via a script or item to 25. Then at level 99 it would become 105.
The exception, again, is if there is a stat cap. Stats are recapped after any change, including equipping items, and the original value is forgotten.
Bug 743: Unequipping items with stat bonuses that exceed stat limits is broken
Related:
Bug 14: Equipment with negative stat bonuses should not be able to reduce hero's stats below zero
Mogri wrote:
You can also set the hero's level to 99, then read his stats.
That would work if I had less than 40 heroes and I could set hero stats within the editor. As it stands, I have 120 possible combinations for all my heroes.
From left to right, that's: Adventurer, Assassin, Barbarian, Explorer, Fighter, Infiltrator, Magus, Necromancer, Paladin, Rogue, Wanderer, and Wizard.
From top to bottom, that's: Beastman, Dark Elf, Dwarf, Elf, Gnome, Golem, Halfling, Human, Lizardman, and Vampire.
If I had fewer heroes, it would be possible to set the base and final stats in-editor, but with the number of heroes, I decided to only have the one defined in-editor, with base and final stats both at 0. When the player chooses the race/class combination (working perfectly as of now), a formula figures out the base stat. I decided to do as Harlock suggested and just do my own level-up formula (working clunkily as of of now), it wasn't hard to implement, and it'll allow me to do feats (not working at all as of now) as well.
Spoonweaver wrote:
Why wouldn't you just know the level 99 stats? Can't you just find the character's ID number and then pass that through a switch script to find the stats?
Pretty much the same reason I can't just define all the heroes in-editor, there are too many of them.
For now, looks like I'll be going with custom stat manipulation for levelling up. With luck, I'll have a playable alpha by the end of the week.
Cheers!
Being from the third world, I reserve the right to speak in the third person.
Using Editor version wip 20170527 gfx_sdl+fb music_sdl
Spoonweaver wrote:
Ah, well ok, but in most rpgs, race only changes a character's starting stats, so you could just use the characters in the editor as classes and assemble each custom character with scripts.
That is, assuming you are using a system similar to most rpgs.
That is, assuming you are using a system similar to most rpgs.
Well, actually both race and class determine the starting stats. A beastman barbarian would have different start/end stats than a beastman magus.
Still, there is indeed merit in setting some static heroes for the different classes, that could give me something to work off of when figuring out stats at specific levels.
Mystic wrote:
Depending on the design of his game, he can build off of that idea as well. He could have a hero for each class and for each race, and then combine their stats when doing level-ups for the actual hero.
Hmm, that's an idea, I'll see what I can do with that.
Being from the third world, I reserve the right to speak in the third person.
Using Editor version wip 20170527 gfx_sdl+fb music_sdl



