Hundreds of features to explore
Games made in Construct
Your questions answered
Popular & trusted by schools and Universities world-wide
Construct 3 runs in the browser & works offline
Students do not need accounts with us
Our educational partners
Free education resources to use in the classroom
World class complete documentation
Official and community submitted guides
Learn and share with other game developers
Upload and play games from the Construct community
Game development stories & opinions
I want to search value in array.
I have this array and I want find PlayerSkin* (Idk first value have what number) (In my array It is 8)
I need to Result: 2 (Value's array X)
My Array Data
Capx : https://www.dropbox.com/s/cbyduqoj6cuob ... .capx?dl=0
You don't need regex. You can use expressions like left, right, find, mid etc.
Thanks for answer but "result = 5" I need it "result = 2"
I need like this way
I need find the first matching element not last
Develop games in your browser. Powerful, performant & highly capable.
It finds all results - 2, 3, 4, 5
If you want to stop after the first element found, change the loop to this:
For x=0 to Array.width-1
.... left(Array.at(loopindex), 10)="PlayerSkin" -> set result to loopindex
.... -> Stop loop
OK Got it. Thank you
.CurValue, CurX and similar expressions only work with "Array-For Each element" loop. (But Array-For Each loops can't be stopped)
When you are using System-For loop, those expressions don't work.
You need to use Array.At() as in my example above.
I fixed it. Thank you again. It is stopping when find first value.