bartalluyn's Forum Posts

  • why don't you make the for loop a sub event of on start of layout?

  • Try Construct 3

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

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

  • You do not have permission to view this post

  • Cool stuff. Looking forward to experiment with this

  • I don't exactly know what you mean by jitter, but have you checked out this tutorial on my youtube channel?

    youtube.com/watch

    I believe it does something similar, maybe you this can help you in figuring it out?

    hope it helps

  • thanks Mikal, I love it

  • If you want a good understanding of what C3 can do in regards to picking, and popular game mechanics, check out the tuts on my youtube channel. You'll learn a lot

    youtube.com/channel/UCZ6QjvqEs9dR2miRnfFqIpQ

    hope it helps

  • No, but you can use the scroll to system action to center the layout on the mouse (vice versa).

    If you're new to C3, maybe you can check out the tuts on my channel:

    youtube.com/channel/UCZ6QjvqEs9dR2miRnfFqIpQ

    hope that helps!

  • If you're entirely new, and want to grasp some concepts, check out my youtube channel.

    You'll find the necessary info on how to make certain well known-type of games.

    youtube.com/channel/UCZ6QjvqEs9dR2miRnfFqIpQ

    hope this helps!

  • Hi,

    If you're new to C3, check out my youtube tutorials. They provide insights in a lot of popular game mechanics.

    A platformer is not included because I find that the majority of the tutorials on construct are on platformers, so I haven't jumped on that platform (pun intended).

    For the rest : a lot of useful info:

    youtube.com/channel/UCZ6QjvqEs9dR2miRnfFqIpQ

    hope that helps

  • C3 is capable of a lot.

    Check out my tutorials on youtube.

    Quiz game like in a logo quiz : youtu.be/rDKwhBwf7Ck

    Multiplayer game : youtu.be/BpnkIL7XvvA

    Check out the other video's too, they provide helpful information on the general way of working of some popular game mechanics

    hope that helps

  • If you're new to C3 you might be helped with some of the tuts on my youtube channel.

    For example this one where sudoku is implemented does something like what you describe:

    youtu.be/Rq0iQGcVQtc

    Hope that helps

  • That's right. The advanced random plugin will help you there.

    I've got a lot of examples on my youtube channel. For example this one

    youtube.com/watch

    or this one

    youtube.com/watch

    hope that helps

  • If you're entirely new to Construct, check out my youtube tutorials :

    youtube.com/channel/UCZ6QjvqEs9dR2miRnfFqIpQ

    You will find a lot of useful info on how to make a lot of games

    Hope that helps