Magistross's Recent Forum Activity

  • I finally got to take a look at it. It seems I botched the GetCellType function, had a second look at it and I had the value representing an empty and filled cell mixed up. Just adjust the value for "FakeWallSpot" to =1 and "Wall" to =3.

  • It seems that I require the "ParticlesWH" plugin from Scirra... However, I have no idea what that is...

  • The coordinates in the array are actually "tile" coordinates, so to get the real X/Y on the layout, you have to multiply them by the correct tile width/height.

    On line 22 of your previous picture, you are calling the the "GetCellType" function with no parameter, so it's constantly checking the type of tile 0,0. However I don't why you are checking for a "FakeWallSpot" while we already have all possibile position... On line 23, before looking inside a CellTypePos array, you have to limit the SOL to the correct array (the one with CellTypePos.cellType = "FakeWallSpot"), you can use pick by evaluate or compare instance variable for this. Here's a screenshot of how I'd do it all. I supposed your tiles were of size 32x32.

    Enemy generation should be done after the world generation, I can't really see if that's the case currently, so I'm telling you just in case.

  • What you basically have to do is get a random integer between 0 and array's width - 1, retrieve the info at that index (Array.At(randomInt, 0) for x coord and Array.At(randomInt, 1) for y). Once you have the coordinates, you delete that index from the array. (Delete index randomInt from X axis)

    Hope this helps.

  • Show me how you did the position picking/popping part, I'll tell you if something isn't right.

    And concerning that highlighted event, it should be exactly the same as the one above, but change the "cave" array instead of the "clean copy" array.

    So we have : cave -> Set value at (cave.CurX, cave.CurY) to 1

  • I remember having used the name() function successfully, but I can't seem to be able to get it to work now... Maybe a bug ?

    edit: Okay, I think I know why I can't get it to work anymore. I'm currently using Firefox for my test, and there's a workaround for some Firefox related problem implemented in the XML plugin. Strangely, the workaround isn't needed when using the name() function. Testing with IE fails too, although I don't know why... Chrome and NW.js works like a charm!

  • You might be interested in this plugin :

  • Access-Control-Allow-Origin is a response header, it's the server that allows it or not. You can't as a mere client tell the server to allow for cross-domain request, that would entirely defeats the purpose of cross-domain policy.

    The only solution is to have access to server configuration, and add that custom header there.

  • Sure, here it is.

    https://dl.dropboxusercontent.com/u/700 ... adXML.capx

    As an exemple, I displayed the first <word> node of the first <word> node. Strange document structure by the way, but I guess it's out of your control... <img src="{SMILIES_PATH}/icon_razz.gif" alt=":P" title="Razz">

  • No problem! I'm interested to see how you implement what I just provided you though, if you're not too shy about it!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • As a side note, the XML can indeed be loaded inside the official XML plugin. Just tried it !

  • Ok, so you indeed need a function that checks neighboring cells, but you also need another one that will find you a random spot for a particular enemy type. First, the checking function.

    Then, it might be a good idea to keep a list of each location of type of tiles. Best place to do it would be when you create your "cleaned copy". Now HOW to do it is another question. I would use multiple instances of a two-dimensional array. First, create the arrays.

    Each array has a size of (0,2,1) and it will expand as we fill them.

    Then add this when you create your cleaned copy, just under the line 13 in your events screenshot, as a sub-event of line 11. You might also want to set cave.CurValue to 1 in line 13 too, and not just in your cleaned copy.

    Afterwards, when you want to spawn your enemies, all you have to do to pick a location, is get a random position in the correct CellTypePos array, and pop it, so it doesn't get picked again.

Magistross's avatar

Magistross

Member since 4 Jul, 2011

Twitter
Magistross has 14 followers

Trophy Case

  • 13-Year Club
  • Entrepreneur Sold something in the asset store
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

20/44
How to earn trophies