I'm currently making a top-down rpg game, and need to make collision masks for my character and other objects. Is there any easy way to make collision masks for active objects? A visual explanation would be helpful, thanks!
How Do I Make Collision Masks For Active Objects?
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.
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.
-
-
Make a second active object and use an event to always position it directly on top of the first object.
You can then make it whatever shape you need. Register all collisions using the second object instead.
When you are happy it works well, you can then make it invisible on the object properties.
-
The method of PBarwick is the way to go if you only have to handle one instance of an object, however it can get very tricky if you have to handle a lot of instances of the same object, as you will have to use for each loops to handle the correct assignment of the collision objects to their parents.
I strongly recommend this tutorial about setting up so called "embedded" collision detectors.Please login to see this link.
What it basically means is that you have your active object --> switch to an embedded detector animation (the shape you want) and check for collision --> switch back to your displayed animation before the renderer triggers (end of your frame loop). If you really learn how to use it will allow advanced AI programming and a lot of other fancy stuff!
Unfortunately there is one big problem: The method is broken since build 285.0 (beta). It seems that CT changed the way animations are restored causing animations to freeze if you switch to an embedded detector and back within one frame loop. I posted it in the bugbox, but I don´t expect to get this fixed soon.. However you are fine if you use the last official release build 284.10
Hope that helps!Please login to see this link.
-
@ Julian82: that cool method still works if you keep track of animation frame number also (i.e. in a value)
and restore that after collision mask switching
but yeah - would be cool if this was automatic!///////EDIT: cancel that sorry -- just read your bugbox call -seems like it is happening nevertheless of frame stored now??
Sorry - wasn't aware of this. Going to check in depth!
Idea - maybe you can use your own frame-change timings and restore (last frame + timings) mod (number of animation frames)
but would need using additional two values per object (at least) and storing all number of animation frames (...)
Definitely would be cool if fixed XD (I'm on release build so can't actually see the issue here)another quite simple way, can be useful or not depending on situations,
is using "collision boxes" made by checking X,Y coordinates of player against X,Y coordinates of obstacles
it's a bit limited (without using fancy math) and for being really handy needs obstacles to be actives
but doesn't need for additional objects nor animations / animations switching -
schrodinger: I found this in the change log of build 285.0, which I think is causing the problem.
Changes in Windows Runtime:
- Active object: the current frame duration was not reset after animation changes causing the first frame of the next animation being played too quicklyYour are right, setting up a custom frame timing would surely fix it, but would be a lot of work... I think for now I will stick to the last release build
-
This was news to me lmao. I haven't used this method for an actual animated object for a while so I never noticed. After opening some older projects they seem to be suffering from the same problem
-
I've tried this, but it still doesn't work properly. when it tell the character to stop whe the mask hits an objects, the character just slowly walks through the object. I'm exceptionally confused!
-
KryFuZe: We would need an mfa to see what´s wrong with your code!
There´s good news on the embedded detection topic, in the latest beta a new option has been added to make it work again. Anyway, don´t upgrade to the latest beta now, it suffers from a severe array writing bug (has already been posted to the bug box).
Here quote from the change log file: A new "Do not reset frame duration after animation change" option has been added in the Active object's properties (Run options tab), as some applications have been affected by a previous fix that was done in the build 285.0 ("the current frame duration was not reset after animation changes causing the first frame of the next animation being played too quickly"). By default this option is not checked, i.e. the frame duration is reset, you have to check it if you want to keep the old behavior.
-
Interesting thing to know, thanks Julian82!
-
Checking that new option seems to gray out all Collision testing for the object, defeating the point
-
casleziro: Strange thing... collision detection was still fine on my build. You should consider posting to the bugbox!
-
The method of PBarwick is the way to go if you only have to handle one instance of an object, however it can get very tricky if you have to handle a lot of instances of the same object, as you will have to use for each loops to handle the correct assignment of the collision objects to their parents.
I strongly recommend this tutorial about setting up so called "embedded" collision detectors.Please login to see this link.
What it basically means is that you have your active object --> switch to an embedded detector animation (the shape you want) and check for collision --> switch back to your displayed animation before the renderer triggers (end of your frame loop). If you really learn how to use it will allow advanced AI programming and a lot of other fancy stuff!
Unfortunately there is one big problem: The method is broken since build 285.0 (beta). It seems that CT changed the way animations are restored causing animations to freeze if you switch to an embedded detector and back within one frame loop. I posted it in the bugbox, but I don´t expect to get this fixed soon.. However you are fine if you use the last official release build 284.10
Hope that helps!Please login to see this link.
Fascinating. I never knew this.
-
I think having a good understanding of ForEach and Fast Loops is such a generally applicable tool that I'd still pick using it over the embedded collision detector method, despite it's clever design. Whatever works best for you though is always the way to go!
-
Julian82 I'll do that
Please login to see this attachment.
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!