issues with tokenat

Get help using Construct 2

Post » Fri Nov 29, 2013 12:00 pm

Hey guys,

Having a few issues with tokenat. Please see the capx.

dropbox.com/s/ogfffbexvc0uicd/tokenat.capx

In event sheet 2, any reason why Array.At(0) is not being set to 5.

thanks :)
B
1
Posts: 5
Reputation: 135

Post » Fri Nov 29, 2013 1:15 pm

Because Array.At(0) is 0 when you set text 2. You set array.at(0) to 5 only after that.
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786

Post » Fri Nov 29, 2013 1:23 pm

I'm setting it to text3

if you don't use tokenat this issue doesn't happen.
weird. gautamsingh2013-11-29 13:26:13
B
1
Posts: 5
Reputation: 135

Post » Fri Nov 29, 2013 1:43 pm

In event sheet 2 there is no tokenat, but now I see what you meant.

Encapsule the tokenat expression with int() or float(). This will convert the string "0" to the number 0 (int will round to whole numbers, float will keep decimals)
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786

Post » Fri Nov 29, 2013 2:51 pm

I like the sound of that. Away from my desk so can't test. Is it working for you? Thanks a lot.
B
1
Posts: 5
Reputation: 135

Post » Fri Nov 29, 2013 3:00 pm

Yes it works.
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786

Post » Fri Nov 29, 2013 3:11 pm

Nice. Have to say I'm really impressed with construct. Going to get a license asap. Thanks for the help.
B
1
Posts: 5
Reputation: 135

Post » Sat Nov 30, 2013 8:39 am

yep it works. cheers mate.
B
1
Posts: 5
Reputation: 135


Return to How do I....?

Who is online

Users browsing this forum: Google [Bot], newt, Yahoo [Bot] and 9 guests