How does this script use variables for the value?

Mattsuharu

Veteran
Veteran
Joined
Apr 15, 2022
Messages
104
Reaction score
39
First Language
English
Primarily Uses
RMVXA
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.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
37,033
Reaction score
10,029
First Language
German
Primarily Uses
RMMV
you'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.
 

Mattsuharu

Veteran
Veteran
Joined
Apr 15, 2022
Messages
104
Reaction score
39
First Language
English
Primarily Uses
RMVXA
you'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
I checked with a text box if the variable 53 changed, and it does.
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.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
37,033
Reaction score
10,029
First Language
German
Primarily Uses
RMMV
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.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
4,385
Reaction score
1,214
First Language
English
Primarily Uses
RMVXA
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>
 

Another Fen

Veteran
Veteran
Joined
Jan 23, 2013
Messages
658
Reaction score
368
First Language
German
Primarily Uses
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 || 16
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.
 
Last edited:

Mattsuharu

Veteran
Veteran
Joined
Apr 15, 2022
Messages
104
Reaction score
39
First Language
English
Primarily Uses
RMVXA
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.
 

Latest Threads

Latest Profile Posts

Sometimes I wonder why I still try and recruit others to help with my games. It never works.
ScreenShot_10_3_2022_4_27_17.png
welp, thanks to Luna MV, I was able to add the Balloon as a window... thus allowing me to edit the font color and outline... so now it looks like comic bubbles above characters. I have NO idea why I couldn't get this to work through more conventional means, but here we are.
CUTE CUTE CUTE.gif
I cannot cease doing cute art
War and Wonder is a 100% choice-based open-world visual novel.
1664821313732.png
1664821466359.png
1664821547746.png
Going live soon on Twitch, and will continue Fortunastreet's game "Verloren". For those who are curious, you are welcome to join ;)

-> Franz' Twitch channel

Forum statistics

Threads
125,749
Messages
1,173,225
Members
164,911
Latest member
KyzerKiba
Top