Hey, another feature I'd like to implement into the game I'm planning would involve stats that are above or below a certain threshold causing a hero's graphics to change (e.g. A soldier hero would get a more buff/ripped walkabout and battle sprite above a certain Strength threshold)
I think this could be done with an if or while condition, get stat, and some other things, but I'm REALLY rusty on plotscripting, even after doing the plotscripting tutorial. Does anyone know a good way to get something like that working?
A hero's stats may change either because they levelled after a battle, because the player changed equipment or used an item, or because of scripts. So you should ideally handle all of those cases, either by triggering a script after-battle and after menus, or if you don't have any other scripts running you can use an infinite loop (set it as the new-game and load-game script):
or you can be lazy and set the "stat checker" as an each-step script (causing a delay before activating though).
The stat checker script itself would look something like:
Assuming you have default palettes correctly set, so the palettes can remain set to "default".
Code:
plotscript, continual stat checker, begin
while (true) do (
stat checker # below
wait (1)
)
end
while (true) do (
stat checker # below
wait (1)
)
end
or you can be lazy and set the "stat checker" as an each-step script (causing a delay before activating though).
The stat checker script itself would look something like:
Code:
plotscript, stat checker, begin
variable (hero)
hero := find hero (hero:Soldier)
# if the hero is in the party
if (hero > -1) then (
# change this threshold
if (get hero stat (hero, state:strength, maximum stat) > 10) then (
# buffed version
set hero picture (hero, 10, outside battle) #walkabout set id
set hero picture (hero, 4, inside battle) #hero sprite set id
) else (
# unbuffed version
set hero picture (hero, 9, outside battle) #walkabout set id
set hero picture (hero, 3, inside battle) #hero sprite set id
)
)
end
variable (hero)
hero := find hero (hero:Soldier)
# if the hero is in the party
if (hero > -1) then (
# change this threshold
if (get hero stat (hero, state:strength, maximum stat) > 10) then (
# buffed version
set hero picture (hero, 10, outside battle) #walkabout set id
set hero picture (hero, 4, inside battle) #hero sprite set id
) else (
# unbuffed version
set hero picture (hero, 9, outside battle) #walkabout set id
set hero picture (hero, 3, inside battle) #hero sprite set id
)
)
end
Assuming you have default palettes correctly set, so the palettes can remain set to "default".
EDIT: pretty certain TMC wrote it a bit more eloquently than i did - i'd follow his post.
it would be something like this i think:
the else is optional. unless you have in-game items that effect stats, you'll want to run this as an after-battle script which is defined in each map's general data.
for get hero stat, the stat option can be a number - i believe they correspond like so:
0,stat:HP
1,stat:MP
2,stat:Atk
3,stat:Aim
4,stat:Def
5,stat:Dog
6,stat:Mag
7,stat:Wil
8,stat:Spd
9,stat:Ctr
10,stat:MP~
11,stat:Hits
i pulled this from a script of my own that i know, the last time i checked, worked - so, good luck.
it would be something like this i think:
Code:
plotscript, checkstat, begin
variable (reqstat)
reqstat:= get hero stat (who,stat,type; leave blank for current)
if (reqstat >= 100) then (set hero picture (who,picture,type)) #this checks what the hero's current called stat is - if above 100 his picture will change. this number can be changed to whatever you like.
end
variable (reqstat)
reqstat:= get hero stat (who,stat,type; leave blank for current)
if (reqstat >= 100) then (set hero picture (who,picture,type)) #this checks what the hero's current called stat is - if above 100 his picture will change. this number can be changed to whatever you like.
end
the else is optional. unless you have in-game items that effect stats, you'll want to run this as an after-battle script which is defined in each map's general data.
for get hero stat, the stat option can be a number - i believe they correspond like so:
0,stat:HP
1,stat:MP
2,stat:Atk
3,stat:Aim
4,stat:Def
5,stat:Dog
6,stat:Mag
7,stat:Wil
8,stat:Spd
9,stat:Ctr
10,stat:MP~
11,stat:Hits
i pulled this from a script of my own that i know, the last time i checked, worked - so, good luck.
Foxley wrote:
Hey, another feature I'd like to implement into the game I'm planning would involve stats that are above or below a certain threshold causing a hero's graphics to change (e.g. A soldier hero would get a more buff/ripped walkabout and battle sprite above a certain Strength threshold)
This would be cool to see.
dOn'T MiNd mE! i'M jUsT CoNtAgIoUs!!!
Play Orbs CCG: http://orbsccg.com/r/4r6x
it's possible to get that by adding a new hero, setting its level, and then deleting it, which could be encapsulated in a script, but that's not a reason not to add a built in command.
Changes with a script to either the max or base value of a stat modifies the other one as well. The difference ebtween the two is the equip bonuses, unless a stat cap is hit.
Changes with a script to either the max or base value of a stat modifies the other one as well. The difference ebtween the two is the equip bonuses, unless a stat cap is hit.
I understood that, which is why we need this...
But you're right. I actually always forget you can add multiples of a hero. I feel silly for not realizing that before.
Of course, it makes using find hero commands a little dangerous, but not if you're aware of what's happening.
But you're right. I actually always forget you can add multiples of a hero. I feel silly for not realizing that before.
Of course, it makes using find hero commands a little dangerous, but not if you're aware of what's happening.
Sorry, I've been so slammed with work I haven't had a chance to try this. Thanks a bunch TMC and everyone else, I'll give it a shot tonight!
EDIT:
Indeed it does work! Excellent. Thanks for all the help.
EDIT2:
Oh, and specifically--
I set the 'continual stat checker' script to run on new-game and load-game under special plotscripts. Seems to work like a charm.
EDIT:
Indeed it does work! Excellent. Thanks for all the help.
EDIT2:
Oh, and specifically--
I set the 'continual stat checker' script to run on new-game and load-game under special plotscripts. Seems to work like a charm.



