How can I randomly create objects from a qualifier?
I want to randomly create active objects. Is it possible to do this in a short way without using random number values?
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.
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.
-
sorry phi, he said getting a random while not using a random number LOL
-
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.
-
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.
-
Is it that ????
Please login to see this attachment.
-
Bonjour
Autre exemple tout simple
Hello
Another simple example
-
Bonjour
Autre exemple tout simple
Hello
Another simple example
Thank you, but I think what phi says is better optimized.
-
yes it is a little more optimized but it adds an additional list extension in the scene which makes the EXE bigger.
-
Oops, sorry, I didn't see the other message on the forum, it's a list with students.
-
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.
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!