As a basic question, I'm asking how to add data to text, like
$game_variables[3] = 5$game_variables[1] = ""$game_variables[1] += "Eagle number \$game_variables[3]"in hopes of having the variable equal
"Eagle number 5"
instead of "Eagle number $game_variables[3]".
For a longer explanation, I'm using a variable HUD script http://www.rpgmakervxace.net/topic/2302-xs-variable-hud/
(script not relevant), and say that I have a system for different things like time of day, month, day of week, or any other use I'd have for this function.
Let's say I have variable 35 "Day of Week Name", variable 36 "Month Name" variable 37 "Day", and variable 38 "Days in the Story",
which variable 35 = "Monday", variable 36 = "March", variable 37 = 8, and variable 38 = 36
Now let's do the process for variable 1 "Display #1" --
$game_variables[1] = ""$game_variables[1] += "\$game_variables[35], "$game_variables[1] += "\$game_variables[36] "if $game_variables[37] == 1 then $game_variables[1] += "\$game_variables[37]st" elsif $game_variables[37] == 2 then $game_variables[1] += "\$game_variables[37]nd"elsif $game_variables[37] == 3 then $game_variables[1] += "\$game_variables[37]rd"else $game_variables[1] += "\$game_variables[37]th" end$game_variables[1] += " (Day \$game_variables[38])" I'm wanting it to look like
Monday, March 8th (Day 36)
but instead it looks like
$game_variables[35], $game_variables[36] $game_variables[37]th (Day $game_variables[38])
(The same result also occurs if you do a test message: )
\V[1] Now, mind you, I know how to do this for final messages. I'm not asking about that.
If I wanted to do a finalized message, I could do
$game_message.add("Eagle number \\V[3]")and that would work, but I'm talking about editing a variable as a whole.
Edit-- Solved:
From reading http://learnrubythehardway.org/book/ex6.html
I have learned that in order to add data bits you do #{data}
So the solution would be
$game_variables[3] = 5$game_variables[1] = ""$game_variables[1] += "Eagle number #{$game_variables[3]}"
Which would translate to Eagle number 5.
Or if you did
$game_variables[3] = "Monday, the 3rd"$game_variables[1] = ""$game_variables[1] += "The final exam will be on #{$game_variables[3]}, at 2pm."That would translate to The final exam will be on Monday, the 3rd, at 2pm.
$game_variables[3] = 5$game_variables[1] = ""$game_variables[1] += "Eagle number \$game_variables[3]"in hopes of having the variable equal
"Eagle number 5"
instead of "Eagle number $game_variables[3]".
For a longer explanation, I'm using a variable HUD script http://www.rpgmakervxace.net/topic/2302-xs-variable-hud/
(script not relevant), and say that I have a system for different things like time of day, month, day of week, or any other use I'd have for this function.
Let's say I have variable 35 "Day of Week Name", variable 36 "Month Name" variable 37 "Day", and variable 38 "Days in the Story",
which variable 35 = "Monday", variable 36 = "March", variable 37 = 8, and variable 38 = 36
Now let's do the process for variable 1 "Display #1" --
$game_variables[1] = ""$game_variables[1] += "\$game_variables[35], "$game_variables[1] += "\$game_variables[36] "if $game_variables[37] == 1 then $game_variables[1] += "\$game_variables[37]st" elsif $game_variables[37] == 2 then $game_variables[1] += "\$game_variables[37]nd"elsif $game_variables[37] == 3 then $game_variables[1] += "\$game_variables[37]rd"else $game_variables[1] += "\$game_variables[37]th" end$game_variables[1] += " (Day \$game_variables[38])" I'm wanting it to look like
Monday, March 8th (Day 36)
but instead it looks like
$game_variables[35], $game_variables[36] $game_variables[37]th (Day $game_variables[38])
(The same result also occurs if you do a test message: )
\V[1] Now, mind you, I know how to do this for final messages. I'm not asking about that.
If I wanted to do a finalized message, I could do
$game_message.add("Eagle number \\V[3]")and that would work, but I'm talking about editing a variable as a whole.
Edit-- Solved:
From reading http://learnrubythehardway.org/book/ex6.html
I have learned that in order to add data bits you do #{data}
So the solution would be
$game_variables[3] = 5$game_variables[1] = ""$game_variables[1] += "Eagle number #{$game_variables[3]}"
Which would translate to Eagle number 5.
Or if you did
$game_variables[3] = "Monday, the 3rd"$game_variables[1] = ""$game_variables[1] += "The final exam will be on #{$game_variables[3]}, at 2pm."That would translate to The final exam will be on Monday, the 3rd, at 2pm.