How to create multiple actives set to different directions in one event?

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.
  • Hi, not sure how i'm not able to figure this out:

    I need to create 8 instances of an active object and set them each to 8 different directions in a one or 2 events.

    - You can't just create 8 objects and set each one to a direction since that will make all of them set to the last direction you put in.

    Elegant fastloop solution anyone??

    Everytime I ask for help in the forums, I must help another member in the forums.<3

  • If by 8 different directions you mean the standard eight directions then there are many ways to do this.

    An elegant fastloop solution would be to run the loop "create" 8 times, then on loop "create" to create the object and set the direction of that object to a calculation (the '1+1' button) which is:

    Code
    LoopIndex("create") * 4

    Alternatively, you could have 8 "create object Active" actions followed by a "Spread value 0" action for the object followed by an action to set the direction of the objects to:

    Code
    Alterable Value A( "Active" ) * 4

    More risky (as it might mess up due to some quirk), but you could even do that in one event by doing 8 "create object Active" actions and then setting the direction of Active to:

    Code
    ( Fixed( "Active" ) mod 8 ) * 4

    There are also approaches where an object is launched, e.g. Please login to see this link..

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

    Edited 7 times, last by Joshtek (July 17, 2016 at 1:18 AM).

  • Thank for the quick reply! I originally had your first solution but for some reason I over complicated it and didn't realize it would work by itself. Also, that third solution is genius.

    Everytime I ask for help in the forums, I must help another member in the forums.<3

  • Quote

    Also, that third solution is genius.


    That's the sort of stuff you need to get into if you want to take part in "Make a game in X events" competitions. :)

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

Participate now!

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