stymphalian's Recent Forum Activity

  • I have a 2d array with one field on each axis, so my X axis is "name" and Y axis is "ID". I fill the list with items in the X axis. So my list is a list of names. I'd like to assign to a variable, the value of the Y axis related to the X element selected in the list, but I'm having some trouble with it.

    EX: The value in index 0 of the list is the value in index 0, Axis X of the Array. and so on. When selecting an item in the list, I'd like to assign to var the value of the Y axis related to that X element in the array.

    I dont know if I made myself clear, I'm a little confused right now.. lol

  • Nevermind man! Just figured it out. Thanks!

  • Retrieve it all in one query and use a seperator in between every bit of data. You set that in the php script. As an example i will use "|" as a seperator.

    The line in php would look something like this:

    echo $row["index1"] . "|" . $row["name1"] . "|" . $row["index2"] . "|" . $row["name2"] . "|" ;

    Then in Construct2 you use: system > set variable > (tokencount(AJAX.LastData, "|")

    This will count the pieces of data seperated of by the "|"

    Then just set the size of the array with that variable.

    Thanks a lot man, that's exactly what I did, after hours of searching around. Really thanks. Now if you could help with one more thing: I created a dropdown list with the array generated with the query, but how do I assign the value of the selected item in the list to a variable? Please, if you could help me with this too, it would be much appreciated!

  • Hi there! I want to retrieve the records from a table (ex:index1, name1, index2, name2, etc) and load it in an array and then put it in a dropdown list like: name1, name2, etc).

    And I don't know how much records will be in the table so I retrieve it through a query and set a global variable in construct to know how much records will I have to show.

    I tried using loops and ajax requests but I'm totally lost and I need it desperately to work.

    Anyone can help me, please!?

  • Add the custom movement behavior. The use "Accelerate towards position" and configure it with the acceleration that you want and set the coordinates. You can place an invisible sprite at the stop position and create a condition -

    Object on Collision with Sprite > Set Custom Movement to Stop.

    Thanks! Gonna try that!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hi everybody,

    I'd like to know how do I use custom movement to accelerate towards a position and stop at that position, please.

    Thanks!

stymphalian's avatar

stymphalian

Member since 23 Apr, 2015

None one is following stymphalian yet!

Trophy Case

  • 9-Year Club
  • Email Verified

Progress

10/44
How to earn trophies