array set all number one function

Get help using Construct 2

Post » Sun Sep 24, 2017 3:01 pm

hi guys! my problem is array set

Image

"set value at (0,1,2,3,...) to tokenat..."

I want a single function for all numbers.
B
3
Posts: 3
Reputation: 181

Post » Sun Sep 24, 2017 3:13 pm

My brain hurts when I look at your screenshot :)
You mean something like this?
Code: Select all
AJAX On "playeritem" completed
   For "x" from 0 to tokencount(AJAX.lastdata,"<br>")
       Stores -> Push (back) tokenat(AJAX.lastdata, loopindex, "<br>")


This will feed all strings from the AJAX.lastdata into your array.
Check out my awesome game Doptrix
B
17
S
9
G
50
Posts: 829
Reputation: 27,967

Post » Sun Sep 24, 2017 4:32 pm

dop2000 thanks

but

item = instance veriable

and

item = set animation frame

AJAX.lastdata for ???

int(tokenat(stores.at(1,2,3,4,5),2,","))

how to distribute?
B
3
Posts: 3
Reputation: 181

Post » Sun Sep 24, 2017 5:14 pm

Do the same.
Code: Select all
For "x" from 0 to (stores.width-1)
  Item -> Inventory = Int(tokenat(stores.at(loopindex), 2, ","))
  Item -> Store= Int(tokenat(stores.at(loopindex), 1, ","))
      item -> set animation frame to Int(tokenat(stores.at(loopindex), 3, ","))
Check out my awesome game Doptrix
B
17
S
9
G
50
Posts: 829
Reputation: 27,967

Post » Sun Sep 24, 2017 5:23 pm

dop2000 thanks
I love You
B
3
Posts: 3
Reputation: 181


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 24 guests