Variable To String

EDIT!

I am now using this to get my 2 digit number. It is still the same number system, but instead of using conditional branches im just changing variable via math.

[IMG]http://i.imgur.com/HURkNsK.png[/IMG]

Old Text

Spoiler
Okay, so I  have a JOB board. I want the job board to select 1 of 5 jobs, and 1 of 10 names. I then want it to combine the name with the job. Is this possible?

So far I have all of the variables in number format.

Variable - Job1Part2 = 34 then name 4 wants you to do job 3.

for that example it would be "Joe" + " Wants you to kill three Fire Slimes!"

The variables I am using are...

Job1, Job2, Job3, Job4, Job5, Name, Job1Part2, Job2Part2, Job3Part2, Job4Part2, Job5Part2

Each one chooses a job:

Variable Job1 =Random 1-5Variable Name =Random 1-10Variable Job1Part2 =((Job-1)*10)+NameThat allows a specific name per job.

Is there any way I can do an easy check for this number?

such as:

if Name = 4Then Name = "Joe"&If Job1 = 3Then Job1 = " wants you to kill three Fire Slimes!"so Job1Part2 = "Joe wants you to kill three Fire Slimes!"
Spoiler
[IMG]http://i.imgur.com/8EaGVoy.png[/IMG]
I would like a System that can give me a huge variance in "Jobs"
So far as seen in Picture 1 I have a basic Common Event that is called. It will run another Common Event (Picture 2) which will check if a job is in progress.
If a job is in progress then it will not be randomized. If the job has not been taken then it will Re-Randomize the Jobs. (Picture 3 & 4)

Here is the current variable list I have set up.

Variables Job1 - Job5
Variables Job1Part2 - Job5Part2
and Variable Name.

It will choose a random mission out of 5 missions, and a random name out of 10 names.
That gives each of the five different jobs 50 unique missions per job.

Job1 has its own jobs
Job2 has its own jobs
Job3 has its own jobs
etc...

That gives me a total of 312,500,000 different variations.

My question is "Instead of using 312.5 million conditional branches how can I make a Show choices listing Text that is defined by a Variable?"

Example:

random generator chooses 34.
3 is the mission while 4 is the name.
The name '4' stands for "Joe" while the mission 3 stands for " Wants you to kill three Fire Slimes!"
so I would want the Show Choices menu to show "Joe wants you to kill three Fire Slimes!"

Is this possible and how would it be done?
I'm not completely clear on what your trying to do, just to connect the text, or to save what the quest is, but these two things could help you.

http://www.w3schools.com/js/js_variables.asp

http://www.w3schools.com/js/js_arrays.asp
Spoiler
[IMG]http://i.imgur.com/8EaGVoy.png[/IMG]
Alright, this should help me explain better.

There is an image above of the current layout.

I would like a System that can give me a huge variance in "Jobs"

So far as seen in Picture 1 I have a basic Common Event that is called. It will run another Common Event (Picture 2) which will check if a job is in progress.

If a job is in progress then it will not be randomized. If the job has not been taken then it will Re-Randomize the Jobs. (Picture 3 & 4)

Here is the current variable list I have set up.

Variables Job1 - Job5

Variables Job1Part2 - Job5Part2

and Variable Name.

It will choose a random mission out of 5 missions, and a random name out of 10 names.

That gives each of the five different jobs 50 unique missions per job.

Job1 has its own jobs

Job2 has its own jobs

Job3 has its own jobs

etc...

That gives me a total of 312,500,000 different variations.

My question is "Instead of using 312.5 million conditional branches how can I make a Show choices listing Text that is defined by a Variable?"

Example:

random generator chooses 34.

3 is the mission while 4 is the name.

The name '4' stands for "Joe" while the mission 3 stands for " Wants you to kill three Fire Slimes!"

so I would want the Show Choices menu to show "Joe wants you to kill three Fire Slimes!"

Is this possible and how would it be done?
Well, you can show variables as strings in text by using the \v[x] shortcut in messages and choices. If you set the variable to a string, it can be displayed this way in the text message box.

You can set a variable to a string by using the Control Variables option, and select "script" as the operand. Inside the script box, you put quotation marks around the string you want to set the variable to.

For instance, if job1 is 3 (or whatever,) and that equals kill fire slimes, then you would make a conditional branch that says "if job1 = 3, set variable job-name1 to = "Kill fire slimes" under the script operand. Then, you would create a message that would say "\v[iD of Job-Name1]"

This should also work in the choices. If you want two variables to come together in a choice, just put a choice that says "\v[iD] \v[iD]" and both of them will show up together in the choice box. You can also add two variables' strings together into one string if you wanted, by using the control variable script operand. I'm not sure on the syntax, but you would essentially be adding variable 1's value to variable 2, setting that equal to variable 3.

I hope this is what you were asking for!

Edit: Here:

Spoiler
variablestring.PNG

variablestring2.PNG

In the control variable #3 I put in the script box

$gameVariables.value(2)+" wants you to "+$gameVariables.value(1)

In the parenthesis, is the Id of the variable value you are using. I added a string to it that is " wants you to " and made sure to put spaces inside the quotes so spaces would be between the words and the variable strings. :]
Well, you can show variables as strings in text by using the \v[x] shortcut in messages and choices. If you set the variable to a string, it can be displayed this way in the text message box.

You can set a variable to a string by using the Control Variables option, and select "script" as the operand. Inside the script box, you put quotation marks around the string you want to set the variable to.

For instance, if job1 is 3 (or whatever,) and that equals kill fire slimes, then you would make a conditional branch that says "if job1 = 3, set variable job-name1 to = "Kill fire slimes" under the script operand. Then, you would create a message that would say "\v[iD of Job-Name1]"

This should also work in the choices. If you want two variables to come together in a choice, just put a choice that says "\v[iD] \v[iD]" and both of them will show up together in the choice box. You can also add two variables' strings together into one string if you wanted, by using the control variable script operand. I'm not sure on the syntax, but you would essentially be adding variable 1's value to variable 2, setting that equal to variable 3.

I hope this is what you were asking for!

Edit: Here:

Spoiler
[IMG]http://forums.rpgmakerweb.com/public/style_images/RPGW_33_Images/attachicon.gif[/IMG]variablestring.PNG

[IMG]http://forums.rpgmakerweb.com/public/style_images/RPGW_33_Images/attachicon.gif[/IMG]variablestring2.PNG

In the control variable #3 I put in the script box

$gameVariables.value(2)+" wants you to "+$gameVariables.value(1)

In the parenthesis, is the Id of the variable value you are using. I added a string to it that is " wants you to " and made sure to put spaces inside the quotes so spaces would be between the words and the variable strings. :]
Thank you soooo much <3<3<3

Like really.... thank you a million times.

I was able to get my randomized mission board up and running thanks to you!

You shall be in deh credits for Tech Support :3

Image of end result.

Spoiler
[IMG]http://i.imgur.com/nXbNmmM.png[/IMG]
Glad I could help-- good luck with your project 🙂

Original thread: https://forums.rpgmakerweb.com/threads/variable-to-string.54551/