How do I look for an item in array? My capx is not working.

Get help using Construct 2

Post » Tue Apr 04, 2017 12:41 pm

Hi guys! It's the first time I write in this forum, so hello everyone :)

I need some help for my project. I'm creating a crafting system for a Live RPG, I will embed it in our website. It should work like this:
- load a csv file in a 2d-array
- the user put a code in a text box, then press a button
- when the button is clicked, append in a text the index of textbox.text, usign array.indexof(textbox.text).
(this is a troubleshooting version, missing all the feature I really need, but that's another story).

Image

The problem is: if I type the first element in the array, the index returned is correct (0), for every other object I get -1. There is something I'm not understaing, can anyone help me with this?
If you're so kind to take a look, this is the link: https://www.dropbox.com/sh/x4epahrtx2p5 ... 2XQHa?dl=0

Thank you!
B
3
Posts: 2
Reputation: 179

Post » Tue Apr 04, 2017 2:01 pm

B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

Post » Wed Apr 05, 2017 7:41 am

Thank you very much Korbaach, you saved my day. So the problem was in the file loading? I still cannot figure out (yes, I must be dumb).
B
3
Posts: 2
Reputation: 179


Return to How do I....?

Who is online

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