Storing Message "text" Variable In String

● ARCHIVED · READ-ONLY
Started by krizmn 7 posts View original ↗
  1. I am trying to create a dynamic message system.

    For example:

    Var(25) = $gameVariable.value(100) + "Hello"

    This works fine. But I was wondering if you could also do this?

    Var(25) = "\V[100] Hello"
    Var(25) = "\\V[100] Hello"
    Neither of these seems to work.

    I suppose I am just trying access the \V[] call in the message system by storing it in a variable.

    Being able to do this I can organize and store all the messages into one variable that also stores other variables. Is this clear? Sorry it's really early and still waking up.
  2. Did you try using a lowercase v?
  3. Afaik, it only checks the escape codes of the original text, which is why saving \V[x] into a variable didnt work.

    Im assuming you're actually doing

    \V[25]

    on the text box command to show the text saved in variable 25, and your first setup works (shows value of variable 100) but the 2nd/3rd doesnt.
  4. Ok, I'll try to explain better now that I am awake. lol

    I am trying to store message commands into a string(variable) and then use it in a message dialogue.

    For example: $gameVariables.setValue(100, "/C[10]Hello, I am awake!");
    Then in the message box I can just place /V[100]. So this works, except for the message commands I have tried // and other techniques, but I can't seem to get it to work.

    Another option would be to just completely script the entire message system, but I think I had issues in the past with it. Like the message box would appear, but if there was a choice box, then the message box would go away.

    *If we(community) can get this to work; I believe we can have cleaner, more organized, and dynamic dialogue structures. Also it would be very easy to save dialogue to a text file and load it. It's just these damn message codes I need to get to work lol.
  5. Because you are running a script call in a game interpreter, which doesn't have convertEscapeCharacter method from the window base.

    \V[id] and the rest of escape code only work inside a window. If you are trying to access it, use \x1bV[id] instead. Then again, it will only work if you put it inside the message box to be converted.

    ex :
    Code:
    $gameVariables.setValue(1, 666);
    $gameVariables.setValue(2, 'Variable 1 = ' + '\x1bV[1]');
    Then put \V[2] inside the event show text. It will show Variable 1 = 666.

    P.S. for some reason I can't upload a pic to show as an example.
  6. I am having trouble getting it to work. So do I put \x1bV[id] in the variable string?


    *EDIT*Yep, you are right. It works perfectly. I was using a color code instead of variable. Right on. This is awesome!
  7. Last question, and thanks for the help. Where did you find the x1b?

    *Edit* rpg_windows

    This is pretty awesome. :) Thanks again!


    *For those that have heavy dialogue in their game and use a lot of the message codes; this is a LIFE SAVER! It also allows you to organize everything outside of the message system. On top of that, you can customize and control choice options 100x easier, even with the plugins out there.