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
169
S
50
G
170
Posts: 8,292
Reputation: 108,728

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
23
S
13
G
135
Posts: 871
Reputation: 70,345

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
23
S
13
G
135
Posts: 871
Reputation: 70,345


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 8 guests