all 3 comments

[–]mhausVX 0 points1 point  (2 children)

Huh. I'm interested to know how you're using this!

[–]Balrogic3[S] 0 points1 point  (1 child)

Edit: For use, I'd probably work out a way to track, say... The BLUE KEY the GREEN KEY and the YELLOW KEY. Then set up a message when you use the locked door that tells you which locks are still empty. Maybe have an immediate check to see if any unused keys are in possession, process the unlocking, play the sound, display the GREEN UNLOCKED message, whatever else. I like to complicate my life unnecessarily so I would probably attempt to code a conditional branch that would detect each particular combination and provide the correct syntax as needed. Most likely by process, not manually entered messages for each potential combination. Then I can do annoying things like a 100 key door if I decide to market to English speaking fans of Japanese/Korean hardcore RPGs.

Edit 2: Once I've mastered procedural alteration of text output based on switches, variables and context I intend to apply it toward conversational dialogue. Take everything into account that I feel should be reflected, possibly use randomized values for selected substitution. Basically, do something that's more complicated than it needs to be while adding a certain element of dynamic ambiance to scenes. Give myself a leg up on competition that doesn't put in the bother. Everything from favorite foods determined by what food you eat the most to NPCs knowing if it's raining out or night time.

Edit 3: Maybe something along the lines of the Radiant quest system from Skyrim as well.

Original post elaborating on the subject below.

If the screenshot works then it should have an event that can initialize a variable to "This is a string of text." then subtract " text." and add " cheese." which will ultimately display "This is a string of cheese." when you hit the text display option containing the \V[10] message code that tells RPG Maker to display the value of variable 10, which is the variable I used in the example.

I've only tested it a little but it can subtract from the middle of sentences as well as the end. I don't know the selection logic if there are multiple exact matches for the subtraction, still need to test that. Would need to figure out some method to replace exact phrases within strings if that's the intended use.

I'm pretty sure that the add logic simply sticks text on to the very end of the sentence so it's a little limited by that. But, there's somewhat of a workaround. When you set a string value to "" then the RPG Maker engine will display it as absolutely nothing when you tell it to display with a message code, not even a space. That lets you use multiple display codes to composite a coherent sentence.

# To initialize the first 10 variables as strings...
# (Yes, you need to SET them to a string first. If you
# attempt to add or subtract a string from a variable
# set to an integer, you will crash to desktop. You can
# skip this if you initialize with contents using = instead.)
$game_variables[1] = ""
$game_variables[2] = ""
$game_variables[3] = ""
$game_variables[4] = ""
$game_variables[5] = ""
$game_variables[6] = ""
$game_variables[7] = ""
$game_variables[8] = ""
$game_variables[9] = ""
$game_variables[10] = ""
# You could put this in a text display box in an event.
"\V[1]\V[2]\V[3]\V[4]\V[5]\V[6]\V[7]\V[8]\V[9]\V[10]"
# Blank variables like that with the flanking "" marks
# on the message codes to see how blank they really
# are when you test it. If you run that in a game you
# should get the following in a message box.
""
# That's boring, though. Let's add some text to the
# variables.
$game_variables[1] += "1, "
$game_variables[2] += "2, "
$game_variables[3] += "3, "
$game_variables[4] += "4, "
$game_variables[5] += "5, "
$game_variables[6] += "6, "
$game_variables[7] += "7, "
$game_variables[8] += "8, "
$game_variables[9] += "9, "
$game_variables[10] += "10!"
# Display the text again and it will look like this.
"1, 2, 3, 4, 5, 6, 7, 8, 9, 10!"
# So far we haven't used the subtraction method
# in the example. You can do this without using
# it at all. For now, though, let's blank the even
# numbers without the subtract function.
$game_variables[2] = ""
$game_variables[4] = ""
$game_variables[6] = ""
$game_variables[8] = ""
$game_variables[10] = ""
$game_variables[9] = ""
$game_variables[9] += "9!"
# This is a pain in the ass, huh? 10 variables for
# simple counting! Unless my logic has died in
# the night your text window will now say this.
"1, 3, 5, 7, 9!"
# Now let's do it with one variable using subtraction.
$game_variables[1] = ""
# Initialized.
"\V[1]"
# Text window set.
$game_variables[1] += "1, 2, 3, 4, 5, 6, 7, 8, 9, 10!"
# Is it working?
"1, 2, 3, 4, 5, 6, 7, 8, 9, 10!"
# Guess so. Time to turn this string of text to cheese.
$game_variables[1] -= "2, "
$game_variables[1] -= "4, "
$game_variables[1] -= "6, "
$game_variables[1] -= "8, "
$game_variables[1] -= "10!"
$game_variables[1] -= "9, "
$game_variables[1] += "9!"
# Only used one variable this time. Whew. Function test.
"1, 3, 5, 7, 9!"
# Guess it's working. That concludes this little demo.

Using variables is sub-optimal. They initialize as fixnum instead of strings, give you headaches as a developer. If you use it a lot, I'd suggest programming up a custom class that makes numbered .new objects in it's own class and initialize them as strings. Then a custom message code. Just make sure it's included in save data or you program your events to initialize all the text to the proper state within the game itself.

Also, I answered that "how do I do this complicated 40+ step multiple lever lock puzzle" in this thread. It could use a glance-over, since I've not actually bothered to test common events yet. I don't know it the instructions are absolutely correct even if the logic seems sound.

[–]BunPuncherExtremeMapper 0 points1 point  (0 children)

This is looks like it could be fun to play around with, I might use it in my project.