R0J0hound's Forum Posts

  • It's just a unique number for each combination of doors. There are 16 combinations and with the formula you'll get a value from 0 to 15 depending on the exits.

    The only thing that matters with this is the same value will be calculated for rooms with the same exits. Which exits doesn't matter as long as they're the same.

  • Do you mean why? It's just packing the four booleans into one number using one bit per boolean. I could have just as well packed each boolean to each decimal place like this:

    roominfo.exitE+10*roominfo.exitS+100*roominfo.exitW+1000*roominfo.exitN

    The idea was to use one variable comparison instead of four. Look in "Event sheet 1" events 5-11 for it's use.

  • The layer texture only exists when the runtime is drawing and the layer has "force own texture", otherwise I'm pretty sure drawing is done on the main canvas.

    If you just want to know the contents of a pixel in an image you can try the rgbaAt expession of the canvas plugin.

  • Hard to say if the idea is implemented right from a picture but it looks somewhat on par. You can extend the idea future by perhaps instead of looping through half of the array at a time, loop through a fourth or tenth.

    Another idea is to not call updatetile every time. I don't know what it's doing exactly but it probably is a main fps eater if it creates new tiles or does something with all the tiles.

  • gonzdevour

    The error is from pasting the canvas onto itself which now isn't allowed. Initially this was permitted by the runtime but it's an edge case that doesn't work on all exports so a more recent release prevents it from happening and throws the error.

  • I was under the impression that the timeouts occur for almost everyone, myself included. There are a good number of topics with regard to the issue, which in my experience has been a problem since the forum software was changed at C2's launch. I haven't seen any fixes that have helped on my end so that leads me to think that the issue doesn't show itself at Scirra's offices.

    The workaround that many users currently use is to copy their text before attempting to post reply.

  • guess that sconstruct 2 will never be able to produce a game such as stealth bastards

    Well, just because you haven't found a way to do it yet doesn't mean it can't be done. From what's on these forums there are ways to draw the shadows. There just isn't an example made yet to test if an object is in shadow. As a simple idea the line of sight behavior could be used from the lights to the player and if there isn't a LOS then the player must be in shadow. There are probably other ways though.

  • You're thinking of "bitwise and". "&" in C2 expressions is "logical and" where 0 is false and nonzero is true.

    That said you can do "bitwise and" with the browser object and the ExecJS expression.

    For example setting some text to Browser.ExecJS("4&2") will give 0.

  • 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.

  • Try Construct 3

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

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