Maydie's Forum Posts

  • AllanR

    I cannot wait until work is done to check this out, sometimes I think I took the wrong career path....aww well. Sounds like exactly what I have been trying to do. I truly appreciate the effort of creating a mini project for me, I will check it out and let you know. I was pulling out my hair last night trying to get the array to work.

    Essentially what my plan for this is:

    -Have a set amount of random bodies of water

    -randomly select a location where no other tiles currently exist

    -Create a random sized body of water with that information on a 32 snap grid

    My next challenge after this is to find the outline of the water and replace it with the appropriate sprites so it looks more natural, something I will of course attempt before asking anyone here to help with.

    Cheers!

  • Update: Nope, spoke too soon, sorry for posting so much.

    I think I may have figured it out, I am trying to validate the data. Maybe someone with more experience will be able to point it out before I have finished.

    I changed the last "For each XY element" to:

    https://www.dropbox.com/s/st05bvbfdvfgz ... 2.jpg?dl=0

  • Hello,

    First of all I really appreciate the time to write.

    Secondly, I guess arrays flew over my head but looking at that example and your explanation I think I am on track now. Having said that, this is as far as I have got:

    https://www.dropbox.com/s/0ec29x8wf5bdi ... 1.jpg?dl=0

    Correct me if I am wrong, this will only delete duplicate values at the first "Y0" it sees that has been duplicated. I would like to modify this to look for when "Y0" AND "Y1" are both exactly the same.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Let me know if there is anything I can make more clear. I appreciate any help and time in advance. Was hoping this was an easy one so I could continue work on my project after work today.

    Cheers

  • Hello,

    First time post, so far all my answers have been answered simply by going through the forums. My challenge is with manipulating 3D arrays.

    I have a 3D array that is 50 in width, 1 high, and 3 depth. I am using this to store randomly generated coordinates before the layout has loaded. I am doing this to create an object without ever creating another object over top of one that has already been occupied when the layout gets generated using the array.

    My current array setup:

    -Depth 1 = "X" coordinate, -Depth 2= "Y" coordinate and "Z" stores the same value (for example "sprite1").

    My dilemma:

    I would like to loop through the entire array named "arrayMap" and remove all duplicates where index "x" depth 1 and depth 2 are duplicated.

    For example:

    Index 4, Depth 1 = 20, Depth 2 = 15, Depth 3 = "sprite1"

    Index 32, Depth 1 = 20, Depth 2 = 15, Depth 3 = "sprite1"

    Index 4 and Index 32 have the same values stored for an "X" and "Y" coordinate so I would like to remove the duplicate (while of course keeping one instance of it).

    Hopefully my explanation makes sense. I did a lot of reading on arrays but my feeble brain gets lost as soon as nested loops and 3D arrays get involved.

    I appreciate any help that can be offered as this will solve a ton of my "random generated" sprite issues that I currently have, not to mention make things a lot cleaner with less coding.

    Cheers.