mekonbekon's Forum Posts

  • Hi luckyrawatlucky,

    1) Seed

    From the manual:

    Seed

    A string of characters used as the seed for random number generation. The same seed will always provide the same sequence of numbers. An empty string (the default) will use a random seed, ensuring the sequence of numbers is different every time.The seed is effectively a key for ensuring you produce the same random number sequence each time - this is useful if you want to allow users to replay/reload procedurally-generated content, for example.

    2) Permutation

    A permutation is the number of ways in which members of a set can be arranged, e.g. the letters ABC have 6 permutations: ABC ACB BAC BCA CAB CBA. In Advance Random you can create a random permutation table:

    Create permutation table

    Generate a randomly ordered sequence of numbers. Length is how many numbers to generate, and Offset is the first number in the sequence. For example a length of 3 with an offset of 1 will generate the numbers 1, 2 and 3, and then randomly shuffle them.

    3) Threshold

    A threshold is usually a value that if exceeded will trigger an action. From Black Hornet's description of the BHTsmartrandom plugin:

    A Threshold value lets you configure how the cycle repeats when all of the numbers are used, and the sequence needs to continue/cycle. A Threshold=0 will completely ignore the previous sequence, so the numbers will be random within the same range again, but it is possible that the last number of the sequence may be the same as the first of the next. For example; 2,5,4,1,3 could be followed by 3,1,4,2,5. The value 3 will repeat because the sequence must be regenerated and no logic is applied to test the last value of the last sequence. A Threshold=1, would guarantee that the first number of the next sequence would not be a 3, so there would not be a repeat immediately when the sequence restarts. Care is still required not to abuse the Threshold, as if it is too large (that is, greater than half the range), it is impossible to guarantee not repeating the same values.

    Hope that helps! :-)

  • Try Construct 3

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

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

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