Post new topic    
Liquid Metal Slime
Send private message
counter stat scripting 
 PostSat May 19, 2012 10:45 pm
Send private message Reply with quote
When a particular item is used, it calls a script that should raise Fuel (MP) +10 and Medals (Counter) +1. Below is the script. It almost works, however the Medals stat appears as 0 (wrong) on the Stats screen but as 1 (right) on the Equip screen. The Fuel stat shows correctly on both.

Am I explaining this well? Does anyone have any idea what's going on?

plotscript, medal, begin
variable(who)
who := pick hero
if (who == -1) then (exit script)
variable(oldstat)
oldstat := get hero stat(who, stat:Fuel, maximum stat)
set hero stat(who, stat:Fuel, oldstat + 10, maximum stat)
oldstat := get hero stat(who, stat:Medals, maximum stat)
set hero stat(who, stat:Medals, oldstat + 1, maximum stat)
delete item (68, 1)
end
Liquid Metal King Slime
Send private message
Re: counter stat scripting 
 PostSun May 20, 2012 12:09 am
Send private message Reply with quote
Code:

oldstat := get hero stat(who, stat:Medals, maximum stat)
set hero stat(who, stat:Medals, oldstat + 1, maximum stat)
set hero stat(who, stat:Medals, oldstat + 1, current stat)


You should set both the maximum stat and the current stat. If you just set the maximum stat, then the change doesn't really take effect until after the next battle ends.
Liquid Metal Slime
Send private message
Re: counter stat scripting 
 PostMon May 21, 2012 11:40 pm
Send private message Reply with quote
James Paige wrote:
Code:

oldstat := get hero stat(who, stat:Medals, maximum stat)
set hero stat(who, stat:Medals, oldstat + 1, maximum stat)
set hero stat(who, stat:Medals, oldstat + 1, current stat)


You should set both the maximum stat and the current stat. If you just set the maximum stat, then the change doesn't really take effect until after the next battle ends.


As usual, you are the man.
Display posts from previous: