The_Sarah

Let's make great games together!
Veteran
Joined
Jul 18, 2020
Messages
103
Reaction score
90
First Language
English
Primarily Uses
RMVXA
Hey all!

I think I overcomplicated my presentation on this, so I'm revamping the request.

~~

I would like someone to make me a horizontal row of icons or items (IN A WINDOW) that can be swapped around by the user while in-game.

So (for example) this:

icon 1, icon 2, icon 3, icon 4


Could become this:

icon 3, icon 2, icon 1, icon 4

~~

Much like how formation allows you to swap party members around, I am trying to figure out how to do that with a horizontal row of icons or items.

So if anyone could make something small like this for me so that I can then dissect it myself and see what I'm not currently understanding I'd very much appreciate it.

Thanks fam!
 
Last edited:

zeroscares

Veteran
Veteran
Joined
Oct 17, 2020
Messages
97
Reaction score
19
First Language
português
Primarily Uses
RMVXA
Perhaps the best solution would be to assign a button for moving options. If you used ALT, in this example, then once you pressed ALT once, you would save the index variable the player chose. So, player pressing "Option 3" means the game would store index number 2. (Indexes start at 0, I think)

Then, once the player presses ALT on another index...example, "Option 1", so index 0. You would have to refresh the window and draw the commands in their proper order. I think VX Ace draws command lists in the order they are hard coded in...So you'd need to find a way around that
 

kyonides

Reforged is laughable
Veteran
Joined
Nov 17, 2019
Messages
290
Reaction score
73
First Language
English
Primarily Uses
RMXP
You could use two @variables or an @array that will hold two items. Make it a two step process like using the selector first to mark the first option to be swapped, then keep it frozen (not updated but still visible) while you pick the second option. Swap them, it's quite easy to do indeed, go check out how the default scripts defines the options. There modify it in such a way as to use a different @array that will store all of the available options. I think the rest of this process is self evident now. =_=¡
 

The_Sarah

Let's make great games together!
Veteran
Joined
Jul 18, 2020
Messages
103
Reaction score
90
First Language
English
Primarily Uses
RMVXA
Perhaps the best solution would be to assign a button for moving options. If you used ALT, in this example, then once you pressed ALT once, you would save the index variable the player chose. So, player pressing "Option 3" means the game would store index number 2. (Indexes start at 0, I think)

Then, once the player presses ALT on another index...example, "Option 1", so index 0. You would have to refresh the window and draw the commands in their proper order. I think VX Ace draws command lists in the order they are hard coded in...So you'd need to find a way around that

Sorry, I think I overcomplicated what I was trying to do. I've since edited the original post to make it clearer to understand.

I know the script will probably use a form of "pending_index" like you say, but it doesn't need alternate inputs. The script I want can be as simple as 4 icons that simply exist to be moved around by the player horizontally.

~~

You could use two @variables or an @array that will hold two items. Make it a two step process like using the selector first to mark the first option to be swapped, then keep it frozen (not updated but still visible) while you pick the second option. Swap them, it's quite easy to do indeed, go check out how the default scripts defines the options. There modify it in such a way as to use a different @array that will store all of the available options. I think the rest of this process is self evident now. =_=¡

My brain's kind of stopped working on this one (hence why this is in script requests rather than Ruby learning), but if it ever manages to kick itself into gear again then thanks for the tip on a place I can look (still just plodding slowly through all the windows at the moment lol).
 

zeroscares

Veteran
Veteran
Joined
Oct 17, 2020
Messages
97
Reaction score
19
First Language
português
Primarily Uses
RMVXA
I know the script will probably use a form of "pending_index" like you say, but it doesn't need alternate inputs. The script I want can be as simple as 4 icons that simply exist to be moved around by the player horizontally.
You could just use your basic confirm button for it. There's not much of a logic difference!
Anyway you should look into https://forums.rpgmakerweb.com/index.php?threads/lune-item-grid.37399/ and see what they did, in spots like def command_move. Perhaps that is closer to what you would like
 

Latest Threads

Latest Posts

Latest Profile Posts

Does anyone know of NPC sprites for RMMZ? I know of Flirion's RMMV recolours, but RMMZ's sprites are slimmer and more detailed, so I'm a bit on the edge to use Flirion's im RMMZ...
I can't believe that after all those years, KH Union X Dark Road is closing the services.

Due to a situation in which I thought plugin adaptations had stopped for the QPlugins, I "ghetto" converted these 7 over yesterday. They appear to work perfectly as long as you use old style plugin commands. I am uncertain if I will have a lot of free time in the future to work on this, but if you'd like them, here they are.
Was there a thread that you could share a screenshot of your game? I feel like I found it once but can't locate it again.

I was being lazy and just copied a map to test a new parallax, but I forgot to delete all the events. This was the result. :o

Forum statistics

Threads
108,819
Messages
1,039,789
Members
141,277
Latest member
FeatherStone
Top