Limiting 'Look in direction of' to 8 directions (or fewer)

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.
  • Hi all,

    Is there a way to limit the 'look in direction' event to a number of directions? I'm associating the object Order with the direction (i.e. if the left direction animation is displaying, bring to front; if up direction is displaying, bring to back). I'm matching the direction value with a parent 'base' active and having that Always look at another object - but obviously there are 32 directional values involved in 'Always look in the direction of' which is messing up the effect somewhat.

    Is there a way to get the 'actual' direction of animation value that an object is currently displaying? That should be an effective solution. The Active Object I'm layering only has 8 directions of animation in there so if I could read the 'Direction displayed', perhaps, that would solve it.

    P.S. I've tried including all 32 directions 'Choose one or more directions' wheel but there's a conflict with the priority of layering on the direction values that exist between the true 8 directions 0,4,8, 12, 16, 20, 24, 28 and 32. If there is an animation image at direction 0, 4 and 8, then the 2 and 3 values makes the layering stutter, perhaps in a clash of priorities.

    It'll all blow over...

  • I have just solved this a few days ago with a simple expression.
    Code:

    Code
    ( ( ( Dir( "Character" ) mod 29 ) + 3 ) / 8 ) * 8


    My character has four “actual” directions, so I need to divide (32 / 4) = 8 and Mod (32 - 8 / 2) +1 = 29.
    The expression will normalize real direction to “actual” direction according to the follow rules:
    0:[29~31]、[0~4]
    8:[5 ~ 12]
    16:[13~20]
    24:[21~28]
    You can easily convert it to fit your project.
    Please login to see this attachment.
    ;)

    Edited once, last by defisym (September 12, 2019 at 4:48 PM).

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!