[SOLVED]How do I randomly spawn things

0 favourites
  • 11 posts
  • I want to know how to spawn things very random, meaning that I want them to spawn at a random time and a random distance from each other. I have been playing around with it and I can't figure out a way to do it, but if there is someone out there who can show me or give me a tutorial or even a guide please do.

    Help Me

  • Here, try these tutorials out.

    https://www.scirra.com/tutorials/383/ra ... -intervals

    https://www.scirra.com/tutorials/456/ra ... off-screen

    https://www.scirra.com/tutorials/566/sp ... ntra-style

    I think they should help you achieve what you want. Post a capx of your attempt if you can't get it to work and we'll try and troubleshoot it. I typed in "spawn random" in the tutorials page and found those 3. There are probably others and probably different combinations of words you can use to find others too!

  • Thank You for the help dude I'll go and check them out

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Here, try these tutorials out.

    https://www.scirra.com/tutorials/383/ra ... -intervals

    https://www.scirra.com/tutorials/456/ra ... off-screen

    https://www.scirra.com/tutorials/566/sp ... ntra-style

    I think they should help you achieve what you want. Post a capx of your attempt if you can't get it to work and we'll try and troubleshoot it. I typed in "spawn random" in the tutorials page and found those 3. There are probably others and probably different combinations of words you can use to find others too!

    Thank you dude tutorial No. 2 worked sorta <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy" />

  • Here, try these tutorials out.

    https://www.scirra.com/tutorials/383/ra ... -intervals

    https://www.scirra.com/tutorials/456/ra ... off-screen

    https://www.scirra.com/tutorials/566/sp ... ntra-style

    I think they should help you achieve what you want. Post a capx of your attempt if you can't get it to work and we'll try and troubleshoot it. I typed in "spawn random" in the tutorials page and found those 3. There are probably others and probably different combinations of words you can use to find others too!

    mega.nz ... L4MZ60XDew

    here is the file of me trying to do stuff

  • Tried but I can't download the file. Try dropbox or google drive maybe?

  • Tried but I can't download the file. Try dropbox or google drive maybe?

    Alright here's the dropbox:

    dropbox.com/s/jll5xj0j9pbyr41/Random%20Spawning%28Demonstration%29.capx

  • I have seen your capx, but i do not understand what you try to do.

    So, let me tell you some basics.

    Lets say we trow dices. Now the randomness depends on how much times you try.

    So if you really want true randomness, the you got to try a lot. To do this in c2, try this.

    Global variable 'timer' ... number .. = 0

    Global variable 'Pick_Ups' .. number .. = 0

    condition > system > every tick

    action > system > set value ... variable = 'timer' ... value = floor(random(1,5))

    action > system > set value ... variable = 'Pick_Ups' ... value = floor(random(4,31))

    condition > system > every x second ... interval=timer

    sub condition > system > compare two values ... 1st value = Pick_Ups .. = .. 2d value = 5

    condition > system > once while true

    action > create on random places

  • I have seen your capx, but i do not understand what you try to do.

    So, let me tell you some basics.

    Lets say we trow dices. Now the randomness depends on how much times you try.

    So if you really want true randomness, the you got to try a lot. To do this in c2, try this.

    Global variable 'timer' ... number .. = 0

    Global variable 'Pick_Ups' .. number .. = 0

    condition > system > every tick

    action > system > set value ... variable = 'timer' ... value = floor(random(1,5))

    action > system > set value ... variable = 'Pick_Ups' ... value = floor(random(4,31))

    condition > system > every x second ... interval=timer

    sub condition > system > compare two values ... 1st value = Pick_Ups .. = .. 2d value = 5

    condition > system > once while true

    action > create on random places

    Thank you for the help I tried your idea but ya know mines sort of better in a way

    You see in mine I set the objects to spawn at a random time and place and it never stops

    But with yours it only spawns the object once because of the trigger once while true condition

    thanks for the help though

  • Yours spawns 2000 objects (as long as the value is 5), wich is a rare case, because of the 'add'.

    Mine 'we mine means' spawns once when the value is 5 and then not till it is again 5, that is what 'once while true' means.

  • Yours spawns 2000 objects (as long as the value is 5), wich is a rare case, because of the 'add'.

    Mine 'we mine means' spawns once when the value is 5 and then not till it is again 5, that is what 'once while true' means.

    Oh sorry I forgot to tell you that I changed my conditions in Construct 2 so the one you downloaded is now different from the one on my computer. I just didn't feel like re-uploading it I'm lazy

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)