R0J0hound's Recent Forum Activity

  • The only other idea that comes to mind is to use the function object and make functions to set/get variables.

  • Instead of using the variable name you can try using the variable's index. 0 for the first, 1 for the second, and so on.

  • I don't have any documentation, this topic is a good place to get info on how to use it though. The plugin's actions are fairly self explanatory and there are examples in this topic that show it's use in various situations.

  • As a simple case instead of doing this.

    Array: for each xy
    --- do stuff

    You can instead do your event like this for the same effect. Except you would have to use loopindex("x") and loopindex("y") instead of Array.CurX and Array.CurY.

    System: for "x" from 0 to 325-1
    System: for "y" from 0 to 125-1
    --- do stuff

    Now it can be time consuming to loop over each cell as might be your case since it has elaborate logic that is run per cell. But if you do half the array one frame and the other half the next you can reduce the stall by half.

    One such implementation would be:

    Global number distribute=0
    
    Every tick:
    --- add 1 to distribute
    
    System: distribute = 1
    System: for "x" from 0 to 325-1
    System: for "y" from 0 to 62
    --- do stuff
    
    System: distribute = 2
    System: for "x" from 0 to 325-1
    System: for "y" from 63 to 125-1
    --- do stuff
    
    System: distribute = 2
    --- set distribute to 0

    Alternately you could do every other column with something like this:

    Global number distribute=0
    
    Array: for each xy
    System: compare Array.CurY%2 = distribute
    --- do stuff
    
    Every tick:
    --- set distribute to (distribute+1)%2
  • Instead of looping over the entire array maybe you could loop over only part of it at a time? Another idea would to reduce the number of times you read array positions by saving the values of the adjacent cells to variables.

  • You can disable the "bounce off solids" property and just use the bullet behavior's "bounce off object" action with an "on collision" condition. With that you can get the same effect as what Fidasx posted, only without solid.

  • Here is what is happening as stated by Blackhornet:

    <img src="https://dl.dropboxusercontent.com/u/5426011/fixed/Creation_picking.GIF" border="0" />

    And here is one possible way to get your function to work:

    <img src="https://dl.dropboxusercontent.com/u/5426011/pics/picking_new.png" border="0" />

    The first mirrors your issue. The for-each will only affect existing sprites. The second waits until the end of the tick to do the actions when the new objects are pickable.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Found a program here:

    http://www.thesimplest.net/pc/simplest-way-print-screen-screen-capture-window-needs-scrolling

    That takes a screenshot of a scrolling window. I tested it and it works well with event sheets.

  • The OnYes condition is a triggered event, which is only triggered in the event sheet and not in python. You'll have to either use just events or do it the way you'd have to do it without Construct in pure python by using a python library.

  • Well you don't have to use the snapshot, it can also load images in the files folder.

    So as in the title "why not", I updated this further. It now converts an image directly that can be loaded into the tilemap object. Right now it just does tile/no tile based on the alpha of the pixels, but it can be tweaked to use different tiles based on color.

    https://www.dropbox.com/s/vsq1xdlyvr7od ... .capx?dl=0

    Also on the plus side it's much faster. For me it works in just under a second for a 1280x1024 image.

  • JJList

    This reply is a bit late but as for the original clearing I couldn't get it any faster by not using sqrt.

    As for using the pixels from the canvas object here's an example:

    https://dl.dropboxusercontent.com/u/5426011/examples21/canvasWithTileMap.capx

    It is very slow, for me the whole bit takes about 5 seconds to transfer the canvas to the tilemap.

    So on a whim I also did a test with a snapshot and straight javascript using the browser object since I didn't want to make a plugin.

    https://dl.dropboxusercontent.com/u/5426011/examples21/snapshot2tilemap.capx

    For me it takes about 3 seconds. After looking at the times I think it can be made faster by bypassing the array and just converting the pixels to a format the tilemap can load. But that isn't a simple task as the format is pretty complicated.

  • Your slider setup had to be tweaked to make it possible.

    https://dl.dropboxusercontent.com/u/5426011/examples21/3slider.capx

    The "balance" function is what adjusts the non-picked sliders.