Posts by MuddyMole

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.

    That is an excellent article, but still doesn't fully explain things.
    ForEach loops, while weird, are perfectly consistent. Fusion will store the current scope as soon as it encounters a "Start loop for each..." action, then process all other actions in the same event, and then finally go back and process the ForEach loop, but using the stored scope.
    Fastloops are not so consistent - or more precisely, if you start a fastloop, and then have other actions coming afterwards in the same event, the result can be unpredictable. But that can easily be avoided by simply splitting the event into two sepaate events.

    Nice.
    But on a side note, I will never understand why anyone would use the Event Editor - the Event List is just plain better.
    I swear Clickteam only did it to make their tools seem more friendly for beginners, when looking at screenshots (Look! No coding required! You just need to tick some boxes and everything will magically work!). A bit like the step-through editor, really...

    I've fixed a silly bug that made it try to save both a text and number array, so it should be working properly now if you re-download.
    There is a readme.txt file included, which you will need to read, as it contains usage instructions, including very important information about how you grant permission for it to access your Zoho account.

    A quick demo video: Please login to see this media element.

    Note that the above method only works because, by default, Fusion layers objects in the order they were created, and when using an object's fixed value (or any other property) to set any single value (such as the global value here), Fusion will also always pick the most recently created instance of that object (out of those which meet the other conditions - in this case, being under the mouse pointer).

    If you use events to change the display order of the objects (bring to front, send to back, etc), this will no longer work correctly, because the display order will no longer match the order of creation.

    A better solution, in that case, would be to use the Layer object, which would allow you to reliably solve the problem, without any extra events:

    + User clicks with left button on [Active]
    + Layer Object: [Active] At front?
    -> Active: Destroy

    Zoho Sheet is a free, cloud-based spreadsheet app, similar to Google Sheets.
    You can sign up for an account here: Please login to see this link. (I am not affiliated with Zoho in any way)

    I have created a simple, albeit slightly clunky, tool to convert your workbooks created in Zoho Sheet, to CF2.5 array files, and download them to your computer (it can't yet do the reverse, but that is coming). One advantage of this is that it supports 3-dimensional arrays, where the Z dimension is represented by the worksheets within a workbook.

    You can download it here: Please login to see this link.

    Please login to see this link.

    The version for DX11 and other runtimes is there, but there is no "New" version, as there has never been an issue with the shader itself - the issue was always with certain CF2.5 events, caused by an update which meant some things that had previously worked, no longer do (specifically, if a parameter takes a float, you _must_ ensure that's what you give it, not an integer).

    Webp support would currently be pretty pointless. It's still far less widely supported than png, and its only advantage is a slightly reduced file size, which is not really much of a benefit in this day and age - neither storage capacity nor transfer speed are ever going to be an issue (we all have hundreds of gigabytes, if not terabytes, of storage, and superfast internet connections). To benefit significantly from it, you'd need to be a huge corporation, storing and transmitting vast quantities of (image) data - in other words, you'd need to be Google, who not coincidentally, are the ones who created webp and continue to force it on us (like if you try to download a jpg image, Chrome will force you to save it as a webp file instead).

    SVG however, would be really interesting, for a couple of reasons.
    Firstly, it would obviously give Fusion the 2D vector graphics capability that it has always lacked - allowing for infinitely scalable graphics, without the pixelation you get with raster graphics. I wouldn't dismiss vector graphics as being too slow for games - in their heyday, 2D vector-based Flash games were pretty comparable to the games most people are still making in Fusion today, and that was two decades ago (hardware has moved on since then).
    Secondly, SVG images are composed of various elements - circles, squares, straight lines, curves, etc. The ability to select individual component elements (by id or class) and modify their properties, would be hugely powerful - things like skeletal animation, variable sprite skins/items/colour remaps/etc, dynamic text and GUIs, would all become far simpler. For those using Fusion to create applications rather than games, it would also be fantastic for creating dynamic charts, diagrams, tables, etc.

    Here's another simple and purely math-based solution:

    Cx = ((Ax + Bx) * 0.5) + ((By - Ay) * 0.866025404)
    Cy = ((Ay + By) * 0.5) - ((Bx - Ax) * 0.866025404)

    The first part just gives the position of a point half way between A and B.
    An easy way to rotate a vector (in this case, the vector from A to B) by 90 degrees is to invert one of the two components and then swap them, which is what the second part does.
    And finally, the ratio of the length of one of the sides of an equilateral triangle to its height is 0.866025404, so the last part just multiplies by that amount. We can derive that value either by using trigonometry, as Sin(60°), or by using Pythagoras' theorum, as √(1² - 0.5²).

    Theoretically, this method probably ought to be marginally faster, as it doesn't use any trigonometric functions.
    Note also, that there are two valid solutions to the problem, as point C could be to either the left or the right of the line from A to B. The version above is for the first of those, but switching which of the two vector components you invert would give the other:

    Cx = ((Ax + Bx) * 0.5) - ((By - Ay) * 0.866025404)
    Cy = ((Ay + By) * 0.5) + ((Bx - Ax) * 0.866025404)

    You just have to run a fastloop to search for all the other copies of the same value, and delete those as well.

    Usin the List's "find" expression: Please login to see this attachment.

    Or using a slightly different method, that ought to be a bit more performant for very large lists: Please login to see this attachment.

    I made this little example: Please login to see this link.

    Haven't tested it thoroughly, so can't guarantee it doesn't have bugs - you can let me know if you find any...
    It works very much along the lines of what Stiggits suggested, but with a slightly different string structure:
    [5:sword][50:potion][100:herb][75:empty][1:magic sword]

    So basically, it's like you have a big bag containing 5 swords, 50 potions, 100 herbs, etc, and you reach in and pick one item totally at random. There are 20 times as many herbs in the bag as there are swords, so you're 20 times as likely to pick one.
    When you pick an item, you can make it so that it has no effect on the probability of that item being picked again (the item goes back in the bag), the probability is reduced (the item does NOT go back in the bag), or that item can't be picked again (all items of that type are removed from the bag).

    It's all done as a self-contained widget, just using 1 active object, so it'll work in any runtime.

    Excel is a pain.
    The older XLS format is an extremely complicated binary format, so you can basically forget about it.

    The newer XLSX format is really just a zip file, containing a whole bunch of XML files, including the Worksheet XML files which hold the actual data you want.

    Note that Excel can directly export just these Worksheet XML files, so if that's an option for you, it's obviously easier to do that instead of working with the XLSX file. I made an array/Excel converter years ago, which used Excel XML files. I don't remember which is the most recent, but there are a few different versions in my onedrive - Please login to see this link. (note that using the easyxml extension means they need some .dll file to work, which will be mentioned in the help files)

    If you only need to work with single worksheets, rather than multi-sheet workbooks (or can export each separately), then it's going to be much easier to export the data as a CSV file, which is vastly simpler to parse. If it's at all possible, I'd go this route.

    Another option is to load the file into Google Sheets, and then using a script (which can be found online), export the data as JSON, which again can be parsed relatively easily (there's a JSON extension for Fusion).

    Similarly, if you have the Google Sheets spreadsheet stored in the cloud, it may be possible to access the data from it using the API, but likely not easy. I made a web-based tool (ie. written in javascript, not using Fusion) to convert between Fusion arrays and Google Sheets documents, which worked fine, except that Google has incredibly strict requirements for accessing data, so to publish it for other people to use would require jumping through a huge amount of hoops (stuff like recording a youtube video of me describing exactly what data I need to access, and the reason why, etc).

    Using an ActiveX control might be an option too, although ActiveX is considered obsolete these days, and in my experience just crashes Fusion.

    That's right, but instead of using the object's X position, you may want to test the edges of the object - ie. "X coordinate of left edge", "Y coordinate of top edge" etc.
    That way, it'll work if any part of the object's bounding box is on screen, rather than just the hotspot (it's a small detail that may or may not be significant, but with larger objects especially, it makes sense).

    There's no condition to compare those directly though, so you'll need to use the object's "Compare expression to a value" condition (do NOT use "Compare two general values" if there are going to be multiple instances of the object).

    Also, note that if you just say "add 1 to a counter", it will add 1 if ANY instance is within view, but will never add more than 1, even if many instances are within view.
    Instead, set the counter to "Number of selected objects".

    eg.
    * Enemy: X Right( "Enemy" ) >= X Left Frame
    + Enemy: X Left( "Enemy" ) <= X Right Frame
    + Enemy: Y Bottom( "Enemy" ) >= Y Top Frame
    + Enemy: Y Top( "Enemy" ) <= Y Bottom Frame
    Counter : Set Counter to NSelectedObjects( "Enemy" )

    I've never even tried publishing an Android app, but I've still encountered this kind of thing from Google.
    A while back, I spent a fair bit of time creating a very simple little online tool that used the Google Sheets API to convert between CF2.5 array files and Google Sheets files stored in the cloud.
    It all worked fine, until I tried to publish it so that someone other than me could use it, and then they wanted all of this:

    Please login to see this picture.

    Needless to say, that was the end of that...

    I have a small request - a "stop fastloop immediately" action.

    For example:

    + Start of frame
    -> Run fastloop "test", 1 time

    + On loop "test"
    -> Add 1 to counter
    -> Stop fastloop "test"

    + On loop "test"
    -> Add 1 to counter

    The counter will end up reading "2", because the "stop loop" action only prevents the next loop from beginning - it doesn't actually stop the current loop. In particular, if you're creating a the Fusion equivalent of a function, that you call by running a fastloop 1 time, it would be convenient (and more efficient) to have an action to make it stop.

    It's a pain to always have to say something like this:

    + Start of frame
    -> Set thisLoopIsDone to 0
    -> Run fastloop "test", 10 times

    + On loop "test"
    + thisLoopIsDone = 0
    + Some condition...
    -> Add 1 to counter
    -> Set thisLoopIsDone to 1
    -> Stop fastloop "test"

    + On loop "test"
    + thisLoopIsDone = 0
    + Some other condition...
    -> Add 1 to counter

    It seems like it would be relatively quick and easy to implement?

    Yep. I hate to be negative, but there are at least two very good reasons not to:
    1) It's very complicated and requires a huge amount of work, so it will very likely never happen (I'm not aware of even a single finished multiplayer online game made in CF2.5 / MMF2). It's not fun work either - designing the game and creating the artwork may be work, but they're also fun, so even if the project never amounts to anything, you'll still have enjoyed the process. The same cannot be said of multiplayer stuff, which is ultra-tedious.

    2) The chicken and egg problem - noone will play your game, because noone else is playing your game. Unless you're a major studio with an established following, you'd have to put a huge amount more work into marketing and making the game look good.

    I'd say make a single-player game, and if you see it through to completion, and it's good, and you get really lucky, then you'll attract some players and can start thinking about adding multiplayer.