mekonbekon's Forum Posts

  • I can see a few things that are likely to be causing problems:

    1. Adding the 0.9999 when picking a random no. for RandYPlacement means you may pick a number outside of the Y index of the array - remember that the Height is one more than the max Y value as the Y index starts at 0.

    2. RandYPlacement can keep picking the same number in each loop so some values won't be selected and others could be duplicated.

    3. When setting the size of Working_Answer_Array your Z axis needs to be at least 1.

    It's always good to try and work things out in a way you can understand but to be honest it would be worth getting your head around Mikal's code - it's quite elegant and really simplifies the process.

    Here's a similar version that's even simpler! ;-P

    It essentially does the same thing, but only needs one variable; in this case "pick" is a variable added to the array, rather than a local variable.

    The "for" loop runs once for each X index in the array.

    Each time the loop runs:

    1. the first action saves to "pick" an index value between 0 and the max X index minus the current loop index, so the first loop it picks between 0 and Width-1 minus 0, the second loop 0 and Width-1 minus 1 and so on until it gets to the final loop where it picks between 0 and width-1 minus width-1, or just 0.
    2. the second action adds the value in the array at the index "pick" to the end of the array (or "pushes back").
    3. the third action deletes the index "pick".

    This final action reduces the number of values to pick from by one, which is why we reduce the scope of pick by the loopindex at the start of the next loop. Effectively what happens is each loop a random value that hasn't already been picked is grabbed and stuck on the end of the array.

    Hope that helps! :-)

    When implementing these I thought about my previous experiences with other software like, 3d Studio Max or even Unity, where you have to juggle a bunch of keyboard shortcuts along with the mouse, just to be able to do something. I like every other person got used to that very quickly, so I thought it would be the same here.

    Thanks for clarifying - still trying to get my head around how these work, slowly getting there! ;-)

    Hi DiegoM, first off, thanks so much for the work you've put into this feature - it's a fantastic addition to Construct and I'm really looking forward to implementing it in my projects.

    I've a question about the scrubbing: why is it necessary to hold Ctrl to see the current view? Are there going to be any situations where you don't want the marker to display the animation at the indicated time?

  • Hi,

    I'm wondering if there's a way to use the AJAX object to request a JSON project file by name rather than using the drop-down list? Or maybe using some other object?

    Each level in my game has its variables stored in a separate dictionary JSON file. It would be great if I could request the file by name e.g. "level_"&ampcurrentLevel.

    I guess I could stick the variables for all the levels in a single dictionary or array, but both those solutions come with their own problems.

    Thanks in advance for any help you can offer.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Green321

    Here's an example that contains multiple teleporters - you should be able to simplify it to suit your needs:

    https://www.dropbox.com/s/h0h7fjk5t8d3p ... e.c3p?dl=0

  • In general it's best to avoid using the wait action, especially in situations where it might be interrupted. Instead, add the timer behaviour to your character. Remember to give each timer you start a different tag. You can then use the "stop timer" action to cancel the timer for a given tag.

  • nightbr You're welcome

  • Hi nightbr, the easiest way to deal with this is to put the bat and the start position object into a container together. That way whenever you pick a bat you also pick its start position:

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

    I also added a "for each" on the check, otherwise you might have problems with the else statement that determines the mirroring.

  • TheSynan, you're welcome

  • Hi tarek2, Thanks for looking into this. I tried with your bug capx too and got the same result. Interestingly, if you check the timer tags in debug you can see that each sprite has a different tag ("change0","change1","change2") so it seems that the UID is being applied to the tag correctly.

    So the problem is that even if they have different tags if they finish on the same tick then "change"&self.UID still picks them all together, so the function Call "ChangeAnimation"(sprite.UID) will only fire for the first sprite in that group. Adding the "for each" to the function call (as suggested) fixes it, which renders the UID unnecessary.

    OK, I'm pretty sure that explains the issue I've been having - time to rewrite some code! Cheers again

  • I have a bug in one of my projects; multiple instances are running simultaneous timers and I've been using a tag containing the instance UID to differentiate between them. Sometimes an instance hangs when the timer expires.

    If making the tags unique by including the UID isn't enough to distinguish between timers for instances of the same object finishing on the same tick then that might explain the issue I'm experiencing, hence my interest.

  • blackhornet tarek2

    Re. the timer multiple fire issue, is it possible to circumvent this by using "fire"&self.UID as a tag?

  • TheSynan

    Here's an example:

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

    Press space to start the pathfinding and shift to reset the level.

  • Ah yes, "pick all", I forgot about that. Cheers!

  • dop2000

    Sorry, I should have clarified - using the wait 0 seconds returns a count of 0 even if other sprites still exist, hence me using a function after the wait to escape the picking