Posts by Erkabubben

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.

    I've discovered that one of the most critical functions of XLua's MMFI module - mmf.newObjectClass() - is not working, which pretty much makes the entire MMFI module useless. I was wondering why the example movement engine (the .mfa with the Demon objects) wasn't working, until I noticed that mmf.newObjectClass() was always returning NIL. Other functions like mmf.newObject() seems to be working fine.
    I've updated my version of XLua from Fusion's extension manager, so if there's a newer version out there where this bug has been fixed, please let me know. Otherwise, I'm hoping somebody can take the time to fix this. XLua's source code is Please login to see this link.. It's very frustrating because XLua and the MMFI module has so much to offer, but much of it's potential is wasted if mmf.newObjectClass() isn't working.

    Please login to see this attachment.

    The file mmfi.dll must be placed in the same folder as the example .mfa for it to work.

    I've been using Clickteam Fusion since my childhood, but I'm at a point now where I want to learn scripted coding, so I've started to use the XLua object and its included MMFI module. I want to program a game engine where I have full control of all CF objects from XLua, and I'm hoping a more experienced programmer can offer som advice on how to set it up.

    The MMFI module seems to offer very few object-specific functions. It says in the help file that "third party modules can add specific support for other objects", but so far I haven't found any. So my solution right now is to set up functions in XLua and the Event editor that allows XLua to indirectly control my favorite objects - I'm starting with the Active System Box, and then the Named Variable object. I'm setting up a system so that when a new CF-object is created, MMFI sets up a corresponding Lua object table with the mmf.NewObject function, and then my object-specific functions are added automatically to the object table. Below you can see what the code looks like in Lua and the event editor.

    Please login to see this attachment.

    What I'm mainly concerned about is wether this solution will eventually cause a massive build-up of registered functions, since every time a new object instance is created, a new set of instance-specific functions are registered. So if there are 1000 object instances on the frame and every object instance has an average of 30 functions, that will result in a total of 30 000 functions. It would make sense for the functions to be specific to the object class instead, but it seems like MMFI's functions are stored in the object instance's table.

    It would be great if a more experienced programmer could advice me on how to proceed with this.

    I'm trying to figure out the best way to set up the AI behaviors for the NPC:s in my game, but I keep running into problems because the different NPC instances gets mixed up. So, for example, an enemy designed to just move back and forth on the ground like a Goomba may start spontaneously flying when a flying enemy is spawned.

    As it is now, I have set up the AI events in the following way:

    1) Once an NPC is created, it's given a unique ID value, and one of its alterable strings named "Main AI" is set to the name of a specific AI routine, for example "Ground Pacing".

    2) On every frame, a ForEach loop called "AI" is run on the NPC:s. If the NPC:s "Main AI" is different than "", a function with the name of the AI behavior is triggered (so, in this example, "Ground Pacing".)

    3) Here's where the problems with my method start, because with each event in the AI function, I have to limit the scope and specify which NPC instance should be affected, by refering to it's ID value. Each NPC instance also have a sprite and a PMO object assigned to them, so I need to limit the scope on those objects as well on every event that affects them. If I forget to limit the scope on just one single line, it will result in bugs like the unwanted flying enemy.

    4) The first time the Main AI Function is triggered, a sub-function called "AI Setup" is triggered, which sets up the initial values of the AI main behavior, and assigns a sub-behavior. Then, another sub-function is triggered, named from the main behavior and sub-behavior, separated by a "/". For example: Ground Pacing/Walking Left.

    5) In the sub-behavior function, movements and actions of the NPC are triggered, and checks are made to see if the conditions are met for changing to another sub-behavior.

    So, my problem is: how do I limit the scope for the affected objects, without having to do it again and again, in every single event of every AI behavior I program? Is it possible in any way to, say, limit the scope for the NPC object, sprite and PMO in the first event of the Main AI function ("Ground Pacing"), so that it keeps the scope in the following events and sub-functions?
    Or, does anybody ave any other suggestions on how I can set up the AI behaviors differently to avoid the problem?
    I'm dead tired of the constant bug testing and having to copy/paste the "ID of 'NPC' = Current NPC ID" event all over the AI code.

    I figured out a workaround:
    I used the method described in this thread Please login to see this link.to get the top-left coordinates of the client area, and subtracted the coordinates of the application window, which I got from the window control object. I then added these values (the difference between the client area and the application window top X/Y) to the Area Origin, and set the Screen Capture object to Capture Active Window. Works perfectly.

    I think you're out of luck here using fastloops. The Screen Capture object only captures what's actually drawn to the screen, so you can't really use it in fastloops, as fastloops runs between screen updates. The framerate controls how often the screen is drawn, and you can't force the screen to update faster than the framerate. What you can do however is to make the framerate very high, say 500 frames a second, or as fast as the computer manages. That would give you 500 opportunities to capture the screen each second. If you capture the first 5 screen updates, all would be displayed on screen, but since the human eye can only register 60 frames per second, no one would be able to see more than one. I have tested it and it do work!

    Thanks, yeah it's not a perfect solution but a good workaround. I've finally managed to almost get it right - I had a lot of problems with the screen capture lagging behind one frame since the Capture Frame caused a singificant framerate drop. For some reason this only happens you choose Capture Frame. Using Capture Screen is somewhat faster and Capture Active Window is super fast in comparison, but then the Area coordinates get completely messed up. Do you have any idea why this is, and if there's any workaround?

    From what I understand, the screen is redrawn at the end of the event list. But is there a way to force the screen to update from an event? The reason I'm asking is because I want to use a fastloop and the Screen Capture object to capture an area with some Actives, re-position the Actives and repeat, so that I will get, say, five different pictures with the Actives in different positions. However, since I don't know of a way to force the screen to update, I end up with five duplicates of the same picture, with all the Actives in their original position. Does anyone have a solution for this, or do I have to find a way to split up the screen capture process over several frames? My project uses Direct3D 9, if that makes any difference.

    Hello.
    I'm in the process of designing an animation tool to create characters for my latest game project, similar to the Fusion Character Animator. Like the Fusion Character Animator, my tool draw and angle images of different body parts on top of an animated skeleton.
    I'm now trying to decide how to bend the body parts around joints. The ideal solution would be to be able to bend the image at runtime, so that, for example, an arm image is bent at the elbow joint, and a triangular shape is automatically drawn to fill in the empty gap at the elbow.
    I realize that this is a complicated request and I'm not expecting anybody to come up with an easy solution for me. It would just be interesting to hear people's ideas on how to solve this.

    I'm building my first Physics platformer, and I'm having a problem with the Physics platform movement. When the Player Active moves over a series of background objects, the Player Active keeps making small, spontaneous skips. When moving back and forth over a Quick Background, there's no skips.

    Please login to see this attachment.

    In the example mfa, the movement is perfectly smooth while moving over the grey Quick Background, while the skipping starts when you move the Player Active down to the purple blocks, which are multiple 32*32 backgrounds.

    I use a level editor to create my levels from 32*32 pixel blocks just like the purple blocks in the example. How do I get rid of the annoying skipping? I imagine pretty much anyone using the Physics platform must experience the same problem, but I haven't found any thread about it in the forum.

    From what I understand then from Please login to see this link., MMF2 would iterate through all the FastLoop-events when a loop would be called, while CF will only iterate through the ones with the name of the loop.
    However, I'm still unsure whether this applies to all green event conditions - for example, will calling a function with the Fast Function object make CF iterate trough every Function Trigger-event and check their name, or will it immediately find the right Function Trigger events? Does anyone know?

    I've noticed that when saving/loading data to the Named Variable Object in its own thread, the "Done Loading" and "Done Saving" conditions won't trigger if another Named Variable Object saves/loads data using the other method while the saving/loading is in progress.

    I know the Named Variable Object isn't a Clickteam extension, but should I still post this to the bug box? It would be great if somebody could do something about this, since this bug pretty much makes the object's function of saving/loading in its own thread useless to my project :(

    I'm working on a game that uses very large, seamless levels. I've achieved this by only drawing the objects that are on-screen. The objects are created from the information stored in several smaller arrays, which are loaded into a larger array as the screen gets closer to their corresponding areas. So far, the smaller arrays have been split into 10x10 cells each. The problem is that this causes a small delay with every tenth cell that the screen passes by, so now I'm thinking of decreasing the size of the small arrays.
    It seems to me that to minimize the delay as much as possible, I should decrease the size so much that each array file instead only stores the information of one cell. Since every "subdivision" of my levels is 100x100 cells big, and I expect that the game will contain hundreds of these, this would result in millions of files.
    I can imagine that there would be disadvantages to having such large numbers of files in the finished game. Does anybody know?

    I've had some problems recently using the File object, and more specifically the "File exists" condition. For some reason, on some events where I want my application to check wether a file exists, it acts like the file doesn't even though it clearly does. I've tried referring to the file using an absolute path rather than a relative, and also doing a workaround by using the List object's "Load Filelist" and then comparing the amount of results, but the problem remains. Moving the event out of a FastLoop seemed to solve the problem on one instance, but it still frustrates me to not know the cause of it.
    Does anybody have any idea why my application is behaving this way? I've double- and triple-checked my code and all I can think of is that there's some kind of bug in Clickteam Fusion.