Randomize special action - reset seed?

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • Hello!

    I have looked for this answer but can't really find anything on it, so maybe someone here can tell me

    I know using the "randomize" action you can set the randomizer seed to a specific value instead of the randomly generated one.

    My game has a procedural map generator. I would like people to be able to get the same map every time by inputting a specific value for the random seed. I have this working, no problem.

    I would then like to reset the random seed (let CTF generate one) so the rest of the game is different.


    So my question is, how can I "reset" the random seed? I tried setting it to 0 or -1, and it didn't seem to work.


    Thanks in advance for any assistance

  • Not sure if there's a way to reset it, but something you could do is get a random value from elsewhere and use that as the randomize seed instead. The current system clock/time works great, either the 'timestamp' object (windows only) which can retrieve the 'unix time stamp', or the clock object and multiplying/adding the numbers together

  • So you basically want to be able to generate a properly random seed, but the problem is that you've already set the game's seed to something specific, so now if you try and create a new randomised seed using Random(), it will be the same every time. Am I understanding correctly?

    If so - and assuming you only need to create this genuinely randomised seed once - then why don't you just generate a properly random number at start of frame and save it in an altVal, before you set the game's seed. Then, when it's time to use the randomised seed, just pull it from the altVal.

    Please login to see this link.
    My Fusion Tools: Please login to see this link. | Please login to see this link. | Please login to see this link.

  • In the frame property panel there is a property called Random Generator Seed. By default, this property is set to -1.
    Please login to see this attachment.
    Whit this value, you always obtain different number sequences when you use any random function (for example: random range):

    Please login to see this attachment.

    Please login to see this attachment. Please login to see this attachment.

    However, if you need the random generator to produce always the same sequence, you could set that frame property at design time and also at runtime:

    Please login to see this attachment.
    Please login to see this attachment.
    This way, you always obtain the same sequence:
    Please login to see this attachment.

    You could let the user input a seed for the random generator, in order to generate the same map. After that, you can "reset" the random generator by calling (again) the command shown above (event 1: Randomize x) with a seed of your choice.


    Hope this helps,
    Sergio

  • There is also the Random Pool and Random Multipool objects that allow you to set a seed at runtime. These are Windows-only objects, though.

    .:::.Joshtek.:::.

    Visit Please login to see this link. to publish your freeware Click games and play games made by others or check out Please login to see this link. to enjoy or contribute to our archive of over 3,200 older Click games.

  • There is also the Random Pool and Random Multipool objects that allow you to set a seed at runtime. These are Windows-only objects, though.

    I did look at those, unfortunately I am hoping to be able to export to Windows and Mac. Making things difficul for myself by those restrictions - quite a few functions I have had to manually create so far that could have been done by extensions if I would just go Windows only :D

  • Just as thought experiment, is it possible to retrieve system time data in clickteam fusion without extensions? I mean something like (Player XPos+ ((DD*MM/YYYY^2)*ms)/min)-(xmouse/Player YPos))^ymouse, would be a pretty unbeatable randomizer, just as an example.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!