bartalluyn's Recent Forum Activity

  • can the floodfill demo on my youtube channel work in any way?

    youtube.com/watch

    cheers

  • could you try picking for example the top one inside the overlap check.

    I had the same thing with my solitaire game:

    youtu.be/E1zqEGLeCyI

    Here I can overlap multiple cards as well, and within the "on object clicked", I just pick the top one. I'm guessing that could be the same thing upon overlap here?

    hope this helps?

  • As far as I know there isn't, unless someone else corrects me. But I'm guessing you're asking that because the user can change the contents during the game. I think the way you should look at this, is that the design time info is like a starting point. where you start from when starting off with the game. I think you should use the local storage plugin to save the dictionary/arrays, and on start of layout check: if the item exists in local storage, load it from local storage ELSE load it using ajax from the project file.

    but maybe I don't understand the use case well, so hope it helps?

  • Hi, Does my youtube channel count as a devlog?

    Up to you to decide if it's worth a subscription of course

    cheers!

    youtube.com/channel/UCZ6QjvqEs9dR2miRnfFqIpQ

  • Hi,

    I'm planning to do a video that uses that in the near future, but it's not finished yet.

    What I can tell you is to take a look at one of my other tutorials here:

    youtu.be/rDKwhBwf7Ck

    on a logo quiz, where I do something similar: set an animation frame depending on a condition, It's not stars, but it's letters. The boxes where you can drag the letters to depend on the correct answers, where in your example the stars depend on the user scope. Somewhat similar actually.

    Hope that helps!

  • I would say try a sub event below the "overlapping" event, saying pick top instance for example or pick random instance. It will retain only one.

    I had exactly the same issue with my solitaire game :

    youtu.be/E1zqEGLeCyI

    If I overlap a card, I can only pick the top one. It's handled on object clicked, but same thing I presume with overlapping.

    To increment the score correctly you will probably be best off using a for each loop inside the event as a sub event. But BEFORE you do the pick top instance otherwise you will be left with only one, and the score will increment only 1.

    So on overlap

    for each

    increment 1

    pick top

    do something with top instance

    Let me know if that worked for you.

  • You do not have permission to view this post

  • In this sudoku game I also need to restrict to drop area's, you can check out how it's done.

    youtu.be/Rq0iQGcVQtc

    it doesn't use tilemaps however, but invisible sprites that act as placeholders. May that can be an alternative?

    Hope that helps in any way

  • I would say, start by picking all the objects in range by "pick by evaluate". If you really need the for each (first try without), then you can do that inside the pick by evaluate as a sub event.

    you can check out my tutorial on a city builder game, where for instance, in a certain part of the code I need to asses the capacity of an asset, and I first pick all of the assets that apply using pick by evaluate and then loop through them to call a function for each of them.

    youtu.be/ygTXlrdpma0

    What you should definitely not do is just loop through them, and then evaluate a condition. Always pick. And avoid doing so on every tick, try and do it triggered.

    Hope that helps

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • why don't you make the for loop a sub event of on start of layout?

  • This is quite hard to grasp without a c3p file actually. I can give some general tips though

    1- Why is the function IsIngredientAvailable returning FALSE even though inside the function the return value is reported TRUE?

    ==> watch out with rules here. I always use a local variable called "result_value" or something, and in the very last action of the function (outside of any loop or condition) I just return that value. That's handy because you could debug this using console.log for example, and see what your result value becomes as you loop through. Debugging loops is always a bit of a hassle, but I usually use either a debug label and append some text as the loop goes on, or use console.log to track what variables become all through the loop.

    2- Why is it that I have to store the return value of a function in a variable and then run conditions over that instead of directly running conditions over the function?

    I presume that what you mean is where the "hasValue" needs to check if a recipe contains an ingredient? I would use a separate function for that returns true or false

    3- Anyway to structure the code so I don't have 3 loops over the same data just to get to what I want?

    Hard to see without the c3p file, but I get the feeling that you should first loop through the crafting stations and add the ingredients to the array. And then UNINDENTED go loop trough the choosen ingredients. If you have 3 stations, and they all have 1 ingredient... You loop through the stations: in the first iteration, the ingredient array will have one value, and will never match a recipe, the second time round, still not, the third time round, maybe.

    So, again, I don't know exactly the circumstances, and game logic, but I would think that you would first do the filling of the array. and then, NOT as a sub event, on the same level as the for each loop, do the rest?

    Personally, I'm a huge fan of functions and separating parts of the logic into functions even though they only get used once.

    If you're interested you can check out my youtube channel with a lot of useful examples. In most games I use a lot of functions, some of them even recursive.

    youtube.com/channel/UCZ6QjvqEs9dR2miRnfFqIpQ

    Hope my tips help.

    If you send the c3p file, maybe I can be of some help debugging it.

  • I'm not sure I understand 100%, but i'm thinking that doing this with a function will do something?

    * On function 'SetStateBasedOnNumber'

    * Parameter 'number' (Number)

    * Parameter 'x' (Number)

    * Parameter 'y' (Number)

    ----+ System: number = 0

    -----> Tilemap: Set tile (x, y) state normal

    ----+ System: Else

    ----+ System: number = 1

    -----> Tilemap: Set tile (x, y) state rotated 90°

    ----+ System: Else

    ----+ System: number = 2

    -----> Tilemap: Set tile (x, y) state rotated 180°

    ----+ System: Else

    ----+ System: number = 3

    -----> Tilemap: Set tile (x, y) state rotated 270°

    + System: On start of layout

    -> Functions: Call SetStateBasedOnNumber (number: floor(​random(​4​)​), x: 1, y: 1)

    You can just make a loop through x and y?

    Hope this helps

bartalluyn's avatar

bartalluyn

Member since 22 Apr, 2018

Twitter
bartalluyn has 33 followers

Trophy Case

  • 6-Year Club
  • Entrepreneur Sold something in the asset store
  • Forum Contributor Made 100 posts in the forums
  • x62
    Coach One of your tutorials has over 1,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

11/44
How to earn trophies