Questions About Arrays and Script Calls

imkranely

Warper
Member
Joined
Feb 13, 2020
Messages
1
Reaction score
0
First Language
English
Primarily Uses
RMMV
The short of it: I am attempting to create a simple card game as an optional mini game. You will collect cards as you travel and even stop by card shops (modern-ish setting). The problem I face is not knowing exactly how to do what I need to.

The long of it:
I have been looking all across the internet from Reddit, to YouTube, to Discord, and countless forums and blogs, but I can't seem to figure out how to do what I need to in order to properly event a card game, or even how to go about making my own plugin to do so. What I've gathered thus far is that I will likely need to find a way to check what cards the player has in their "deck" and create an array based on those cards. I'm using Galv's Magic Shards as a way to create these cards, and I'm adding the note tags to weapons. I was thinking that I would run a script to check which skills the player has, then take those skills and see if they correspond with a predetermined list of numbers, and if so, add them to the array. Then use that array to act as the deck while eventing.

The issue with all of this is that I don't know how to actually go about doing so. I've found the list of script calls you can use and found out how to make an array, and found out how to check if a player has a specific skill, but I don't know how to check if a player has any from a large pool of skills, then take the ones they do have and create an array based on that, then use that array to correspond with pictures and such so that I can actually make this card game work.

I've already found the premade card game on itch.io made by Irana, but it doesn't really match what I'm looking for, and honestly, it's way too expensive for me to download and hope it meets my expectations. I only mention this because every other time I've asked for help on this matter, people immediately say I should get this. Just wanted to get that out of the way is all.

If someone thinks they can help me work on making a plugin, I'd totally be down to colab on that sort of thing. I'd make it myself if I knew enough, but I can only make really simple plugins for the time being. I'm also open to the possibility of commissioning someone if I think it's worth the money, so feel free to make an offer (and if you do, be sure to link any plugins you've made in the past to give me some examples of your work.)

Thanks for taking the time to read this giant wall of text! And if I made anything unclear, feel free to ask and I'll try my best to clear it up.

PS: any plugin I end up making/receiving through this process, I'd be willing to share.
 

NeptuneTron

The Salticid Scholar of the North
Veteran
Joined
Jan 13, 2018
Messages
40
Reaction score
25
First Language
English
Primarily Uses
RMMV
I'm still pretty new to scripting, so I don't have much help to offer you aside from some helpful links that might help get you started.

If you're looking for more information about scripting within MV, you'll probably find the following links useful:

https://kinoar.github.io/rmmv-doc-web/classes/game_event.html Has literally everything you might ever want to know about RPGMaker MV's internal variable things

is a list of script calls by Archeia (think I spelled that wrong) who's super dedicated and helpful on these forums. Looking at that is often helpful to figure out how RPGMaker does it

https://www.tutorialspoint.com/ruby/ruby_operators.htm is a good one for figuring out how Ruby (the language scripting runs on) runs specifically, as compared to other languages RPGMaker MV uses JavaScript, so while there's a lot of similarities with Ruby operators, they might not necessarily work. Use this link instead: https://www.w3schools.com/js/js_operators.asp .

I've found that all of these are super helpful starting places if you have an idea of what you're trying to do. If you don't know what or how you're trying to do something, I'd suggest try writing it out in pseudo-code to collect your thoughts.

Sorry my suggestions aren't really specifically applicable to your question. I hope they help a little bit. Good luck!
 
Last edited:

ozubon

surströmming?
Veteran
Joined
Oct 16, 2018
Messages
178
Reaction score
168
First Language
English
Primarily Uses
RMMV
@NeptuneTron Not to rain on your parade but Ruby is only in past editions of RPG Maker and MV is using Javascript exclusively.

@imkranely I think I can code up the skills to array with numbers for you in a couple of hours when I have some free time!
 

NeptuneTron

The Salticid Scholar of the North
Veteran
Joined
Jan 13, 2018
Messages
40
Reaction score
25
First Language
English
Primarily Uses
RMMV
Well, no wonder things have been strange for me. Thankfully, Ruby and JS appear to be pretty similar in most respects, but I will edit that post, as well as my preconceived notions.
 

ozubon

surströmming?
Veteran
Joined
Oct 16, 2018
Messages
178
Reaction score
168
First Language
English
Primarily Uses
RMMV
@imkranely
There's this innate function that checks if an actor has a skill, that you can put into a conditional branch script box:
JavaScript:
$gameActors.actor(actor id).isLearnedSkill(skill id)
JavaScript:
$gameActors.actor(1).isLearnedSkill(8)
// Returns true if actor 1 has skill 8!

Furthermore, the innate array of skills an actor has:
JavaScript:
$gameActors.actor(actor id)._skills
Here's a plugin I made for you that just uses show picture to display images corresponding to the skills an actor has that matches an array you give it:
Right click link -> Save As

Terms of use: Do whadya want with it

Note: There's no included update function, if an actor learns a new skill you'll have to do the script call again!
 
Last edited:

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

Latest Threads

Latest Posts

Latest Profile Posts


My only regret is the portal mirror effect is too subtle to show up in these GIFs. It probably just needs more sparkles. :LZSwink:
Microsoft: Hey, let's waste money advertising the Xbox Series X when nobody has any in stock, we don't seem to be making more, we aren't taking preorders and you can't get on a waiting list. BEST. IDEA. EVER.
So I'm practicing ITC with a spirit box, and decide to try to contact my deceased soulmate. It actually gave me multiple identifiers. Me, still a bit skeptical, asked aloud "Fine but does he still love me?" and the box spoke and printed the word "Forever" at the same time. Been a mess of tears since. :kaocry:
Been scratching away at my game and making progress, but just had a revelation. I'm working in full screen and adjusting all my pictures accordingly, but will they resize if someone's screen is smaller?? I hope this doesn't turn out to be a problem later.

Forum statistics

Threads
105,635
Messages
1,015,170
Members
137,307
Latest member
MrKaito
Top