mindfaQ's Forum Posts

  • If you don't want to code a json parser (/interpreter), this is probably the fastest solution. Just make sure instead of using stuff like push, better resize the array at start of the merge and then just set at - I think this should be more memory-efficient (not sure tho).

    Other idea would be getting a json-expression out of the exisiting array and merge the two json strings correctly together and after that set the array from the single expression, but I doubt thats any faster, so no reason to do that.

  • Ok, I was wrong, was under the impression that https://www.scirra.com/tutorials/77/nat ... onstruct-2 was a manual entry. My bad.

    It's nothing new that those operators are not the same across all programming and scripting languages, though.

  • Put all possible level numbers in an array. Then chose a random index of the array, go to the level of the array value and delete that index from the array (so it can't come up again when you select levels the next time).

  • "<>" is even in the manual, you must have overlooked it ^^.

  • One way to do it:

    a holds the values

    b is a helping array

    d keeps the combinations

    Care, the repeat will do it all in one tick - if you intend to do that with larger sets, I suggest using some kind of limit of how many iterations you do each tick (mby like 500-1000).

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Why not try it out (perhaps with 2 different browsers). Iirc it's possible to test it even in preview.

  • I sometimes had slowdowns too with the steam version. Will try to deactivate autosaving. No freezes though, just very sluggish interface, which I did not have in the free version not bound to steam - so my recommendation stands to not buy C2 on Steam but instead from scirra directly.

  • I don't understand. Do you stack items? Then you are missing the amount of each item in the slot. Do you not stack items? Then why not just add the new item at the end of the array, because obviously all previous slots will be filled.

  • compare 2 values player.isalive = 1

    pick random instance of player: apply effect

  • I'd probably only learn 1 "simple" game maker and after that would try to get comfortable with a bigger/more common engine like Unity and a common programming language that works in that engine, from which I'd get out more in the long run. Its sad that you can't really get a small apk for mobile with Construct 2, though and if you don't own the personal version of Construct 2 yet, GM might be well worth it.

  • You can also use the array Contains Value action to check if that value is already anywhere in the array.

    This will always be true, if you check for the current value. To use this you would need the ability to subset an array, but that's not possible.

  • You could even put it into a single expression like

    set timescale: timescale = 0?1:0

  • for each element in array:

    -- if dictionary has key array.curvalue: mark for deletion

    -- else: dictionary add key array.curvalue

    then delete the entries. Array loops don't respond well to deleting element while they are running, so deletion should probably come after the loop.

  • better use the timer behavior for countdowns, not every x seconds (this will introduce errors on your first tick)

    spawn something x times:

    repeat x times: spawn y

    If an interval is supposed to be between the spawns, use the timer behavior once again, start a regular timer, then on timer count down your amount of stuff you still want to spawn and once it reaches zero, stop the regular timer.

  • Shame it doesn't work anymore - a very functional PDF-plugin would be a blast. I would love to load a PDF, paste a page into a canvas and then later be able to save an image (from another canvas) onto the pdf page i was displaying and export the pdf. I don't even know where to start.