# Posts by King_Cool

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.
• ## Do you use "never"?

I mainly use it to temporarily deactivate an Event when i test my Application.
Im unsure if the Never condition can actually prevent Actions from triggering, but would be fun to check if this is possible

• ## Shooting an object at another object is wildly inaccurate

You can get this kindog inaccuracy when using some of the built in movements, since many of them use 32 directions only.

For more a more accurate/ smooth result you should do 2 things.

USE FLOAT X Y COORDINATES
The built in coordinate system is int based, meaning an Object cant have a X or Y coordinate of, say, 5,5 or 8,33 ( if you try it will 'round' the coordinate ).
This is in many cases a problem if you want to apply more smooth movements to Objects.
AlterableValues can hold Float values ( decimal numbers ), so to use Float coordinates give your bullet 2 AltValues called X_ and Y_.

USE 360 DEGREES OF MOVEMENT
Many of the built in movements are limited to a maximum og 32 directions of movement, wich as you have experienced can be quite inaccurate for longer travel distances.
To give your bullet 360 degrees of directional movement as opposed to only 32 directions, give your bullet an AltValue called Angle_

MOVE
To now make your bullet move in a direction at a speed, do this code:

+ Allways
-> bullet set X_ to X_ - Sin( Angle_ ) * speed
-> bullet set Y_ to Y_ + Cos( Angle_ ) * speed

• ## Compare range of alterables B with the same alterable A simultaneously

I see that this is allready solved, but would like to present an alternative idea.

You could do this without any loops, by 'assuming that all object within the range have POSE 1' and simply cancle/ deactivate this default behaviour if ANY of the objects within the range have POSE 0 by doing a simple Event like this

+ Obj ID within range
+ Obj POSE = 0
-> Cancel action ( somehow )

• ## State machine AI for multiple enemies

The idea about replacing an Active Object to change State is an interesting one.

You have a qualifyer on each of the AOs that can reffer to the Enemy in general, while State specific code could reffer to the specific AOs representing the State.

A potentiall ( am not sure but thiink it will be an issue ) issue with this would be frequent fram drops/ lag as muliple enemies change states, due to the fact that a new AO with a new set of graphics and animations will be loaded on each State change.
It depends on the graphical size of the AO an number of Frames/ Animations it has of cource, for example if its 2-3 animations per State with 5 Frames per animation i dont think it would impact performance much.

Transferring data from one AO to another uppin State change is unproblematic.

Id like to suggest however to just roll with State change based on an AltValue and just accept the extra conditions youll have to add.
Its not really that bad at all, CF is very powerfull and lets you create excellent fuctionallity in very short time, and the extra conditions youll have to add doesnt really deduct you or set you back much in terms of time or days.
It could be much worse.

• ## An arrow that shows where an out-of-frame object is relative to the player?

Here, a nice and simple example

• ## An arrow that shows where an out-of-frame object is relative to the player?

I think this should work:

- Allways
-> Arrow setX to:
Max( XleftVissibleFrame, Min( XrightVisibleFrame, EnemyX ) )
-> Arrow setY to:
Max( YtopVissibleFrame, Min( YbottomVissibleFrame, EnemyY ) )

• ## How to Click on Transparent Objects?

Alpha Channels is the solution here.

...
A click on an Object ( with 'Fine Detectin' ON ) will be detected when you click any part of the Object where graphic has been applied.
Example, if you draw 3 small dots as your image for an Active Object, a click will only be detected if you click on any of these three drawn dots.

#1 You want a circular object
#2 with a transparent hole in it
#3 and you want a click on the object to be detected both 'on' the graphical circle but also 'inside' the transparent hole

...
SOLUTION: ALPHA CHANNELS

"A click on an Object ( with 'Fine Detectin' ON ) will be detected when you click any part of the Object where graphic has been applied."

