Enter Initials help

Get help using Construct 2

Post » Thu Jun 30, 2016 3:51 am

Hello, having some trouble here.

I'm trying to create an "Enter Initials" dialogue. I can get it to increment through the alphabet once, but it doesn't continue to increment!

Every time I click the arrow, I want it to increment the alphabet, example ( click arrow, set text A, click arrow, set text B, etc )


In my example, it increments just once, then never increments again.. So I click the arrow it goes to Z, then it doesn't increment when I click anymore.
Any help is greatly appreciated.
Last edited by Wolph on Fri Jul 01, 2016 4:26 am, edited 1 time in total.
B
8
S
1
Posts: 28
Reputation: 906

Post » Thu Jun 30, 2016 5:42 pm

You might have to reset your index at the end of the alphabet for it to "loop."
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
23
S
6
G
1
Posts: 1,419
Reputation: 4,857

Post » Thu Jun 30, 2016 11:12 pm

Thank you for the response, I'm not sure I understand how to do that, here's an example of whats happening.


I would like it to continue, rather than halting completely at Z, or 26, the end index.

So it kinda works, halfway there! Any suggestions?
Last edited by Wolph on Fri Jul 01, 2016 4:26 am, edited 1 time in total.
B
8
S
1
Posts: 28
Reputation: 906

Post » Thu Jun 30, 2016 11:24 pm

I do not understand the loop you make.

Just use a variable 'position'.
The character is now mid(alphabet,position,1)
Add 1 to postion on every click on the right arrow
Substract 1 to postion on every click on the left arrow
if position < 0 set postion to 26
if postion > 26 set position to zero

Your loop always ends on the 'Z', it loops them all on every click on the arrow and on every click on the arrow it ends on the Z.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Fri Jul 01, 2016 3:30 am

Thanks for the reply, that looks like a good solution, thank you!
B
8
S
1
Posts: 28
Reputation: 906


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 10 guests