here the scriptcall list related topics for Ruby and RGSSx which i could find.
I went through all the command script calls before making my post, however the "
-Set Variables equal to amount of Items" is close. I attempted to use "$game_var... = $game_party.members[0].hp" before my post as well, but that yielded nothing; the variable stayed 0.
To help with that it would be good to know what you're trying to do with it, aswell as where you tried to set the value
So I think nothing is wrong with the command itself, you need to tell us what you want to use it for and where before we can tell you the correct form of using it.
Understood! Sorry for the lack of context. I somewhat assumed the issue was a simple lack of knowledge on my part, just not knowing the exact line of code or terms I should use. No matter, here's some more info.
So I'm currently using the Sapphire Action System, however it has been edited greatly. I've added melee spells, heals, buffs, etc as real time skills you can use, rather than just projectiles. To do this, I've given the skills an ID number in the note section. When the Sapphire_Skill is initialized (whenever a skill is cast,) the game goes through a number of if, elsif, esif, for all the spells in the game, where it gains it's certain traits. For buffs and the like, I cut the middle-man and just tell the game what animation to play, and what to do.
elsif ID == 2
$game_player.instance_eval("@move_speed = 5.0")
$game_player.animation_id = 123
Something like this ^^^
So, I've designed a healing spell that increases in strength the lower you are on health.
hcheck = $game_variables[8]
$game_variables[41] = hcheck * 0.1
$game_variables[42] = hcheck * 0.2
$game_variables[43] = hcheck * 0.3
$game_variables[44] = hcheck * 0.4
$game_variables[45] = hcheck * 0.5
$game_variables[46] = hcheck * 0.6
$game_variables[47] = hcheck * 0.7
$game_variables[48] = hcheck * 0.8
$game_variables[49] = hcheck * 0.9
#---
if ID == 4
if $game_variables[11] <= $game_variables[41]
$game_variables[50] = hcheck * 0.3
$game_party.members[0].hp += $game_variables[50]
elsif $game_variables[11] <= $game_variables[42]
$game_variables[50] = hcheck * 0.28
$game_party.members[0].hp += $game_variables[50]
elsif $game_variables[11] <= $game_variables[43]
$game_variables[50] = hcheck * 0.26
$game_party.members[0].hp += $game_variables[50]
elsif $game_variables[11] <= $game_variables[44]
$game_variables[50] = hcheck * 0.24
$game_party.members[0].hp += $game_variables[50]
elsif $game_variables[11] <= $game_variables[45]
$game_variables[50] = hcheck * 0.22
$game_party.members[0].hp += $game_variables[50]
elsif $game_variables[11] <= $game_variables[46]
$game_variables[50] = hcheck * 0.20
$game_party.members[0].hp += $game_variables[50]
elsif $game_variables[11] <= $game_variables[47]
$game_variables[50] = hcheck * 0.18
$game_party.members[0].hp += $game_variables[50]
elsif $game_variables[11] <= $game_variables[48]
$game_variables[50] = hcheck * 0.16
$game_party.members[0].hp += $game_variables[50]
elsif $game_variables[11] <= $game_variables[49]
$game_variables[50] = hcheck * 0.14
$game_party.members[0].hp += $game_variables[50]
elsif $game_variables[11] <= $game_variables[8]
$game_variables[50] = hcheck * 0.12
$game_party.members[0].hp += $game_variables[50]
end
Variable 8 = Max HP
Variable 11 = Current HP
Variable 50 = Heal based on level, sorta, still workin that, so don't worry about it
Keep in mind, all of this is happening in the initialize. It makes it so the game only has to read this if the skill is cast, which would be the perfect place to update the current health. So, I insert
$game_variables[11] = actor.hp
$game_variables[8] = actor.mhp
at the very top, run the game, try to use a skill, and
Ouch.
And I can't for the life of me figure out why. Like I said, it functions when put in the update def of
the very same class.
You could put it into an update method that will only execute every x-amount of frames for example.
Not sure what you mean by this, but I would love to know, not just for this problem, but for future reference as well.
Ok, sorry that was long. Hope I didn't include too much unnecessary information, and thank you all for your time in helping me with my silly game. It means a lot
