How to 'pick' one of many for use as active object later? (create? swap? save/load?)

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.
  • Imagine frame 1 is a game-creator (you pick a player of 6 & a weapon of 3). Click 'go' and the next frame, that's what you play with.

    How do you do that? [I thought of making all players Global, then setting Global Value A to the fixed value, then SOMEHOW creating that object making the Global Value A...].
    What I don't want to do is create IF-code for each of the players in case they were chosen [same player code x 6 and same weapon code x 3 - NOT efficient].

    Thanks for any assist.

  • Unfortunately to create objects normally in such a fashion if they are not created you need IF-code.

    Or have the objects precreated(ticked create at start) and just pick the ones from those chosen ones, and destroy or inactivate the rest.

    You might also want to check out the create by name extension for more functionality when creating objects.

    My signature is the awesomest!

  • Sky: thanks. Precreating is no problem. But how do you 'select' the one from a set to use as your character, so that you code the 'character' only once.
    Effectively:
    var character = characters[indexChosen];
    (if character collides with ... then)...

    instead of:
    (if character1 was selected and collides...)
    (if character2 was selected and collides...)
    ...etc...

    thanks

  • jimgale - you could do this one of two ways, either assigning an ID value to the character1,character2 active and comparing through conditions only once or the most manageable way would be to put the characters into a qualifier. You then just do collision detection and everything else via a qualifier as opposed to each active object.

    Game Launcher Creator V3 - Please login to see this link.
    Bespoke Software Development - Please login to see this link.
    Learn Clickteam Fusion 2.5 - Please login to see this link.

    Danny // Clickteam

  • Excellent help -> thank you - didn't know those existed. Will be useful.

    When the 'chosen' character (player qualifier) is selected, I set a flag which allows for proper event handling.

    Only thing I'm wondering now is how to utilize ONLY the one I want on another frame (scoping really). Do all characters get Globally created then hidden if their flag is off? or do I recreate a character matching an id I save on the next frame. I likely don't want to destroy the flag-off characters as the user may want to nav back to the choice page to reselect.

    I'm happy to look up the right information on this - all I need is a keyword to track down to understand the best approach.

    Thanks,

  • Hey Jimgale,

    Glad it was of help, with regards to what you just said, sorry I don't follow 100% what you mean. The characters will all be created at the start of the frame if 'create at start' is checked. What I would do is, uncheck create at start for all player characters, check at start of frame which character was selected then create it in the frame.

    Game Launcher Creator V3 - Please login to see this link.
    Bespoke Software Development - Please login to see this link.
    Learn Clickteam Fusion 2.5 - Please login to see this link.

    Danny // Clickteam

  • Danny: Yep, definitely helpful. What I mean is to carryover the specific character as THE (chosen) character to the next (or another) frame. If I have 6 characters (of which one is selected), do I need to keep all 6 alive, but 5 hidden, OR create a character by ID (of the same one selected in the previous frame?), etc. Make more sense?

  • I think so, yes you would create by ID. Let the user choose the character in the previous frame and set a global value then on the next frame create the character based off that ID...

    Game Launcher Creator V3 - Please login to see this link.
    Bespoke Software Development - Please login to see this link.
    Learn Clickteam Fusion 2.5 - Please login to see this link.

    Danny // Clickteam

Participate now!

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