How can I randomly create objects from a qualifier?

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.
  • Use Create by Name action, and read a random line from a list object that has all the object names that are possibilities.

    Darkwire Software Lead Programmer (C++ & C#)
    Please login to see this link. | Please login to see this link. | Please login to see this link. | Please login to see this link.

  • I'm not sure why you want to avoid random number values. There are some objects such as Randomizer Object and String Randomizer which avoid visibly using numbers, but at the end of the day it is just random numbers with extra steps. Similarly, you could set an object to be a random direction and then have one event for each direction creating a different object but that is jut complicating things.

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

  • I'm not sure why you want to avoid random number values. There are some objects such as Randomizer Object and String Randomizer which avoid visibly using numbers, but at the end of the day it is just random numbers with extra steps. Similarly, you could set an object to be a random direction and then have one event for each direction creating a different object but that is jut complicating things.

    Because when the "randomobject" variable is 1, it creates"object1"; if it's 2, it creates"object2"; if it's 3, it creates"object3" I don't want to write such a long and cluttered code. There should be a shorter way to do this.

    I think what "Phi" suggested might work.

  • yes it is a little more optimized but it adds an additional list extension in the scene which makes the EXE bigger.

    mais jeux en flash fait avec mmf :Please login to see this link.

    les video du projet controleur des jeux flash,htlm5,EXE,sourie avec le telephone comme manette :)
    VIDEO Please login to see this link.

    VIDEO Please login to see this link.

  • Oops, sorry, I didn't see the other message on the forum, it's a list with students.

    mais jeux en flash fait avec mmf :Please login to see this link.

    les video du projet controleur des jeux flash,htlm5,EXE,sourie avec le telephone comme manette :)
    VIDEO Please login to see this link.

    VIDEO Please login to see this link.

  • Thank you, but I think what phi says is better optimized.

    My methods aren't necessarily the best, they're just the simplest to comprehend. Optimization comes as a last resort once product specs are fully lined up with practice - plans alone often isn't enough.

    For example, another method is a big string with # between them, you use string tokenizer to split the string then return a random element number. It's not efficient, but it might be better than a list, but not more readable.

    Use the most efficient method you understand fully, and expand what methods you don't know; if you don't understand something, leaving it unknown is an unusable tool in your toolbox.

    Later, if your app has performance issues, you can run the CF2.5+ profiler or whatever else to cut things down. Run speed is important, but the amount of timer the coder takes to develop it is important too. You want the least amount of code running at once, but not at the cost of create/edit comprehension or edit difficulty.

    Darkwire Software Lead Programmer (C++ & C#)
    Please login to see this link. | Please login to see this link. | Please login to see this link. | Please login to see this link.

Participate now!

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