• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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.

[Scripting Question] how to change text color with variable

153
Posts
4
Years
    • Seen Feb 4, 2020
    So I asked for it before somewhere else but I'll make my own thread because I can't solve this.

    I want the player to chose the text color when his/her character speaks. So I made an event which is asking this to the player then stores the answer in a variable (assigning the numbers corresponding to colors in text \C[X])

    However calling
    Code:
    \C[pbGet(X)]
    doesn't work and
    Code:
    \C[\v[X]]Blablabla
    is giving \C[1]Blablabla instead of Blablabla in blue.

    I thought I might look how \pg and \pog was defined to create my own function but I can't find them in the script.

    Plz do you have a clue?
     
    153
    Posts
    4
    Years
    • Seen Feb 4, 2020
    Solved

    by adding these lines in the Message script section

    Code:
      text.gsub!(/\\[Hh]/,"\\C[1]") if pbGet(60)==1
      text.gsub!(/\\[Hh]/,"\\C[3]") if pbGet(60)==3
      text.gsub!(/\\[Hh]/,"\\C[5]") if pbGet(60)==5
      text.gsub!(/\\[Hh]/,"\\C[6]") if pbGet(60)==6

    now when i start the text with \h or \H or /h or /H the text is in the color defined here above depending on variable 60
     
    Last edited:
    Back
    Top