Welcome to the PokéCommunity!

Hi there! Thanks for visiting PokéCommunity. We’re a group of Pokémon fans dedicated to providing the best place on the Internet for discussing ideas and sharing fan-made content. Welcome! We’re glad you’re here.

In order to join our community we need you to create an account with us. Doing so will allow you to make posts, submit and view fan art and fan fiction, download fan-made games, and much more. It’s quick and easy; just click here and follow the instructions.

Hey guys,
I've been working on a starter selection screen for my game, and for the most part I have it working, with all the accompanying graphics and whatnot. Granted it's not the fanciest looking thing, but it does its job well enough. I just have a few things I need to address in order to continue working on it.

First up: at present, I've been hardcoding the starter Pokemon and their respective data, images etc into the script. I know I should really be using the @pokemon thing, and getting the names, types and number out of that, but I don't understand how it works, and I couldn't find like a def thing that describes how it operates or how to set it to a particular Pokemon. Oh, and at the completion of the screen, it should add the selected Pokemon to the party. Would someone please elaborate upon this function?

Secondly, I have some questions about message and choice windows. I was wondering if it was possible to display a smaller window, one line high, at the bottom of the screen, and containing text defined in the script. In addition, this window should have attached a choice window thingy with the yes and no thing, ensuring it aligns with the newer sized window. I've included an attachment to illustrate what I mean.

In addition, I've also included my current code. It's a bit messy, unfinished, and will be cleaned up in due time. Here it is:

I also intend on somehow adding parameters to the script call such that the user can define their own starters without having to modify the code, but I'll get to that one I have to regular script working. Thanks in advance for any help, guys.
Cheers, Jim

Hey guys,
I've been working on a starter selection screen for my game, and for the most part I have it working, with all the accompanying graphics and whatnot. Granted it's not the fanciest looking thing, but it does its job well enough. I just have a few things I need to address in order to continue working on it.

First up: at present, I've been hardcoding the starter Pokemon and their respective data, images etc into the script. I know I should really be using the @pokemon thing, and getting the names, types and number out of that, but I don't understand how it works, and I couldn't find like a def thing that describes how it operates or how to set it to a particular Pokemon. Oh, and at the completion of the screen, it should add the selected Pokemon to the party. Would someone please elaborate upon this function?

Secondly, I have some questions about message and choice windows. I was wondering if it was possible to display a smaller window, one line high, at the bottom of the screen, and containing text defined in the script. In addition, this window should have attached a choice window thingy with the yes and no thing, ensuring it aligns with the newer sized window. I've included an attachment to illustrate what I mean.

In addition, I've also included my current code. It's a bit messy, unfinished, and will be cleaned up in due time. Here it is:

I also intend on somehow adding parameters to the script call such that the user can define their own starters without having to modify the code, but I'll get to that one I have to regular script working. Thanks in advance for any help, guys.
Cheers, Jim

Thanks for the assistance, IceGod. I modified the add Pokemon script a bit and added it in the Input::C section, where it belongs, along with the confirmation message. Speaking of which, I didn't have to copy any scripts, I just had to use "Kernel.ConfirmMessage(blahblahblah)".

However, what you suggested only half answers my questions. I still have to hardcode the Pokemon data, and I still need to know how to display a smaller message window (assuming you can. I suspect one would). Thanks for what you did contribute, at least. Now the script actually adds Pokemon. :D
Cheers, Jim.

Okay so this is a huge necropost. Sorry if that's a problem. I've gone back to my Starter Selection screen, and rewritten it from the ground up in order to be able to accept parameters such that it can be initialised with any three Pokémon as specified in the method call.

What I've built seems more or less structurally sound, but I've come to realise the variables passed into the method call have no way of reaching their target destinations. The code compiles, but throws an exception when called due to the "missing" variable values.

As far as I've seen, the only self-contained way I can pass those variables all the way down to the required code is to pass them through each and every method along the way. It's pretty safe to say that with several variables this becomes quite lengthy and unpleasant to read. Is there an easier way by which I might pass these variables though to their intended code?

I think you're missing the point of my rewrite, FL. That solution hardcodes the start selections into the script. I'm trying to make it such that it can use any three Pokémon as denoted by the script call. So, instead of calling pbShowStarterSelection and having to pick between Bulbasaur, Charmander or Squirtle, you could call pbShowStarterSelection(x,y,z) or pbShowStarterSelection(a,b,c) and have the script display choices for completely different sets of Pokémon.

