Text Based game

Get help using Construct 2

Post » Thu Jan 19, 2012 4:18 pm

I am attempting to create a text-based gmae. It is suppose to feel like you are using a DOS or Shell-like prompt. However the trouble I am running into is that I cannot seem to get the text to scroll down. After so many lines the screen is full and unable to accept any new lines.

My current workaround is I created a seperate textbox for every line, with a variable for each line. when the user inputs text the game creates a cascade or domino effect to simulate text scrolling like it would in a DOS or Shell prompt.

Although this workaround works per-say, it's not ideal and it makes thing more complicated then they really need to be.

I'm sure this is a silly question but is there a better way. I've not found anything on the searches but maybe I'm looking for the wrong thing.

Thnak you
B
4
S
1
Posts: 5
Reputation: 785

Post » Thu Jan 19, 2012 4:39 pm

I was wondering the same thing...   What is the character limit for a text box?
B
192
S
6
G
7
Posts: 213
Reputation: 10,178

Post » Thu Jan 19, 2012 5:17 pm

@Zetar

The Textboxs seem to have the limit based on the size/font used. Not really running into a character limit.

On an update by the recommendation of a friend I have switched from variables to an array for holding line values.
B
4
S
1
Posts: 5
Reputation: 785

Post » Thu Jan 19, 2012 11:24 pm

consolStuff.capx

doesn't handle text horizontal overflow (might want to add character clamping maybe...)
but scrolling works nicely
Last edited by Yann on Sun Sep 14, 2014 9:54 pm, edited 1 time in total.
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Tue Jan 24, 2012 4:48 pm

Thank you, that's exactly what I was trying to get to happen.

Honestly I'm not sure how the scrolling system works, is it checking the size and resizing the box as needed to scroll?

Thank you again.
B
4
S
1
Posts: 5
Reputation: 785

Post » Tue Jan 24, 2012 6:24 pm

Actually it simply deletes the first line as long as you exceed the line limit (:
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Tue Jan 24, 2012 7:07 pm

That's perfect. I'm in the process of adapting what you've shown me. It's like 1/10th the size of what I ended up doing to get it to work. Thanks again.

May I ask why you didn't just put the input box outside the visable box like you did with the cursor on the layout page?
B
4
S
1
Posts: 5
Reputation: 785

Post » Tue Jan 24, 2012 7:29 pm

'cause you can't get the focus on the textbox if it's either invisible or out of screen.
You could replace the textbox object with a text variable and the keycode plugin maybe, but I didn't want to use a third party plugin for my example. So I had to stick to the textbox even if I had to let appear a bit on the bottom of the window.
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Tue Jan 24, 2012 7:31 pm

That works, thanks again!
B
4
S
1
Posts: 5
Reputation: 785


Return to How do I....?

Who is online

Users browsing this forum: YoHoho and 13 guests