# Posts by airways

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.
• ## PocketBase for Clickteam Fusion

As someone requested, I have uploaded the extension to my itch.io page since the Clickstore has been unavailable for a little bit:

• ## How to not get buggy object layer sorting when having some objects that should overwrite layer sorting?

It's more about how many objects are on a single "row":

Linky's example is what is known generally as "packing a 2D array into a 1D array" (well, or many other variations of that phrase).

Here's an article about it with pretty easy to read code in Python: Please login to see this link.

Basically it boils down to:

1) Know how many things ("columns") can occur in each "row" (in this case, the "row" is a single exact Y pixel-position); if you need 1,000 objects on one "row", you need to define the width to be 1,000 "columns"). This width is does not have to be width of the screen (although this is easiest and is what I've outlined below more or less; if you don't need 100% accuracy you can use fewer values by dividing the width of the screen by 10 for instance, but the rest of the math gets a bit trickier).

2) Define the length of the final array (this isn't needed in the pure numerical example in your case, but it is helpful to know what the highest possible value would be): this is always the number of rows * the number of columns in each row.

3) Find the range of positions that represent the row for a given object:

Y-position-of-object * width
which would be:
Y( "Group.Friends" ) * 1280

4) Add the X index to this position for a given object:

Y( "Group.Friends" ) * 1280+ Alterable Value B( "Group.Friends" )

For example:

1) You need to represent up to 1,280 objects on a row (this is how many horizontal pixels there are).

2) There are 720 vertical pixel positions in a 720p resolution screen.
This means the maximum value for an object is 921600.

3) For an object at X=123 and Y=420, the row "block" is:
420 * 1280= 537,600

4) And the X index is 123, giving a final sort number of:
537,600 + 123 = 537,723

Another object might be at X=574, Y=420, giving:
420 * 1280= 537,600
537,600 + 574 = 538,174

Which means it would be sorted "after" the first example object, and therefore drawn over it (if they are large enough to overlap).

Linky correct me if I messed up anyway plz

[Edit: I did fix my math after remembering that you need to do more work to make the 2D array lower resolution than the full width of the screen.]

• ## Where can I find this effect?

(For anyone else who finds this thread in the future...)

This is the closest to a canonical place to find effects as far as I know:

• ## repeat texture when scale

Easiest way to do this just for cubes would definitely be to create 6 planes using a bit of event code or XLua code.

• ## Better way to import animations?

I figured it out! The code got a bit messy, but I think it works

Thanks a ton for posting the solution you ended up going with, I wish more people did this! It is very helpful for others in the future.

• ## 2.3 million downloads :) Pumpkins knock down (free with ads)

That is a really amazing level of uptake! Congrats. Any tips to do that?

Also have you considered something like offering people an extra "X" levels for \$0.99 once they finish the first 10/20/30 or some other kind of add-on pack instead of running ads? Some users (like myself) won't even consider a game that has any kind of intrusive ads (so yeah I don't play a ton of games on mobile lol).

I'd be amazing to test the difference in financial performance between something like that (which I always feel more comfortable with) vs. ads, but of course you'd have to be careful and use a good A/B test model so that roughly half the users get the original scheme (based on if their Game Center ID is even or odd maybe?) and the other half get the tested scheme.

Anyway just a thought, and would love more info. Again, great job. Looks like a fun game too.

• ## repeat texture when scale

What primitives are you using? If planes then you can easily set this using the Texture Repeat Count X and Y values, I am not personally sure about the other primitives as they don't see to have these specific settings, but I'm sure it's possible somehow. For mesh objects you'd need to set the UV values properly in your external editor.

• ## Needing help with launching objects, third object being fired from another object facing left does not have an angle applied to it

I can't believe I didn't notice that, but thanks for pointing it out. Is it because the same event is firing two of the same projectile? Is the second "set angle" check just not working or is it applying it to the first of the two fired objects?

Yes, I believe it's because the same event is firing two of the same projectile. Aside from having a clone of the same object, you should also be able to fix it by splitting it into two separate events, one to fire the top & center and one to fire the bottom. This should ensure the scoping is correct for the second one.

I don't think the 3rd angle rotation set action is applying to the first launched object, because the first / top one remains oriented correctly (if it were setting it should be oriented downwards instead of upwards).

So, I'm guessing it's technically a bug of some kind in the set angle action, but as I can't see how the internals are implemented of course, can't be 100% sure. It could be something else or could even be as-intended for some other subtle reason. It's possible that, if this is the case, splitting the event in any way won't work but that would be... surprising to me, I would think that'd have been encountered before.

Yves could chime in maybe?

• ## Build 295.10 - Release Version

Yes, it will work in your simple example, but unfortunately, as I mentioned, this won't work in the case of my code because I need to select not only the Maximum but, at some point, also all objects positioned above the selected one or sometimes choose a couple of objects from the middle as well. It would be simple if we had it in the active object, just like the fixed value. Choosing Maximum and Minimum is not enough. I can do it personally, but it requires to create own Z-order system and control it during sorting. Workarounds that you have to craft for seemingly simple things. Such creations already require a certain level of knowledge, and CF has always been aimed at simple and fast creation.

For Clickteam, it's just adding a single return with the index position of the object in the oList and object scoping based on that value. For us, it's generating a significant amount of code, which will probably run slower.

