• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Scottie, Todd, Serena, Kris - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

A few simple questions that I'm stumped on...

1) How can I set a range of random values between two numbers? For example, if I want a Pokemon's IV's to be randomized but only between the numbers 25-31, how would I write that out?

2) What are some ways I could 'remember' a Pokemon's current IV spread, allowing me to reset them to those initial values even after I manually alter the numbers? I was thinking with variables, but I'm not sure exactly how to do that, or if there's an easier way.

3) Is there a way to change the text color for the command options on the Pokemon in the party menu?

4) How would I go about hiding certain commands in the party menu if the Pokemon has a particular move? I'm asking because I've made it so that you can give Pokemon certain field moves (Flash, Teleport, etc) without needing the actual move itself. However, this creates redundancies when the Pokemon already has those moves (making Flash show up twice in the command list). Ideally, I would want to set it up so that the Flash command I made just doesn't show if the Pokemon already has the move Flash.
 
You never specified what program you're using but here's some pseudocode haha

1) You would just do 25 + random(7)
2) You could give every Pokemon an additional variable that's just a single string like (313131313131) and then parse it out whenever you need it
3) Just look at whatever script the party menu is written in & find where the text color is located
4) Same as above; look at the script and find where each move is rendered, and then add an if statement (ex: if hasFlash then hideFlashOption)
 
You never specified what program you're using but here's some pseudocode haha

1) You would just do 25 + random(7)
2) You could give every Pokemon an additional variable that's just a single string like (313131313131) and then parse it out whenever you need it
3) Just look at whatever script the party menu is written in & find where the text color is located
4) Same as above; look at the script and find where each move is rendered, and then add an if statement (ex: if hasFlash then hideFlashOption)

Oh, I'm using RPG Maker XP with Essentials v16.

1) That worked, thanks.

2) Cool, I'll look into this one later.

3) I've tried searching for this before, but I haven't been able to locate it, and it doesn't seem to be as straight forward as that (or maybe it is, idk). The text it uses to draw the menu options seems to be coming from a different part of the script, because I don't see a line anywhere in the Def referring to the text color of the lines I'm trying to change.

4) I can locate this section, I've been fiddling with it for a while. I'm just unsure how to actually write out a code to hide it. I'd have to define all of that before i could write it out as simply as that, but nothing i've attempted has worked. I'm unsure how to make it read if a pokemon has a certain move, and how to make that trigger the cmd option being hidden if it's present.
 
By command options do you mean this menu that pops up?
[PokeCommunity.com] A few simple questions that I'm stumped on...

That just uses the default text font because it's essentially a message & a question in terms of code.

Not too familiar with RMXP but I'll look into the move stuff

~~edit

In PScreen_Party, find the line
Code:
def pbPokemonScreen
There's a section in it which is
Code:
for i in 0...pkmn.moves.length
        move=pkmn.moves[i]
        # Check for hidden moves and add any that were found
        if !pkmn.isEgg? && (isConst?(move.id,PBMoves,:MILKDRINK) ||
                            isConst?(move.id,PBMoves,:SOFTBOILED) ||
                            HiddenMoveHandlers.hasHandler(move.id))
          commands[cmdMoves[i]=commands.length]=PBMoves.getName(move.id)
        end
      end
Just update that if statement to exclude any hidden moves you might want to exclude.
 
Last edited:
Yes, that's the menu I'm talking about. I was hoping there would be a way to make one of the options in that list a different color.

Oh, and I figured out the issue I was having with the hidden moves, thanks.
 
1) You would just do 25 + random(7)

Rather use something like
random=value1+(value2-value1+1) where value2 is the higher number.

This would get the values between x and y rather than 25 and 31
 
Yes, that's the menu I'm talking about. I was hoping there would be a way to make one of the options in that list a different color.

Oh, and I figured out the issue I was having with the hidden moves, thanks.

When you add the command to the menu, just include the color as well so it'd be a version of
Code:
<c=ffffff> text </c>
You can find the full list of options (broken link removed)

Rather use something like
random=value1+(value2-value1+1) where value2 is the higher number.

This would get the values between x and y rather than 25 and 31

His example was between 25 and 31 but yes the generic version would be
x + random(y - x + 1) where y is the larger number.
 
When you add the command to the menu, just include the color as well so it'd be a version of
Code:
<c=ffffff> text </c>
You can find the full list of options (broken link removed)

I've actually tried this before, but it hasn't worked for me. It just ends up displaying it as text, like this (trying to make it blue, for example):
[PokeCommunity.com] A few simple questions that I'm stumped on...


I tried moving the code outside of the quotation marks to see if that does anything, but it just returns an error and the game won't load.
 
Back
Top