Posts by Sumo

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.

    The array method has only one copy of every object in your game frame which keeps resources down to a minimum and will only create an object when needed.

    If you created a layer for each level, it will add all of the objects for each level together within one frame so you will eventually hit the object limit of 20,000. It would also be a waste of resources. I don't think you can edit the "create at start" property within the event editor so all objects would have to be created at start which messes with your global objects being ported to the next frame. There's not much control.

    A major thing to consider is that you lose the functionality of copies or instances of actives. While in a normal level it would be easy to quickly copy ground objects in a row as instances so they reference the same active object, you can't do that if you want their alterable values to be unique if they record their positions. So that means your object count will quickly get out of hand if every wall and floor object has to be a unique cloned object.

    You can run some tests yourself having multiple global objects on different layers on the same frame. Try adding instances and clones to see if there's a difference. To me though it seems like a roundabout method for loading levels when arrays can already streamline the process with a single fastloop for loading if you use the mod function.

    I'm pretty sure no fonts came with Fusion, it's just reading the fonts that are already installed on your PC. If you installed custom fonts they would also appear when you edit a string font settings.

    If you want to ensure the font are read correctly you can pick from the "web safe fonts" list. Please login to see this link.

    If you use a custom font just make sure you actually bought it if it's a commercial font and you have the rights to use it. If you want to make sure that font is always shown correctly on peoples' computers even if they dont have that font installed you can embed the font.

    Please login to see this link.

    The whole point of using arrays for loading is that you read the data externally so you can cycle between levels easily. If you're already going to build the levels in Fusion regardless then there's no need to have a separate level editor frame and a game frame if you're not going to save the levels externally. The only difference for you being that you wouldn't have to copy the code between levels, since the main engine code would be in one frame? But you would still need to have separate frames per level if you make multiple levels.

    So the main difference between an array method and your global object method is the number of frames in your game. An array method only uses one frame and will load the levels reading data from external array files. Your global object method would be copying objects from other frames into your game engine frame. However it wouldn't be a single frame so it's more complicated. Also having multiple levels using the same global objects could get messy, especially with instances of objects. It just seems like more of a hassle that way when you go past one level.

    Arr files aren't easily editable like text or ini files. From what I've tested they only really work in Fusion apps that use the array object. So for added security you could encrypt files with the Blowfish object to make sure no one can easily edit them further.

    Arrays are best for loading levels because they can easily be mapped to a grid system if it's tile based. Even if it wasn't tile based, you could use the array like a glorified list object saving data of every object in a level including positions, alterable values, flags, etc. All you would need to load your level is to use a few fastloops to go through the array to read the data and load all the objects.

    The background objects don't have to be actives. You can use the "add backdrop" action to place an active as a backdrop, then destroy the active.

    The main use of arrays is also to save and load the levels externally as arr files. So you can quickly build levels using a level editor and instantly import them into your game.

    As a level editor example file, having the first frame the editor and the second frame the testing frame, global objects could work. But in your actual game that's not how it's going to work. You won't have the editor in your game. You'll just have one frame that loads data from your levels externally using arrays. So there's no point in using global objects in your actual game.

    I would say try and run some performance tests with fastloops on your target device to see how it'll hold up. How many fastloops do you plan on using and how often do you plan on running them? It depends on what you're going to use them for. If it's something like a complicated custom pathfinding widget that has to check hundreds of tiles each loop, then yeah it'll lag on a phone. But if its not something crazy like that, then I think it'll be fine.

    And yes the main difference between fastloops and regular loops is that the runtime is paused, the fastloop events are only triggered, and the screen will only redraw until the fastloop finishes. So for small stuff, you might not think there's any difference between fastloops and normal loops. However for more advanced stuff in which you want to load a bunch of stuff quickly or do a bunch of calculations instantly, it's very useful.

    The amount of times the game loops through your code is tied to your FPS of the game. So if your game is running at 60 FPS, Fusion will loop through your code 60 times a second (the always condition). On the other hand you can run way more than 60 fastloops in a second. So if you need to do a lot of code instantly, such as loading a huge level by reading from an array, fastloops will let you do that.

    To demonstrate this point, I'll share a file I made as a randomized world example for a game jam that I was in. The file runs around 3000 fastloops at the start of the frame and it runs instantly. There's fastloops for randomizing land or water, checking coastline edges of land to switch tile animations to smooth it out, reading a perlin noise map for biome temperatures, drawing the map, spawning events, adding in nature, etc. Obviously this wont work well on a phone, but as an example there's no way I could do something like this without fastloops without having the player wait for stuff to generate for possible minutes instead of instantly.

    I'm confused as to why you're using for each loops this way. For each loops will run loops equal to the number of copies of an instance of an object and cycle though each instance individually. So if you had 3 copies of your Active, it would run 3 loops, one for each Active. Then it would scope each Active specifically. Previously if we wanted to target each Active individually we had to use a Spread Value ID and compare a fastloops index to that ID to single each one out.

    There's no reason for you to use for each loops for function calls, regular fastloops do what you want. The only reason for each loops would be useful here would be if you need to cycle though each copy of your active.

    As to why it doesn't work, it seems like there's a problem with the group activation/deactivation in conjunction with the for each loops. As you noticed in your other examples if you put the activation/deactivation on separate lines it works as you would think. I don't activate/deactivate groups often so I'm not sure exactly as to why it works like that. Maybe someone else can give some more insight for that. The only difference in my mind between for each loops and fastloops would be object scope so maybe that's doing something.

    I'm making a flexible inventory system. It's a grid-based system that snaps items to the slots in the grid and has strings below the slots showing the item names. I have a bunch of variables that I can adjust like number of rows, columns, slot size, padding, etc. I have it set up so that it matches an array file. So every slot in the grid of the inventory represents a cell in my array. When I move an item around the inventory, I record the item name in the array. Then when I want to load the array file, I would start a fastloop to go through the array and check the cells to see if there's a name written. If so, use that name and the "create object by name" action to create the appropriate object.

    I'm having difficulty trying to destroy all the items in the inventory and clearing all the strings before loading the objects. All the inventory items are in a qualifier group, so I thought I could just destroy the qualifier group and set the string to nothing, since all the strings are instances so it would affect all of them. But when I try to do that and then load my array, I'm getting weird results. Only one of the objects is destroyed and another object doesn't seem to load. I tried checking the array file and it seems to be writing to the array fine. So I believe there's something wrong with my loading.

    I've attached my .mfa file, so hopefully someone can help me out. Thanks.

    Here's an example I made awhile back. It sets the camera to a midpoint position between the player and the mouse, but it can be restricted to a set distance away from the player. In this case you could replace the camera object for your custom mouse object to restrict the distance away a player can reach from the player.

    There is a mouse object that can set the actual mouse X and Y positions, so restrict them using that object, setting the positions to the position of the camera object if the distance is past your max distance value.

    I made a simple two line example to test the Direction value expression. When I press spacebar it randomly chooses one out of 4 directions (all 4 directions have different animations). However a counter always set to the Direction value doesn't switch from zero. Can anyone explain to me why the direction value doesn't change? It should change to either 0, 8, 16, or 24.

    I'm trying to record direction values in a level editor and it doesn't seem to change from zero.

    Interesting, so I did test it with scale and angle changes and you're right they're not carried over to the paste of the active. The colors do seem to translate to the added backdrop at first, but if you keep doing ReplaceRGB actions to your active, it can affect the backdrops as well.

    Save background was enabled for the active. Turning it off doesn't seem to do anything.

    I want to make sure this is a bug and I'm not understanding something incorrectly. I use the ReplaceRGB action in an active to switch a color from green to yellow. Then I add that active as a backdrop. I recorded the new color RGB values in a string and read from that string to do another ReplaceRGB to switch it back to the original green color. However when I do the ReplaceRGB a second time, the backdrops disappear from the frame. Doing another ReplaceRGB and making it yellow again makes the backdrops reappear.

    It seems like every time I do a ReplaceRGB, added or pasted backdrops either disappear or reappear. I would like to just make the active switch colors while keeping the backdrops static. I've attached a small example file along with this post.

    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.

    is "get event condition ID" a global string? It seems like it since there's no reference to an Active's alterable values or strings and you're converting it to a value using Val(). If you click on your application name you can set your global values and strings there within the mfa file. But it will only be recorded to global value A at the start of frame.

    You can always set a counter to global value A to see the value in game or you can check the debugger while the game is running to check the global value.