tokenat, global var & function problem

Discussion and feedback on Construct 2

Post » Mon Apr 21, 2014 3:24 am

Yo,

I'm fighting with one function call. Basically I'm using tokenat to get global variable, and send its value to function. But it doesn't work! The variable is not being called ( as it's being taken as a string). Don't know if it's a bug or by the design - can anyone help?
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
89
S
30
G
22
Posts: 1,985
Reputation: 20,099

Post » Mon Apr 21, 2014 3:53 am

I've had similar weird frustrations in the past but I've not encountered this one. Try creating a local variable and first assign it the token-at value before then passing the local variable in the function call? Ie no text calcs inside the function call command. Hopefully might help you...
A big fan of JavaScript.
B
74
S
20
G
69
Posts: 2,205
Reputation: 43,832

Post » Mon Apr 21, 2014 3:58 am

Colludium wrote:I've had similar weird frustrations in the past but I've not encountered this one. Try creating a local variable and first assign it the token-at value before then passing the local variable in the function call? Ie no text calcs inside the function call command. Hopefully might help you...


Thanks, but I've tired that already and with no luck. :/
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
89
S
30
G
22
Posts: 1,985
Reputation: 20,099

Post » Mon Apr 21, 2014 6:07 am

Can you post a sample? I've tried this, as I understand it, and it works as expected.
You do not have the required permissions to view the files attached to this post.
ImageImageImage
B
71
S
21
G
230
Posts: 3,688
Reputation: 128,852

Post » Mon Apr 21, 2014 12:25 pm

blackhornet wrote:Can you post a sample? I've tried this, as I understand it, and it works as expected.


Thanks, but I'm still using r163.

Here's the screenshot of the calls. If you need capx, I can pm it to you.
Untitled-1.jpg
You do not have the required permissions to view the files attached to this post.
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
89
S
30
G
22
Posts: 1,985
Reputation: 20,099

Post » Mon Apr 21, 2014 1:42 pm

tokenat is a text expression. Use int(tokenat()) if it needs to be (is) an integer.
ImageImageImage
B
71
S
21
G
230
Posts: 3,688
Reputation: 128,852

Post » Mon Apr 21, 2014 1:49 pm

blackhornet wrote:tokenat is a text expression. Use int(tokenat()) if it needs to be (is) an integer.


I did try that too, but it doesn't work either.
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
89
S
30
G
22
Posts: 1,985
Reputation: 20,099

Post » Mon Apr 21, 2014 1:56 pm

As long as your ItemDat_Stat is correctly formatted, it should work fine.
You do not have the required permissions to view the files attached to this post.
ImageImageImage
B
71
S
21
G
230
Posts: 3,688
Reputation: 128,852

Post » Mon Apr 21, 2014 2:01 pm

blackhornet wrote:As long as your ItemDat_Stat is correctly formatted, it should work fine.


Still can't open the capx. It says it was saved in 167.2.
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
89
S
30
G
22
Posts: 1,985
Reputation: 20,099

Post » Mon Apr 21, 2014 2:14 pm

@megatronx,

Screenshot of blackhornet capx.

It does work.
You do not have the required permissions to view the files attached to this post.
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,708

Next

Return to Construct 2 General

Who is online

Users browsing this forum: Lof, mihirolover and 2 guests