Hime has this awesome script to add parameters via states. My doubt is how can I use variables to declare a value. In the script hime say that is simply as using "v". But how exactly? Let's say I want to use variable 53. I have to use v53, v[53], v(53), v=53? I tried all these forms and didn't work. Also tried $game_variables[53] and didn't work either.
How does this script use variables for the value?
RPG Maker VXAce Supportyou'll have to give the full example on how you used any of the options before we can even guess an answer. because both the v[53] and the game variable code should have worked if used in the correct way, and that points to you doing something wrong with it.
Welp, it's actually a very complicated to explain, and I use a bunch of scripts but here it is:
1) I'm using the card game script
2) Then the yanfly lunatic damage
3) In the lunatic damage I have a damage formula that does the next:
Ruby:
when /BEASTRAGE/i
count = 0
self.banish.each do |cr|
count += 1 if cr.subtype == 11 || 16
end
count = (count * 200)
$game_variables[53] = count
3) Then I used Hime Feature Manager + add param
and I made a skill that called the damage BEASTRAGE and then added the state to the user. The state in the note box has the "<ft: add_param atk v[53]>
But my atk stays the same.
I can guess several possibilities where that might have gone wrong, mostly based on the question on when is which notetag processed.
but unfortunately I don't know any of those scripts enough to handle that, so you'll have to wait until someone with more specific knowledge comes around.
but unfortunately I don't know any of those scripts enough to handle that, so you'll have to wait until someone with more specific knowledge comes around.
Looking at the add param script I can only guess that the one option you didn't try was v 53
<ft: add_param atk v 53>
<ft: add_param atk v 53>
Have you tried to use this in a new project with fewer scripts?
I've added the 4 scripts you mentioned and copied/pasted your note tag, and it seems to work just fine for me (I have used events rather than skills to change the variable/add the state but you wrote that you've checked that this part worked).
If you just added the scripts, keep in mind that changes to the script editor only become effective after you save your project.
Edit:
count += 1 if cr.subtype == 11 || cr.subtype == 16
The parts to the right and left of || are interpreted as independent conditions in Ruby.
I've added the 4 scripts you mentioned and copied/pasted your note tag, and it seems to work just fine for me (I have used events rather than skills to change the variable/add the state but you wrote that you've checked that this part worked).
If you just added the scripts, keep in mind that changes to the script editor only become effective after you save your project.
Edit:
Not relevant here, but this line should probably spell
count += 1 if cr.subtype == 11 || cr.subtype == 16
The parts to the right and left of || are interpreted as independent conditions in Ruby.
Thanks guys, actually the v[53] worked fine... but I'm just stupid and didn't noticed that in the note box I was missing the final > to close the script call... I'm very sorry for wasting all your time.
Original thread: https://forums.rpgmakerweb.com/threads/how-does-this-script-use-variables-for-the-value.150392/