Problem with Blitter

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 because you run the "blit" loop for both blitter objects if you press the middle mouse button or even simultaneously left and right. Since in that scenario both blitters have internal flag 1 on, the blit loop process both of them at the same time. And that messes up object selection and such. You can easily fix it with ForEach extension, or any other method that selects only one object at a time that you prefer.

  • That is because you run the "blit" loop for both blitter objects if you press the middle mouse button or even simultaneously left and right. Since in that scenario both blitters have internal flag 1 on, the blit loop process both of them at the same time. And that messes up object selection and such. You can easily fix it with ForEach extension, or any other method that selects only one object at a time that you prefer.

    Hm yes, I tried to have it run a ForEach loop and on that loop start the Blit loop but it is still same problem :/

  • Turns out this does not work in Flash again.. I just abandoned another project because I had problems getting it to work with ForEach in Flash, and now this does not work either!. How are you supposed to get anything to work properly if you cant use the ForEach object? I thought this object was supposed to be stable in all runtimes? This is getting really frustrating.

    My other thread: Please login to see this link.

    Is it possible to do this without the ForEach object?

    Steam games: Please login to see this link.

  • Sure you can.

    Nice thanks, unfortunately my real app still breaks because I use ForEach in other places. Is that object supposed to be this buggy? It seems really hard to do some stuff without using the ForEach object?

    I tried to do the other events without the ForEach by using the same method, but I cant get it to work. I have an example here of trying to get the healthbars to position themselfs at the right enemy. With ForEach that is easy, but i cant get it to work with regular loops.

    EDIT: OK I think I solved it. It would be nice if these bugs with ForEach coud be investigated though, because it is really much easier and cleaner to use them. I dont really understand why it is even available for SWF if it breaks everything when using it.

  • You don't need to do it that way. There is commonly used technique for just this type of object pairing. Just use something like this
    *Always
    +HP bar: set position to "Enemy"
    +HP bar: set HP to HitPoints("Enemy")

    If there's same number of Enemy and HPbar objects, they will pair flawlessly.

  • You don't need to do it that way. There is commonly used technique for just this type of object pairing. Just use something like this
    *Always
    +HP bar: set position to "Enemy"
    +HP bar: set HP to HitPoints("Enemy")

    If there's same number of Enemy and HPbar objects, they will pair flawlessly.

    That is very wonky though? If you have 100 enemies, you need to make sure they actually have "their" health bar set to them. The real events does not just set the position, but also make sure it sets the health to that actual enemies health.

    Steam games: Please login to see this link.

  • It's not wonky at all. That is one of the features of mmf in how it handles actions on multiple objects(action loop).

    Thanks that is really neat :) I will try to replace my looping with this method. So if you can do this stuff without loops, when would be the case that you would want to use looping?

    Steam games: Please login to see this link.

  • Well I would say any time you need to ensure that you are working on one specific object. For example when you are calculating line o sight. You need to calculate it for each object separately. But there are many other scenarios where looping is the right thing to do. The above example is one of few instances where "action loop" works in your favor. Often times it's actually messing things up.

  • Well I would say any time you need to ensure that you are working on one specific object. For example when you are calculating line o sight. You need to calculate it for each object separately. But there are many other scenarios where looping is the right thing to do. The above example is one of few instances where "action loop" works in your favor. Often times it's actually messing things up.

    Hm it actually seem to mess some things up when i try to implement it in my bigger project. It seems hard to have much control when pairing objects and not using loops

    Steam games: Please login to see this link.

  • Yeah you don't have any control with this method. Like with loops, there is good side to it and bad side. Loops give you great control but can become quite performance draining. Action loop is faster but can behave in a way you don't want. So use only when appropriate.

  • Yeah you don't have any control with this method. Like with loops, there is good side to it and bad side. Loops give you great control but can become quite performance draining. Action loop is faster but can behave in a way you don't want. So use only when appropriate.

    Yes, but its good to know. I think I will stick to regular looping now. But it would be really nice if someone could take a look at the ForEach extension. It seems I use that one in any way it breaks everything for me when porting to flash.

    Steam games: Please login to see this link.

  • Yes, but its good to know. I think I will stick to regular looping now. But it would be really nice if someone could take a look at the ForEach extension. It seems I use that one in any way it breaks everything for me when porting to flash.


    What version of MMF2 are you using? I'm pretty sure that the ForEach object's Flash version got re-wrote in a recent beta for the Flash runtime.

    My Please login to see this link. (which I actually use), my Please login to see this link. (which I mostly don't use), and my Please login to see this link. (which I don't use anymore pretty much at all really). If there are awards for "'highest number of long forum posts", then I'd have probably won at least 1 by now. XD

Participate now!

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