You will have to draw the circle, but also apply some graphic to the areas you want to be clickable ( in this case the center of the circle ).
After this you just apply an Alpha Channel to the image to 'selectively' make areas/ parts of the original image transparent or semi-transparent.
To create/ edit Alpha Chanel for an image, from the Animation Frame Editor click on the icon to the right of the flip/ crop buttons in the Editor.

Alpha Channels can be tricky to work with at first, but its a very good tool once you get to know it.
You can apply semitransparent areas to parts of an image, like for windows of a car or a house, or use it for other purposes.

• ## State machine AI for multiple enemies

I tested to see if 'Behaviour Events' for Instances handle 'Group Of Events' seperatly ( see example ).
According to the test it does not.

It appears that the 'Behaviour Events' for an Object is global for all Instances of the Object.
In the context of this thread it means that if 1 Enemy Instance changes from one State to another ( Deactivates one Group and Activates another ), this happens for all other Instances as well.

...
I had another idea, about creating new Behaviours for each of the States and simply switch between the behaviours to swich States.
I'm not sure this will work any better but am not able to test this as I cant find any way to swich/ activate/ deactivate behaviours from the Event Editor.

• ## Applying texture to auto-tile tiles

I dont have access to CF from here so i cant check

• ## How do I get current timestamp of a sound that is playing?

Do you mean like getting the songs possition in milliseconds?
If this is the case you shoul easily be able to easily be able to get this info from an Action in the Event Editor.

There might be other Extencions or something being able to detect Bass and such, but im not sure.

• ## State machine AI for multiple enemies

I like Volnaiskras marble analogy and think it descibes the scenario quite well.

I can recognize 2 ways of implementing a State Machine for multiple enemy instances.
The question of using Loops or not is unrelevant from my point of view, as you can often avoid using Loops by taking goog advantage og AlterableValues.

#1
( as mentioned previously )
For all Events that belong to a particular State, add a Condition "State=..." on top of that Event.

I didnt read everything too carefully so forgive me if im wrong here, but i understand that you are worried about (A) code looking messy and (B) Events running unessesarily when States are inactive and potentially resulting in some kind og lag/ slowdown of the Application.

-A-
I wouldnt worry much about the extra condition on Events using thos method. If your using this method this is the way it has to be, but it only means you have to insert this extra Condition ( State=... ) for Events relating to Enemies behaviour/ AI and not ALL events.
Code 'will' get messy, try to make the best out of it.

-B-
I wouldnt worry much about this if you do it correctly,considder theese Events and let me explain:

EVENT#1
+ State = 5
+ Enemy ShotsFired =< 3*NumberOfEnemies+1/ ClipSize
+ Enemy is overlapping Player
-> Do some Action...

EVENT#2
+ State = 5
+ Enemy is overlapping Player
-> Do some Action

Fusion runns Events and Condition from top to bottom.
- If no Enemies have State=5, the only part of the Events that will get checked is 'is State=5?' ( wich will be False ) and Fusion will skip the rest of the Conditions ( Fusion will not use resources to do the calculation or perform the colision check ) and move on to tje next Event below.
So nothing is running unessesarily or eating wast resorces as long as the 'fundemental' Condition in this case ( State=... ) is placed First.
- in the case that 2 of 5 Enemies have State=5, Fusion will first select the 2 Enemies and then perform the calculation and colision check for theese 2 Enemies.

#2
( also as mentioned previously ) Implement the Enemies State Machine code/ behavior inside the Enemies 'Behavior Event Editor'.
I have not used this method before, bit i assume it will enable/ dissble GroupsOfEvents dynamically.
Id be more than happy to test this and provide an example when im back.

