Need Help with TextBox Quickly

Get help using Construct 2

Post » Thu Jan 26, 2012 1:32 pm

Hi guys i got a huge problem. I'm doing a game like RPG but is like a question and answer game. The problem is that i need to get the text from the text Box for that i use an instance variable called Valor in the same Text Box called Respuesta. So i set the value from Valor with the expression Respuesta.Text it should work but it doesn't i tried to set some random Text in the value and it worked could u guys help me? down here is an image so u can be lost

Ahora
http://imageshack.us/photo/my-images/19/ayuda1d.png/

Antes
http://imageshack.us/photo/my-images/207/ayuda2u.png/
eage2012-01-26 13:37:48
B
3
Posts: 13
Reputation: 326

Post » Thu Jan 26, 2012 1:36 pm

I'm not sure I follow your problem exactly, but you may need to include "str(your words here)" in the event to get a good result.

Can you post a capx otherwise?

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
45
S
17
G
37
Posts: 2,853
Reputation: 25,966

Post » Thu Jan 26, 2012 1:41 pm

i could but the game is in spanish i i put the image link's i and here is the capx

http://www.mediafire.com/?owxz9ef36x2b3oj
B
3
Posts: 13
Reputation: 326

Post » Thu Jan 26, 2012 4:03 pm

did you see it? the problem is in event sheet 3
B
3
Posts: 13
Reputation: 326

Post » Thu Jan 26, 2012 4:31 pm

i try what you said but it seems it doesn't workby the way i'm looking the result in a Text
B
3
Posts: 13
Reputation: 326

Post » Thu Jan 26, 2012 4:40 pm

I'm new to this, and not 100% sure I'm tracking your issue. Shouldn't your final line be Text -> set text to Valor

Your current code looks like it's setting it to the Respuesta.valor (which is your textbox.Var).Cstix2012-01-26 16:42:08
B
7
Posts: 15
Reputation: 756

Post » Thu Jan 26, 2012 4:48 pm

Well the idea is to first get the value from the TextBox then called it with Respuesta.Valor so i can see if i capture the value, the strange thing is when i put a random text into the value directly in the code i mean for example

Set Valor to "Random"

The Text below show Random too but if i use the var it didn't work
B
3
Posts: 13
Reputation: 326

Post » Thu Jan 26, 2012 5:41 pm

The problem you have comes from the fact that you have 2 Respuesta object on your layout: the one you placed at edit time, and the one you create on collision with Aciano.
As there's no way to know which one to pick, c2 pick the first one.

The solution:
on start of layout -> Respuesta: DestroyYann2012-01-26 17:41:29
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Sun Jan 29, 2012 10:11 pm

thank you i will test it
B
3
Posts: 13
Reputation: 326


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 20 guests