Y value position as variable

piksalh

Veteran
Veteran
Joined
Jun 14, 2014
Messages
103
Reaction score
9
First Language
Lithuanian
Primarily Uses
RMMV
Hello,


I’m trying to make hud that shows items count and icons. I’m using "CDR – Show variables" script. Everything works perfect except I don’t know how to set y value position in a specific way. I want item count with icon appear in hud only when player gets it. Let’s say player could have 3 different items (1, 2, 3). If I pre-define each item variables y value position (let’s say 30, 60 and 90), it will show nicely in the column (attached picture). But if player will get only first and last item, there will be a gap in hud.


How can I avoid that gap? Is it possible to set that y value position would be something else than stable value? Can I set it as a value of specific variable (then I can add +30 to that variable before each new item count appears to hud)? Btw, I don’t need item icon to disappear from hud, when item count reaches 0. The script call looks like that:


sv_options(n,x,y) #n is variable number


How to set y as variable, not pre-defined value? Or maybe there is another way to avoid the gap I mentioned (also please see it in attached picture)? Thank You for all your help!



items1.png

items2.png
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,799
Reaction score
12,220
First Language
English
Primarily Uses
RMMV
I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.
 

piksalh

Veteran
Veteran
Joined
Jun 14, 2014
Messages
103
Reaction score
9
First Language
Lithuanian
Primarily Uses
RMMV
Nevermind, I have found the solution. Turns out you can just change y value to $game_variables[n] and it works. I can avoid gap by adding needed number to variable [n] in every item gain event (+=30 in my case).
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

I got tired of not having an avatar image. Couldn't think of anything cool. So I'm just using my game's antagonist instead... How original. At least both of our names start with C?
Expectation: Design/dev a game for the game jam | Reality: "These codes suck, why did I do it this way? lemme fix this. Also what if I add feature xyz because... well, I can."
Did my first script call in an event! :kaopride: It's completely useless and just because I thought it'd be cute if looking at clocks in-game made the character say the real-world time, but it's fully functional scripting and I did it all by myself!
Stream will be going live shortly! I will be playing Resident Evil 3 Remake, and then I will be switching to a session of the Interactive Text Adventure! Feel free to drop by!
Spent all day working on something that ultimately has nothing "flashy" to show at the end of it. But that sense of achievement...

Forum statistics

Threads
95,634
Messages
930,583
Members
125,945
Latest member
pineappletopcake
Top