How to get a particular value from an array value?

0 favourites
  • 3 posts
From the Asset Store
Array Editor
$1 USD
80% off
Supports 1D, 2D, 3D arrays. Import and export arrays in JSON format
  • Example:

    Matriz xyz = [0,0,"Player=2 x=100 y=200"]

    I can extract specific elements of this value such as: x=100 or y=200 or Player

    I want to create a sprite using these coordinates.

    For me it is not possible to put this value in each space of the array.

    PTBR/ENG translate

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If I understand correctly I would just set the array value to “100,200,Player”

    Create object by name of <tokenat(arrayXYZ, 2, “,”)> at location <tokenat(arrayXYZ, 0, “,”)> and <tokenat(arrayXYZ, 1, “,”)>

    Hopefully that makes sense?

  • If I understand correctly I would just set the array value to “100,200,Player”

    Create object by name of <tokenat(arrayXYZ, 2, “,”)> at location <tokenat(arrayXYZ, 0, “,”)> and <tokenat(arrayXYZ, 1, “,”)>

    Hopefully that makes sense?

    That's exactly what I was looking for!

    I am creating a dialog system with array, and wanted to create specific actions for a single value.

    Ex:

    [0,1,"dialogue|Player|years"]

    Could use X Y Z in the array, only they are already busy.

    Thanks for helping me!

    Translated PT-BR / ENG

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)