You can compare lyrGetLevel() to anything you like, including for instance, another value's lyrGetLevel() value, which would tell you if it's above or below the given one.

• ## The recent major patch makes syncing alterable value names among qualifiers difficult.

I've also noticed this issue, though I can't say for sure that I used in the past it was pretty surprising to me -- especially if everything still remains index based. I had kind of thought that the change implied that everything would be more based on the assigned names, if that isn't the case this could be super confusing and furstrating especially for newcomers -- if two objects have different Alterable Values with the same name in different indices, I suspect that most people unfamilar with the index system will expect them to be the same "variable".

This may not help a ton, but maybe help a little bit, you have a WinBatch or Keyboard Maestro macro to press "Tab, Shift Tab, Space" x number of times for how many values you need to add, then bind that to a keyboard shortcut and press the shortcut after clicking on the blank area to the left of the New Alterable Values button. (I'm not sure if Keyboard Maestro lets you do parameters to input the number of repetitions you want, but you can do that in WinBatch for sure, or something similar.) Just a workaround though to make the labor less intensive. I'll see if I can get something to work like this in WinBatch and let you know if you're interested.

• ## changeable backdrop

Linky raises excellent points that I was not fully aware of. In fact my first answer was going to be, don't worry about it just use frames on an Active.

• ## Going crazy, how do I retrieve an actives animation direction value?

This is an interesting method but I don't see how it would work properly if having say a playing walk animation in the left and right direction with 10 frames each? Unless I misunderstood something?

With this approach, the first 10 frames of the right animation would be "dummy" frames essentially, just a copy of the walk-right animation cycle.

When the active turns right there can be a delay for the frame number to be in the correct range, which could be 10 frames or could be 0 frames. So, the direction you'd get would be incorrect for up to the first 10 frames (numbered 0-9) until it gets past frame 11 and then at that point it would loop back to frame 11.

This may or may not work for your game based on your graphics and other interactions obviously.

In this clip, I have the frame speed set to 10 so it's easier to see the values changing:

• ## Going crazy, how do I retrieve an actives animation direction value?

I did just find a way to sort of do it, by using different loop values in the animation frames. This is just with 1 or 2 frames but it could work with actual animations too, such as frames 1-16 for left-facing and 17-32 for right-facing:

Code
``````* Always
Player_Head : Set angle to ATan2(Y( "Player_Head" ) - YMouse, XMouse - X( "Player_Head" )) (Quality = 1)
Player_Head : Set direction to Angle( "Player_Head" ) / 11.25
Counter 3 : Set Counter to Image( "Player_Head" )``````
• ## Going crazy, how do I retrieve an actives animation direction value?

Again in this case, you can use the same input as used in the animation/movement logic (in this case mouse position, but it could be an AI variable for instance) in order to determine which one will be selected. Just one of many ways to do this:

Code
``````* Always
Player_Head : Set angle to ATan2(Y( "Player_Head" ) - YMouse, XMouse - X( "Player_Head" )) (Quality = 1)
Player_Head : Set direction to Angle( "Player_Head" ) / 11.25
Counter 3 : Set Counter to CompareIntegers( "Immediate If Object", XMouse - X( "Player_Head" ), "<", 0, 16, 0 )``````

Is there some reason you don't want to use the input values and/or Alterable Values to determine the result?

• ## Examples or inspiration for blood spray or other liquids?

Was thinking about pooling this morning and seems like the same object could be useful for that too.

• ## Needing help with launching objects, third object being fired from another object facing left does not have an angle applied to it

I see, do you know why the original error happens in the first place? The event works just fine when the Friend is facing the right, but it only acts up when the Friend (or any object) is facing to the left.

If I'm not mistaken, the issue is just less obvious on the right side because the shot graphics are oriented that way.

You can see here that the center and bottom shots are aligned to each other:

• ## Examples or inspiration for blood spray or other liquids?

The Particle Spray object has a lot of potential for blood and other liquid effects.

Quick example I threw together as a blood spray...

• ## changeable backdrop

Active backdrop is probably your friend:

Code
``````* Button btnLeft clicked
+ Image( "Active Backdrop" ) = 1
Active Backdrop : Set image to 0

* Button btnRight clicked
+ Image( "Active Backdrop" ) = 0
Active Backdrop : Set image to 1``````

• ## Animation Corrupts while trying to Import

It looks kind of like it might be a transparency issue. Do you use a transparency color or do you use an alpha channel for your spites?

If you're able to post an original Aseprite file and a mfa that show the issue (maybe make a new one as an issue reproduction sample, if you don't want to post your source files) I'll look into it, I have Aseprite as well (though I mostly use permanant markers and Photoshop for my sprites lol)

• ## Needing help with launching objects, third object being fired from another object facing left does not have an angle applied to it

Ah okay, this makes more sense suddenly to me after seeing it in action for some reason.

The problem is essentially a scoping issue, I think. I was able to fix it by creating a clone of the Friend Attack object named Friend Attack 2 and modifying the actions for the third shot to use that object:

(To keep collision detection simplified you'll want to apply a Qualifier to the shots so they all can be tested against at once, so that duplicate Friend Attack object won't be too much of an issue with other parts of the Eventing.)