I've got 100 object A and 100 object B. I want object B to run away (look in the opposite direction) from object A if it gets too close. Here's my reasoning so far:
Every 1 second
- Spread 0 in ID B
- Start fastloop "loop1" (number of object B) times
on loop "loop1"
- Spread 0 in ID A
- Start fastloop "loop2" (number of object A) times
on loop2
+ A ID = loop index "loop2"
+ B ID = loop index "loop1"
+ distance between A and B (calculated using advance direction object) is close
- Set B direction to look away from A
- Stop loop "loop2"
Not working. Both loops are executed but the evaluation in loop2 isn't working for some reason. Not sure if it's my reasoning or an mmf quirk. This is mmf1.5 btw.
I toyed around with creating big active objects around all object As and having object Bs bouncing off of them but that would be inefficient.
First of all, you don't want to spread the value and start the fastloop on the same event. That's pretty much a guarantee that nothing'll work.
Second, you can also get it to work without the second loop. Instead, set Object B's value to the distance from the object A that's being tested, then have another event in the same loop to test if any object B has its value below the given distance.
-distance between A and B (calculated using advance direction object) is close
-pick object B
+set direction to dir A - 32
Doesn't something like this work?
-distance between A and B (calculated using advance direction object) is close
-pick object B
+set direction B to dir A - 32
Doesn't something like this work?
-distance between A and B (calculated using advance direction object) is close
-pick object B
+set direction B to dir A - 32
Doesn't something like this work?