GameMaker 2 Variables Turn into 1 Help

T

TurtleBitAlex

Guest
Hello
Im trying to make a system so that i can turn two variables into one
Sorta like this
R1E=1
R2X=3
R1EX = R1E And R2X
===================
R1EX = 13
===================
or another example
R1E=5
R2X=9
R1EX = R1E And R2X
====================
R1EX = 59
====================

Anyone know of any way to do this
thanks
I use game maker Studio 2 on windows in case you need to know
 
EDIT: Irrelevant

Uh. That's just not how variables work. Sorry buddy. However, you can probably use strings.

R1E = string(1);
R2X = string(3);
R1EX = R1E + R2X;

R1EX = real("13");

Or if you're okay with them staying as strings, just do the same thing you're already doing and add quotations.
 
Last edited:
M

Matt Hawkins

Guest
@Matt Hawkins Unless I'm really confused, that will add the values. R1EX will equal 4. He wants to stick them together in order.

Uh. That's just not how variables work. Sorry buddy. However, you can probably use strings.

R1E = string(1);
R2X = string(3);
R1EX = R1E + R2X;

R1EX = real("13");

Or if you're okay with them staying as strings, just do the same thing you're already doing and add quotations.
Yeah I didn't read the question properly sorry :)
 
E

elementbound

Guest
i just dont understand the mystical magic behind 1*var ?
Badly illustrating the concept :D It's really just saying that you start from the right side with one, and add a zero behind it for every variable you want to merge. See the above example with three variables, you go from 1 to 10 to 100.

Otherwise, you can leave the *1 out, it does nothing.
 
Z

zendraw

Guest
Badly illustrating the concept :D It's really just saying that you start from the right side with one, and add a zero behind it for every variable you want to merge. See the above example with three variables, you go from 1 to 10 to 100.

Otherwise, you can leave the *1 out, it does nothing.
it was a rhetorical question :)
 
Top