CloveltOc's Recent Forum Activity

  • It finally works, kinda! In my first method I called the function, then checked the cellType and so on, kind of the same thing but longer and in a slight different order... A mess. It now generates the walls if I change *32 to cellSize but they don´t look like they are being placed correctly. EDIT: I just realized i´m over 500 rp, i´m uploading the damn .capx that would have made all of this way easier HERE: (requires litetween) https://www.dropbox.com/s/6t9zfd4dc4231 ... .capx?dl=0

    Or else, they will spawn like these:

  • I´m extremely sorry. New to the forum! Last thing, how can I edit the name of a topic to write <solved>?

  • Chrome/Firefox, logged in correctly.

    Clicking "Write a tutorial!" or entering scirra.com/tutorials/submit manually redirects to scirra.com/tutorials/top

  • Hmm... The coordinates "getcelltype" function creates seem weird looking at the debug screen... I still don´t know what i´m doing wrong!

    Is this the way it´s supposed to be?

    I got a mess doing the first failed method, and this simply gives no result... I´ll keep trying, i´m such an idiot with arrays

  • I actually scrapped the last method because I think I got it wrong from the base, used [removed] to pick a random position of the array... Maybe I did not understand what you provided correctly? It´s litterally my first week with arrays, I´m really sorry... Just curious, which would be the best way of doing it, Magistross? I´m actually confused

    Edit: I can´t post urls yet, it got removed but you get the idea :I

  • Hmm, it works great, but I might be picking random positions from CellTypePos in the incorrect way because even when I pop the picked position, objects still spawn twice sometimes... Sorry for disturbing you again Magistross

    Which would be the correct way of doing it? Last thing, I don´t know what you meant with "You might also want to set cave.CurValue to 1 in line 13 too"

    Am I doing it right?

    Again, thank you sincerely for all the help. (and sorry for being such a dummy with arrays)

  • No problem, as soon as I have my 500 rp

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • That is AWESOME! I should use functions more frequently... Sincerely, thank you for all the trouble I got you into, it´s exactly what I needed

    This is the kind of thing that make these forums shine!

  • Here it is, I hope it´s better explained. (ignore that green arrow too, it got in the way)

    As I said, I use a method really similar to Yann´s "miners" procedural generation, an array that is translated to a sprite grid, carving rooms and hallways from a center point.

    What I want is to pick coordinates of an empty space so enemies can spawn. My main concern was that it would be pretty lame having all enemies spawning in random locations (in fact, it would be malfunctional because some depend on the terrain like turrets or worms), and I´m really bad with arrays so I was asking for a way to detect special areas like the ones shown in the image.

    I don´t know if I could explain this in a better way, i´m an absolute noob with procedural generation

  • Yes, sorry Magistross :

    -The array gets cleaned, then generates a grid of sprites which gets carved by "miners" (miner method).

    -An empty cell is represented as 1 in the array

    -Everything is generated from a center point in which the player is positioned so it´s never stuck

    So what I want is to make the engine look for an empty space xy pixels far from the player pe enemies items... And if possible detecting special cases like an empty space surrounded by three sides (for a fake wall), a corner, a wall (turret)... like represented in the first post. I know I could do this with invisible high speed solid bullets, but the second part would require proper logic.

    I apologise if I still did not explain it enough.

  • Thanks a lot! Can I close this topic or does someone else have to?

  • I´m still stuck with this, if anyone could help, that would be awesome

CloveltOc's avatar

CloveltOc

Member since 14 Mar, 2015

None one is following CloveltOc yet!

Connect with CloveltOc

Trophy Case

  • 9-Year Club
  • Email Verified

Progress

10/44
How to earn trophies