Tokenat problem

Discussion and feedback on Construct 2

Post » Tue Aug 09, 2016 8:44 am

I'm trying to read a value from a global variable with this value ("0,0,0,3") using tokenat but always return 0, here is the code.

Image

What i'm doing wrong? (The token count works fine)
B
6
Posts: 11
Reputation: 270

Post » Tue Aug 09, 2016 8:51 am

Its zero based.
Image ImageImage
B
172
S
50
G
183
Posts: 8,440
Reputation: 115,599

Post » Tue Aug 09, 2016 9:01 am

even if it's zero based, tokenat("0,0,0,3",3,",") should return "3" @newt

@alguillenar which version of C2 do you use?
Image Image
B
26
S
15
G
142
Posts: 881
Reputation: 74,060

Post » Tue Aug 09, 2016 9:04 am

I use the latest version

Edit: I found the error, the variable was reset few lines before :lol:
B
6
Posts: 11
Reputation: 270

Post » Tue Aug 09, 2016 9:22 am

That's why I can't reproduce
Image Image
B
26
S
15
G
142
Posts: 881
Reputation: 74,060


Return to Construct 2 General

Who is online

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