gumshoe2029's Forum Posts

  • Well, I'll give you an example of how it works using rex's Hash plugin, since that is what we use to parse JSON.

    Suppose we have the JSON object:

    {"group1":{"object1":122,"object2":42,"object3":[98,47,12,9]},"group2":{"object4":[238,987,823,487],"object5":"this is a string","object6":true}}

    Then you import it into the hash object (which would be similar to loading it for a CSV object), and this parses the JSON into a JavaScript object. From there you call specific methods to access the data via a schema, like:

    Hash.At("group1.object3.3")

    This call would return: 9 (the indexes for arrays start at 0)

    also, you can call:

    Hash.At("group2.object5")

    which will return: this is a string

    You can also call bulk objects like:

    Hash.At("group1")

    which will return: {"object1":122,"object2":42,"object3":[98,47,12,9]}

    If I had to guess at how the API for the CSV plugin is configured, you would have a row number and a column number for identifying specific data points, like:

    2,45,34,66,32

    98,45,32,75,23

    4,5,23,556,323

    So you would have like:

    CSV.At(2,4) which would return 323 (assuming all indices start at 0)

  • Probably. I am not sure how though, as I have never worked with the SmartFox stuff.

  • I've never used the plugin from rex that you are using. What exactly are you trying to do with it? Just access the data?

  • Very nice Share your solution, so others can follow.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • SquareTx plugin only can get position along grids, it is not enough for RTS game.

    I guess I misunderstand the scope then. We are building an RTS game, and your squareTx in iso mode works fabulously for us.

  • You use both. The WebSocket object in C2 is the client side, and the SmartFox object is the server side.

  • You can use rexrainbow 's SquareTx plugin. It handles all of that stuff behind the scenes.

  • I feel like I am at a point of over-thinking what I am doing.

    This a common problem for me also, and one of the main reasons I always try to follow KISS (Keep It Simple & Stupid) methodology.

    Assuming I understand your problem correctly, you are trying to create links between specific animation frames for cards that match. You will probably need to store these relationships in a metadata object somewhere else (maybe a JSON array/object?) and then reference that object whenever you are trying to determine matches.

    Something like:

    [

    [0,2],[1,4],[6,3],... etc]

    where the numbers in this array of arrays are the animation frames in question.

    This is probably not organized well. Maybe you could even do a table like:

    0 1 2 3 4 5 6 7 ...

    0 x x

    1

    2

    3

    4

    5

    6

    7

    .

    .

    .

    then have some character that indicates whether the two animation frame indices are related. This would also prevent overlaps in your data.

    You might even be able to make this work in a simple 2-D construct array where the array indices are corollaries for the animation frame indices.

  • What kind of data are you modeling? Is it 1 or 2-dimensional?

  • We had an issue like this with galaxy generation. I fixed it similar to facecrime 's solution, by generating random whole numbers, back checking versus existing numbers then spacing it via a preset limit (like padding 0.3 of 1 unit of space) to prevent crowding.

  • Regex compares text very well.

  • Can you separate the icing edges from the icing thickness?

  • Can you create a "lineOfSight" invisible sprite on the player level and assign it the same relative position on the player layer as the background monster?

    You would probably have to use a CanvasToLayerX/Y kind of thing. Then measure the line of sight from this invisible sprite?

  • You might have to reset your index at the end of the alphabet for it to "loop."

  • Maybe try using a linear equation to set the speed?