How do I do this working??

Get help using Construct 2

Post » Tue Dec 30, 2014 3:25 pm

Hello have done a formula, http://postimg.org/image/knskyjy7v/#codes
but this formula is not working
my variable 4 is 40 i added to the textbox

when the user enter 40, in the text box, then object do "something"
but its not working
if i add the others conditions, different, less, or greater, formulas works

but that formula if its equal to, is not working :s, can someone tell me why?
Last edited by imothep85 on Tue Dec 30, 2014 4:08 pm, edited 1 time in total.
B
34
S
13
G
6
Posts: 1,643
Reputation: 8,761

Post » Tue Dec 30, 2014 3:38 pm

Is your variable set as a string or a value? You maybe trying to compare "40" to 40 instead of "40" to "40" or 40 to 40.

If thats the case you need to convert one of them, so either a value to text str(40) or text to a value int("40").
B
43
S
22
G
20
Posts: 735
Reputation: 11,977

Post » Tue Dec 30, 2014 3:47 pm

all my variables are numbers values and the textbox is in "number" type
Variable not working http://postimg.org/image/knskyjy7v/#codes
My text object variables http://postimg.org/image/41gibtenz/
B
34
S
13
G
6
Posts: 1,643
Reputation: 8,761

Post » Tue Dec 30, 2014 4:12 pm

so definitly here it's something not working....
B
34
S
13
G
6
Posts: 1,643
Reputation: 8,761

Post » Tue Dec 30, 2014 4:28 pm

int(Textbox.Text) to convert the string back into a number.
ImageImageImage
B
71
S
21
G
220
Posts: 3,646
Reputation: 123,721

Post » Tue Dec 30, 2014 5:07 pm

thanks blackhornet, again you :D XD
B
34
S
13
G
6
Posts: 1,643
Reputation: 8,761

Post » Tue Dec 30, 2014 5:10 pm

And how to do thi
if i want to compare the int(Textbox.Text) to any variables stored in TextBox.Variable4 how to do that because i have a lot of variables
B
34
S
13
G
6
Posts: 1,643
Reputation: 8,761


Return to How do I....?

Who is online

Users browsing this forum: iceangel, SERG 04 and 3 guests