The problem with that is that in order to pass x,y,z/a,b,c to the part of the script that actually displays the scene, I would have to add parameters to several method calls along the way, none of which actually use them. If I could put them straight into a set of quote-unquote "global" variables accessible from anywhere inside that script, that would be really helpful. It'd be kind of like the OO classes I've been writing in C++.

I think you're missing the point of my rewrite, FL. That solution hardcodes the start selections into the script. I'm trying to make it such that it can use any three Pokémon as denoted by the script call. So, instead of calling pbShowStarterSelection and having to pick between Bulbasaur, Charmander or Squirtle, you could call pbShowStarterSelection(x,y,z) or pbShowStarterSelection(a,b,c) and have the script display choices for completely different sets of Pokémon.

The problem with that is that in order to pass x,y,z/a,b,c to the part of the script that actually displays the scene, I would have to add parameters to several method calls along the way, none of which actually use them. If I could put them straight into a set of quote-unquote "global" variables accessible from anywhere inside that script, that would be really helpful. It'd be kind of like the OO classes I've been writing in C++.

Since you call a method in a different class, you need, at least, put it in two parameters declarations, there ways to put in only one using a Global Variable ($), but this is really a bad idea, use an Instance Variable (@) instead:

Ah, thank you so much! Those instance variables worked a treat! I've got it up and running and working successfully with any given Pokémon, though I've noticed the species number has to be exactly three digits regardless of value; it makes playing the the rand() function slightly less amusing than it should be. In any case, it works exactly as I intended it to work. Again, thanks a bunch!

Spoiler:

I'm considering making it public. It's not the prettiest thing in the world, but it should be robust enough to withstand some modifications. Thoughts?

If you're looking at the %03d part, that only applies to filenames (just like every other script dealing with file names). You can still use pbShowStarterSelection(4,25,1138) and it'll work just fine - filenames here will be 004, 025 and 1138.

%03d means that, when the number (d means "number" here) is turned into a string (% means "turn into string"), it is padded at the beginning so that it's at least 3 digits long. The character used for padding is 0.

Ah, yes, so it does. It seems I had changed the %03d part to {1} at some point because it wasn't working. A few seconds of looking at other uses of %03d has led me to realise that you have to use sprintf instead of _INTL or it won't work. That must have been why I switched it to {1}, which now I realise takes the value literally and thus doesn't pad it to the required length. Helpful as ever, Maruno.

If you're looking at the %03d part, that only applies to filenames (just like every other script dealing with file names). You can still use pbShowStarterSelection(4,25,1138) and it'll work just fine - filenames here will be 004, 025 and 1138.

%03d means that, when the number (d means "number" here) is turned into a string (% means "turn into string"), it is padded at the beginning so that it's at least 3 digits long. The character used for padding is 0.

First you want to add parameters to the relevant methods. I've outlined these in red below. That way, you can call "pbCallPokemonSelect(a,b,c)" like you want to. Then, you want to move those three lines with the instance variables "@blahblah" into the def, "pbStartScene", as indicated in blue. From now on, if you want to access those values from any method in that class, you only need to use "@blahblah". I'll let you figure out what to do with them after that.

Oh, and as a quick side note, there are better ways of encapsulating your left/right input triggers.

Hmm, just looking at what you've posted you should be doing okay. I used the sprintf version of what you have up there and I'm not having any problems. There may be a logic error somewhere in your code. It's possible you may have misspelled a variable name or failed to set the value of @starterOne to that of the call parameter... I'd have to see your whole script to know for sure. Check over your code a few more times, call by call, to make sure that what you're coding makes sense.

As an addendum to what Maruno said, take a look at which type-picture you want to display. The Pokédex uses a different source of type-pictures (pokedexTypes.png) to most other screens (types.png). They can both be drawn the same way, but since the latter is smaller, you'll need to use smaller offset values. It comes down to aesthetic preference, I guess.

This in specific won't work (I don't know much of the specific names in the code yet), but it might help you find what you need. The second and third argument are what is displayed in the text message.

The PokéCommunity

Meta

Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, or The Pokémon Company International. We just love Pokémon.