Need help making my player a global object

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.
  • Hey everyone.


    I have a simple game setup where I have a player object on 1 frame.

    When this player object comes in contact with any object with a 'Obstacle' qualifier, the player will not be able to pass through it.

    I gave the 'Obstacle' qualifier to all objects I don't want the player to pass through.

    This works fine.

    Now I want the player to jump to a new frame when it touches a door object I've made.

    Here's the problem.


    I would like to make it so I do not need to copy the player object over to another frame because it would copy all the events.

    That's fine, but this would mean that if I decided to add more movement options to my player's events, I would need to go to every frame with the player object and manually copy and paste the added events to the player object on each frame.

    As you can imagine, this seems tedious and inefficient.


    I tried cutting and pasting the player's events into the Global Events so I would need to modify the player's events only once, but I got an error saying:


    Paste error

    Cannot paste the events: the origin events contain references to a qualifier.


    I understand qualifiers aren't compatible with Global Events, but I really need a method of having the events of my player stored in one place where I can modify them once and have the changes affect any frame where the player object is in.


    Any suggestions, tips, or answers are very much appreciated! :)

  • welcome to "no qualifier in global events" club.
    how to solve:
    1. Use 1 frame-based games with level editor.
    2. Use array to store values. (Positions, layers, HP, coins etc.)
    3. Here a trick. Put into a frame active object and rename it EXACTLY as qualifier name. (Contains a bugs)

    personally i prefer 1st method.

    Please login to see this link.

  • welcome to "no qualifier in global events" club.
    how to solve:
    1. Use 1 frame-based games with level editor.
    2. Use array to store values. (Positions, layers, HP, coins etc.)
    3. Here a trick. Put into a frame active object and rename it EXACTLY as qualifier name. (Contains a bugs)

    personally i prefer 1st method.

    I might go with method 1 as I don't quite understand how I'd go about method 2, and I've heard of method 3 but I don't want to use bugs as they may be patched out fairly soon.

    Are these really the main methods people use? I should be able to do method 1 no problem but this feels a bit strange as I feel I could manage multiple frames far easier.

  • it's all because you can't use qualifier in global events or behiavours. You're right about managing level in frame editor is quite easier and faster, but, as i said, if you have a lot of frames(each frame is level) you'll soon get annoying with saving and opening your project (it's take time relatively of your level count and object count within)
    * also i didn't sure about that Clickteam Fusion re-use objects in different frames, for example, when you compile your project it will cost size of your application.
    ** also i think
    knowledge acquired when doing the level editor is useful, especially working with arrays and managing data.

    Please login to see this link.

  • it's all because you can't use qualifier in global events or behiavours. You're right about managing level in frame editor is quite easier and faster, but, as i said, if you have a lot of frames(each frame is level) you'll soon get annoying with saving and opening your project (it's take time relatively of your level count and object count within)
    * also i didn't sure about that Clickteam Fusion re-use objects in different frames, for example, when you compile your project it will cost size of your application.
    ** also i think
    knowledge acquired when doing the level editor is useful, especially working with arrays and managing data.

    I see what you're saying, although I'd still prefer longer loading time on my project when using multiple frames (1 frame per room) over using 1 frame for every level.

    It just sounds so complicated to me, having certain things disabled, other things enabled, layers constantly being turned on and off.

    I guess I'll do some more research in the mean time around the forums and through examples if I can find any.

    If I can't find any better options I'll go with option 1 and lookup methods of doing that.


    If anybody else has any other methods/ideas to share with me, please do so :)

  • You could just put all your player code within a group using qualifiers to simply everything, then copy that group of code to your other layers. Also if you check the property "Global" in the active, it will retain all the alterable value and string information between frames if you have the same active across all frames.

    Of course the 1 frame method is probably the most efficient and optimized way, but it requires a lot of planning ahead with level design using level editors saved in arrays for example. The method above is simpler but if there's any changes to your player code you would need to update it within your other frames. However copying and pasting a group of code isn't too bad. Once you copy the group, you would only have to paste it once within each frame which would only take a few seconds.

    I would only start to build levels after I'm sure all my main player mechanics are designed correctly.

    Custom A* Pathfinding in MMF2: Please login to see this link.
    Random Tile World Generation: Please login to see this link.

  • You could just put all your player code within a group using qualifiers to simply everything, then copy that group of code to your other layers. Also if you check the property "Global" in the active, it will retain all the alterable value and string information between frames if you have the same active across all frames.

    Of course the 1 frame method is probably the most efficient and optimized way, but it requires a lot of planning ahead with level design using level editors saved in arrays for example. The method above is simpler but if there's any changes to your player code you would need to update it within your other frames. However copying and pasting a group of code isn't too bad. Once you copy the group, you would only have to paste it once within each frame which would only take a few seconds.

    I would only start to build levels after I'm sure all my main player mechanics are designed correctly.

    Okay well I'm a bit new to this part of Fusion Game Development so I'm going back and modifying almost everything as I go.

    Thanks for the tip on the 'Global' active object though, I think that will come in handy.

    Also, I don't really know about this whole level editor things where it's stored in an array. I would really like having a place to store my player code and I think I would get lost if I had all of my code in one single frame.

    Is there really no other way? To me having a few objects + the player object in one frame and having different objects + the player object in another sounds more simple to manage.

    I can imagine that being far easier than having to constantly enable and disable layers.

    Also I see what you mean by copying a group to be easy. It's really just one item that goes to each frame and that could be a good choice, but it just sounds like a waste of resources and un-organized.

    As I said I change my events all the time so it's really hard for me to build levels afterwards.

  • Just adding another little idea,
    you could also consider not using qualifiers (though I love them and use them everywhere XD),
    this could be or could not be a pain, depending on your setup,
    but if you need to have "different kinds" of objects behaving with "same mechanics",
    you could put all the "different kinds" in the same active,
    so it would be different animations x same active object
    instead of different actives x same qualifier

    and of course active objects can be used in global events

    If you don't want to go single-frame, and don't have dozens of frames, I often find that copy pasting group in the end is not that dramatic..
    just make sure you always update all of your frames everytime you modify the group, or keep a revision number in the group so you are sure you always work on the latest group

    Don't know of other ways than the ones already mentioned.
    But 99% sure reading Fusion3 is going so provide much more flexibility for this :)

    a selection of my Fusion examples can be found Please login to see this link.

  • No Qualifiers, hmmm.

    That sounds really difficult. I took a stab at it and it's making my code a lot more complicated, but I think it might work out.

    I'll have to continue working on it and see how far it goes. I'll get back to this forum later tonight.

    Thanks for the suggestions! :D

  • I'm trying so hard to not use qualifiers but it is creating all sorts of bugs that weren't there, and I believe finding another way would save me more time then it would take to re-write loads of code :(

    I had it so when my player spoke with a piece of paper on the floor, they would have the option to pick it up. If they said yes, the object would be deleted and the player could now proceed with the rest of the adventure.

    Since it's not using the 'Obstacle' qualifier anymore since I want this object to be able to have a 'Behavior' so it will work as is on any frame, the player freezes in place once the game destroys the piece of paper object.

    I believe this is related to the player events that check to see if the player is allowed to move. One of the events is:

    If 'Navigator' (the object the player follows) isn't overlapping:

    Wall
    Wall2
    Table
    Piece of Paper


    I don't know everyone, there has to be some other way that would save me from needing to go back and change so many events and fix bugs.

    Any other ideas? I just want 1 frame per room without needing to duplicate the player's events on to every frame :(

  • 99% sure there's no way other than the ones mentioned, I'm sorry :(

    Fusion is great and has very few shortcomings, but sadly this is one of them
    (code reuse through frames + support for qualifiers)

    If you strictly need qualifiers, and don't want to go single frame, or use "hacks" (I never tried that, don't know),
    copypasting shared group of events is probably the simplest way

    a selection of my Fusion examples can be found Please login to see this link.

  • 99% sure there's no way other than the ones mentioned, I'm sorry :(

    Fusion is great and has very few shortcomings, but sadly this is one of them
    (code reuse through frames + support for qualifiers)

    If you strictly need qualifiers, and don't want to go single frame, or use "hacks" (I never tried that, don't know),
    copypasting shared group of events is probably the simplest way

    I'm hoping Clickteam Fusion 3 will have Global Qualifiers sorted out.

    In the mean time, I guess my only option I'm currently comfortable with is going to be copying and pasting Event groups.

    Single-frame development is scaring me because of camera angles. I'd like a static camera in-doors, and a camera that follows when the player is outside.

    I'd like this thread to stay open as I will be open to any other suggestions others may have if there are any other methods somebody has to share.

    Thanks schrodinger!

Participate now!

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