CloveltOc's Forum Posts

  • 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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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

  • 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

  • I´m making a game in which a certain action is executed when the score is multiple of five (ex 5,10,15,20,25...), and it doesn´t seem like there is an answer around here. I was thinking that a proper method would be dividing that number by 5 and if the result was a whole number, then the action would be executed.

    Even though I found this-> http://stackoverflow.com/questions/2304 ... ole-number, trying that method gave me no result in construct.

    Any help would be great, and if this was asked before, i´m really sorry.

    -C

  • Sorry for the wait, I used to try tilemaps, but switched to sprites and found Yann´s post about procedural generation with miners. I can´t post plain URL´s (for the .capx) yet but it looks like there´s no problem with images so I´ll post the process:

    They are pretty much three arrays of 10 w each

    Edit: c2 missed an event when making the screenshot that generated a wall for each XY element, it basically created the grid of sprites.

  • Oh I see... I don´t really have much an idea of how would I do that, but I´ll give it a try, thanks!

    Though further explanation would be greatly appreciated

  • I´m trying to do some procedural cave-like generation, but after being able of generating/resetting the terrain, I need different entities to spawn in empty spaces within the layout. It uses arrays with "miners" that clear up "wall" sprites while generating.

    I would like to know how to detect specific locations like hallways, corners or open spaces if possible.

    Thanks a lot! Hope someone answers this time, heheh...

  • Minor Hey! I love this cave gen, but is there a way to clean the array or resetting the level without reloading the page?

    And last thing, how would player and enemy spawns work in there? Thanks!

    Bernie1400

    I made the same version in Construct Classic complete with tutorial.

    I've remade the basic idea in Construct 2 for you to play with.

    Try it EDIT**You'll need the latest Construct 2 beta to open the file

  • I´m experimenting with size based basic 2d terrain generation (with arrays). It works just fine if I F5 the page but reloading the layout does not clean the array, it stays as it is. Performing the action "clean" or setting the array size to 0,0,0 and back do not help, it does not generate new terrain after reloading.

    I´m pretty new in the forums, so I apologise if I´m posting this in the wrong place or it´s a silly problem. I also don´t know if I can attach files/links yet without them being removed, so any info would be great!

    .capx (dropbox)

    w w w . d r o p b o x . c o m /s/pd1ysck98bwageb/randomterrain.capx?dl=0

    Thanks in advance, and sorry for my terrible english

    EDIT:

    My link was removed, so I´m reposting it with spacing inbetween.