brettski111's Forum Posts

  • 10 posts
  • Use System.For

    Yes, thank you that is much more how I think of iterating over arrays. Good to see how to do it in this paradigm. Working as expected now. I appreciate both of your time for responding to my question.

  • You use a for loop for this.

    Look here at loops: https://www.scirra.com/manual/124/system-conditions

    In the for loop you access your Array at x, which you iterate and y1 (fixed).

    Yes, I have tried this, though I don't know how to keep y1 fixed.

    I tried the following, and don't know how to only check values on y1.

    [attachment=0:28uiug9c][/attachment:28uiug9c]

  • I have a 2d array where each X represents a location. The y value for that x contains the name, location, and other game values. I am at a spot where I need to search through all the values at y1 so I can figure out which x it is on. I have not been able to figure out how to do this in the event sheet. Any assistance is really appreciated.

  • Ah, interesting, I probably should have tried adding a second one before posting, as you cannot add a second function object.

  • Erez Exactly, I can create multiple functions from a function object in my project. Is there any reason I would want or need more than one function object in a project? Just curious, trying to learn.

  • It seems I can use the same function object to create any number of functions. Is there any reason why I would want or need to create multiple function objects?

    Thank you.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If you did these steps, then it's not to have errors.

    I agree with you and I will chalk this one up to doing this stuff at 3AM. I recreated this morning and all is good. Thank you for your time.

  • Is your project file in JSON format?

    The json example I provided is exactly what is in my file. I have also exported a dictionary, disabled the actions to add data to the dictionary so it is empty and tried to load that same file back into the dictionary and it didn't work. I know the file is being read as it successfully writes to a text box.

  • scirra.com/forum/load-json-string-into-dictionary_t72836

    Thank you for the reply, but that forum post doesn't help me as that is working with a static string directly in the action, not reading from a file.

  • I am trying to load a dictionary from a project file. I see how to read it using an ajax object, but I am not sure how to take that data and load it into the dictionary.

    I setup a trigger for when Ajax is completed. I then add a dictionary load action and load from Ajax.LastData, but it isn't loading into the dictionary. I can send it to a text box and I see the data from the file, but the dictionary data doesn't change/load.

    Here is the string that is in the file (exact):

    {"c2dictionary":true,"data":{"ColorTV":0,"Freezer":1,"Suit":2"Refrigerator":3,"Stove":4}}

    Any suggestions?

  • 10 posts