Ive also heard there are some ( minor maybe ) issues with Behaviour Events, but it should be a perfectly valid way to code.
One thing i would like to 'stress' however ( if choosing to work with Behaviour Events is this:

Fusion checks Events from top to bottom, and the ordet your Events are triggered do matter and can be critical ( especially for large or complex creatoons ).

There a few different Event Editors, and its wize to know in what order they are checked.

I will list them here in the order ther are checked:
- Frame Events
- Global Events
- Behaviour Events

Also note that if you choose to work woth multiple Event Editors, you need to jump back and forth between them to get a complete overview of whats going on ( as opposet to using only 1 of the Editors to have 1 compleete list of all your code ), but if you know what your doing or have planned carefully this shouldnt be a huge issue.

I reserve the right to be wrong about any of this, and please correct me if im wrong.

Hope this helps.
Huggs and kisses

Is your first issue ( Image A1 ) that the pieces are in the wrong place?

NOTE: Although it says 'Animation Frame' 1, 2,3 and 4 in the Animation editor ( in your image above ), 'Animation Frames' are actally 'zero based'. This means to correctl reference the 'Animation Frames' you have to reference them as 'Animation Frame' 0, 1,2 and 3

After you have assigned an ID to each instance ( used 'spead value' ), and applied the code for changing AnimFrame, this should be the result
- Instance with ID=0 ( Displays AnimFrame#0 )
- Instance with ID=1 ( Displays AnimFrame#1 )
- Instance with ID=2 ( Displays AnimFrame#2 )
- Instance with ID=3 ( Displays AnimFrame#3 )

Unerstanding the about, it should simply be a matter of determining if the Instances are created in the wrong place or in the wrong order, or you could also change the order of the 'Animation Frames' so that the pieces gets displayed correctl ( initially ).

• ## How can I simplify my code for this star rating system?

I'm not sure you could do it much simpler than this

• ## Could I simulate different IOS phones in Fusion 2.5?

I was thinking about this in terms of visual layout only, not nessesarily a running simulation of the Frame/ Application.
Like you could click a "test" button inside one of your Application Frames, and CF would visually represent how the Frame would look ( as a still picture of the running Frame ) running on different mobile devices.

The point of it would be to gauge how your Application would look on, and fit onto, different target displays/ devices ( iPhone 5, iPhone6, Samsung Galaxy S, Samsung Galaxy Alpha, Elephone etc etc ).
So for example if the "simulation" shows black bars around the edges of the simulated display, or parts of the GUI are outside the simulated display, or some other visual aspect is not right, the developer can quickly adjust the Application to fit his/ her desired target Devices/ Platform.

• ## I need help making a inventory system

It might be helpfull if youd be more specific about what you are looking for or wanting to do.
There are many kinds of inventory systems.

• ## 'Wargame Map Object' 'Cost Of Tile' bug?

Hi
I'm using the Wargame Map Object and I have either ( #1 ) run into a problem I don't understand, or ( #2 ) discovered a bug.

The 'Wargame Map Object' by default creates a hex map where all tiles have the cost of '1'.
Whenever I try to use the Condition 'Compare cost of Current Tile at X Y', it allways triggers regardless.

In the attached .mfa all tiles should have the cost of '1', but when I create an Event checking if a specific Tile has the cost of '65', the Event it triggers.

Am I doing something wrong?
Is there a workaround maybe?

• ## Need some pointers on object manipulations

I expanded upon the original example just for fun

• ## Inputing screen shots of game as active objects into game.

Im quite sure there is more than one way to do this.

The game "Silece Of The Sleep" ( made with fusion ) did something like what you are describing, where the player would be asked to draw a picture and then the picture would be represented at a later stage of the game.

There is a 'Screen Capture Object' that should be able to save a section of the Frame as jpg or png file, and then you could maybe use the 'Active Picture Object' ( which can have Movements and stuff ) to load the same jpg/ png.
I'm not sure if the Active Picture Object will be limited to 'box collision' though ( no fine collision detection ), in case you want the 'captured section' to be interactable.

Hope this helps.

• ## Could I simulate different IOS phones in Fusion 2.5?

Agree
This would be a nice feature

• ## Need some pointers on object manipulations

Something like this?

Also you could try playing around with Sin()/ Cos() functions to get some cool effects