I have this simple blitter. Do anyone know why it works fine if you spawn text individually (left or right mouse button) but freak out if you spawn two at the same time? (middle mouse button)
Printable View
I have this simple blitter. Do anyone know why it works fine if you spawn text individually (left or right mouse button) but freak out if you spawn two at the same time? (middle mouse button)
Still trying to fix this :/ Anyone know of a way?
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.
here it's fixed
Fixed value of currently iterating object of foreach loop "a".
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: http://community.clickteam.com/threads/81677-Another-Flash-bug
Is it possible to do this without the ForEach object?
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.
It's not wonky at all. That is one of the features of mmf in how it handles actions on multiple objects(action loop).
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.
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.
Hmm.. I am using R257.12
Is the example working for you if you build it for flash?
http://community.clickteam.com/attachment.php?attachmentid=10344&d=1375043864
Then you need to update to this version, since it fixes several Flash ForEach bugs due to a complete re-write of the Flash version of the object. Don't update to the latest version, that will just make other things go out of whack.
I haven't tested the file, but the fact that you are using an outdated version is probably the problem.
I read and heard that there are some other bugs in the later beta versions though, so I dont know if i want to upgrade if I am not sure this will fix ForEach, Min Max was apparently broken in the later versions. Could someone please test to build the example here and see if it works for you in Flash? http://community.clickteam.com/attachment.php?attachmentid=10344&d=1375043864
That isn't the beta version I linked to. I linked to the version right before it. The version before the latest is the version I have, and it doesn't have that bug.
Yup. Not Build 257.22 - Beta, Build 257.20 - Beta.