faulknermano's Recent Forum Activity

  • I'm attempting to fill a column of 4 squares with color. Once all 4 are filled, I move on to the next column.

    I'm picking random values from an array by using

    array.at(round(random(0,3)))[/code:2zpwsj43] to pick which square to fill but the problem is it will repeat values and I don't want it to do that. I want it to only pick 4 times and then move on.
    
    Should I delete them as I pick them?
    

    That's what I would do: if I wanted to keep the array of random numbers, I'd copy the array first, and then pick-and-pop the array as I go along.

  • I really shouldn't make plugins since I have no intention to edit the plugin to fix it. .

    R0J0hound, you shouldn't worry: other people learn from studying the code. If it's 'broken', then at least it provides some motivation for others to learn it (and hopefully modify it to their needs).

  • I've always used

    floor(random(min,max+1))[/code:12htpoud]
  • In addition to R0J0hound's explanation, it personally helps me to visualise it like a 3-dimensional cube. Even though Depth is not 'used', it still needs a size to be there in order to store Height and Width. A single 'slot' in the array requires a 'location' in the cube, which must have at least 3 dimensions.

    (I think this is because an Array in C2 is intrinsically a 3-dimensional array -- unlike in other programming languages -- so it follows this concept.)

  • Rex has the answer to life, universe and everything.

  • Denmla, to answer the question of sorting, it can be as simple as using C2's 'Sort Z Order'. The docs state:

    [quote:345z7z4s]Sort Z order

    Sort the Z order of instances of a given object according to an instance variable. This effectively removes all instances from their Z order, sorts them, then inserts the sorted sequence back in to the holes left behind. This means if the instances are spread across a range of layers, they will be sorted in the same Z order locations, maintaining the same order relative to other instances on those layers. Note this action is much faster than using an ordered For each with an action like Send to front/back, so this action should be the preferred way to sort the Z order of large numbers of instances.

    Create a new instance variable -- call it 'sort' -- for all sprites that needs to be sorted. Then set the 'sort' variable's value to the sprites's Y coordinates. Then call 'Sort Z Order'.

    However, if you want to snap to grid, you can make a custom function for this, but a practical solution really depends on how you've already set up your scene.

    My real suggestion, especially if you are thinking of expanding an isometric map, is to use a combination of Tiled and Rex's TMX importer, and Rex's Board plugin and SquareTx plugin (and other Board-related plugins that fit your gameplay).

    The Tiled app (TMX) will enable you to generate an isometric map using logical coordinates (grid coordinates).

    Rex's Board plugin will create a virtual board, so that you can start working in logical coordinates (rather than screen coordinates). The SquareTx plugin will make the Board 'graphical', or project the Board's logical coordinates into screen space. This makes it easier to manage a map, because you'll be only concerned with the logical coordinates, and you let SquareTx handle the projection of the graphics onto the map.

    Rex's TMX Importer will take the TMX info and using SquareTx, places the tile sprites on the Board.

    I could say more about this, but there are so many details. I have to say that making functional isometric grids in C2 is not very simple without these plugins. However, these plugins require you to study them carefully as well, but it's better than writing many functions to achieve the same effect.

  • Not sure if there is an basic C2 way, but I use this:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Do you use any effects?

    Personally, I had slowdowns related to the Shadow Light plugin.

  • R0J0hound, that's a great resource and reference. Many thanks for that. It's sometimes difficult to remember the issue I had before because the behaviour seemed inexplicable. So thanks for info.

  • For what it's worth, this bug is actually present in C3 as well. Just tried it. Perhaps we could get the devs attention to C2 if the problem is known to exist in C3.

  • Prominent, I see what you mean. There is a marked inconsistency with how picking is recognised. But also, as you pointed out, is it also an 'or' bug, because if you separate the 'type="yes"' away from the type="no" in different events, you won't fire the 'bug' text.

    On the other hand, if you use the system Pick (like you did with name="one") with "yes" and "no", while using 'or' the 'bug' text doesn't fire.

    Looks like an 'or' conditional issue. Either way there's certainly something amiss.

faulknermano's avatar

faulknermano

Member since 26 Jul, 2014

Twitter
faulknermano has 1 followers

Trophy Case

  • 10-Year Club
  • Email Verified

Progress

11/44
How to earn trophies